/* ==================== SES — SOLAR POWER SOLUTIONS ==================== */
/* Ported from storage/import/ses/ses.css (design source) for the /energy
   landing redesign. See SES_SPEC.md and storage/import/ses/README.md for
   the authoritative markup/breakpoint contract this file targets. */

.ses-features  .container { max-width: 1440px; }
.ses-solutions .container { max-width: 1440px; }
.ses-process   .container { max-width: 1440px; }
.ses-contact   .container { max-width: 1440px; }


/* ========== HERO ========== */

.ses-hero {
  padding: 20px 0 0;
}

.ses-hero__inner {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: var(--color-bg-2);
  padding: calc(var(--header-top) + var(--header-height-desktop)) 60px 50px;
}

.ses-hero__content {
  display: flex;
  align-items: stretch;
  gap: 80px;
}

.ses-hero__left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  min-width: 0;
}

.ses-hero__text {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ses-hero .breadcrumb__list {
  justify-content: flex-start;
}

.ses-hero__eyebrow {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
}

.ses-hero__title {
  margin: 0;
  font-size: clamp(38px, 4.6vw, 60px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.3px;
  text-transform: uppercase;
  background: var(--gradient-heading);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ses-hero__desc {
  max-width: 560px;
  margin: 0;
  font-size: 18px;
  font-weight: 400;
  color: var(--color-text);
  line-height: 1.5;
}

.ses-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.ses-hero__cards {
  display: flex;
  gap: 16px;
}

.ses-hero__card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.ses-hero__card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--color-white);
  border-radius: 6px;
  flex-shrink: 0;
}

.ses-hero__card-icon svg,
.ses-hero__card-icon img {
  display: block;
  width: 24px;
  height: 24px;
}

.ses-hero__card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-dark);
  text-transform: uppercase;
  line-height: 1.3;
}

.ses-hero__media {
  flex: 1;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.ses-hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* ========== EQUIPMENT CATEGORIES ========== */

.ses-categories {
  padding: var(--section-padding) 20px;
}

.ses-categories__grid {
  /* Design hardcodes repeat(4, 1fr); production ships 3 energy categories
     via the DB fallback, which would leave a hole in a fixed 4-column row.
     auto-fit lets 3 tiles fill the row evenly while 4 curated tiles still
     land on the design's one-row layout. Applied here (not as a later
     override) so it stays *before* the ≤1199px / ≤767px column overrides
     below in source order — same selector/specificity, so those still win
     at narrow widths. */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.ses-categories__tile {
  position: relative;
  display: block;
  overflow: hidden;
  min-height: 260px;
  border-radius: 16px;
  border: 1px solid rgba(231, 235, 240, 0.5);
}

.ses-categories__tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.4) 100%);
  pointer-events: none;
  transition: background var(--transition);
}

/* Hover intensification is scoped to `:not(--static)` — see the
   .ses-categories__tile--static rule under PRODUCTION ADDITIONS below,
   added for curated tiles that render without a link (Amendment 1). */
.ses-categories__tile:not(.ses-categories__tile--static):hover::after {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.55) 100%);
}

.ses-categories__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform var(--transition);
}

.ses-categories__tile:not(.ses-categories__tile--static):hover .ses-categories__photo {
  transform: scale(1.06);
}

.ses-categories__title {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  z-index: 2;
  color: var(--color-white);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}


/* ========== FEATURES ========== */

.ses-features {
  padding: var(--section-padding) 20px;
}

.ses-features__grid {
  display: flex;
  gap: 20px;
}

.ses-features__card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  text-align: center;
  padding: 24px;
  border: 1px solid rgba(231, 235, 240, 0.5);
  border-radius: 10px;
}

.ses-features__card:nth-child(odd) {
  background: linear-gradient(to bottom, #c8d1d9, #ffffff);
}

.ses-features__card:nth-child(even) {
  background: linear-gradient(to bottom, #d8cfc5, #ffffff);
}

.ses-features__icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--color-white);
  border-radius: 6px;
  flex-shrink: 0;
}

.ses-features__icon-box svg,
.ses-features__icon-box img {
  display: block;
  width: 24px;
  height: 24px;
}

.ses-features__card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.ses-features__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--color-dark);
}

.ses-features__desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: -0.07px;
  color: var(--color-text);
}


/* ========== SOLUTIONS FOR DIFFERENT NEEDS ========== */

.ses-solutions {
  padding: var(--section-padding) 20px;
}

.ses-solutions__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.ses-solutions__desc {
  max-width: 480px;
  margin: 0;
  color: var(--color-text);
  line-height: 1.5;
}

.ses-solutions__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.ses-solutions__card {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(231, 235, 240, 0.5);
  background: var(--color-white);
}

.ses-solutions__image {
  height: 220px;
  overflow: hidden;
}

.ses-solutions__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ses-solutions__copy {
  padding: 20px 22px 24px;
}

.ses-solutions__card-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--color-dark);
}

.ses-solutions__card-desc {
  margin: 10px 0 0;
  color: var(--color-text);
  line-height: 1.4;
  letter-spacing: -0.07px;
  font-size: 14px;
}


/* ========== HOW WE WORK ========== */

.ses-process {
  background: var(--color-bg-2);
  padding: var(--section-padding) 20px;
}

.ses-process__inner {
  display: grid;
  grid-template-columns: 1fr 420px;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "head  media"
    "steps media";
  column-gap: 100px;
  row-gap: 40px;
}

.ses-process__head { grid-area: head; }

.ses-process__steps {
  grid-area: steps;
  display: flex;
  flex-direction: column;
}

.ses-process__media {
  grid-area: media;
  border-radius: 16px;
  overflow: hidden;
}

.ses-process__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ses-process__step {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 20px;
}

.ses-process__step:last-child {
  padding-bottom: 0;
}

.ses-process__row {
  display: flex;
  gap: 25px;
  align-items: flex-start;
}

.ses-process__num {
  font-size: 40px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text-light);
  width: 40px;
  flex-shrink: 0;
}

.ses-process__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

.ses-process__step-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--color-dark);
}

.ses-process__step-desc {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.07px;
  color: var(--color-text);
}

.ses-process__divider {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 0;
}


/* ========== REQUEST FORM ========== */

.ses-contact {
  padding: var(--section-padding) 20px;
}

.ses-contact__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  padding: 44px;
  border-radius: 24px;
  background: var(--color-bg-2);
}

/* Left grid column (heading + copy + form). `min-width: 0` is required: a grid
   item defaults to `min-width: auto`, so a long unbreakable string inside the
   form would widen the column past its track and push the section sideways. */
.ses-contact__col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ses-contact__desc {
  max-width: 480px;
  margin: 18px 0 26px;
  color: var(--color-text);
  font-size: 16px;
  line-height: 1.5;
}

/* Design's static form field classes — kept ported for fidelity even though
   production renders the form via the Forms module (see the CMS form
   styling block at the end of this file, scoped under .ses-contact and
   targeting the actual `.sensei-form__*` markup emitted by
   themes/sensei/forms/lead.php). */

.ses-contact__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.ses-contact__input,
.ses-contact__textarea {
  width: 100%;
  min-height: 50px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  padding: 10px 24px;
  background: var(--color-white);
  font-family: inherit;
  font-size: 16px;
  color: var(--color-text-body);
  outline: none;
  transition: border-color var(--transition);
  -webkit-appearance: none;
}

.ses-contact__input::placeholder,
.ses-contact__textarea::placeholder {
  color: rgba(0, 0, 0, 0.5);
}

.ses-contact__input:focus,
.ses-contact__textarea:focus {
  border-color: var(--color-primary);
}

.ses-contact__select {
  cursor: pointer;
}

.ses-contact__textarea {
  grid-column: 1 / -1;
  min-height: 112px;
  padding-top: 14px;
  resize: vertical;
}

.ses-contact__visual {
  min-height: 420px;
  border-radius: 16px;
  overflow: hidden;
}

.ses-contact__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 1199px) {
  .ses-hero__content {
    flex-direction: column;
    align-items: stretch;
  }

  .ses-hero__media {
    flex: none;
    aspect-ratio: 4 / 3;
  }

  .ses-categories__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ses-features__grid {
    flex-wrap: wrap;
  }

  .ses-features__card {
    flex: 1 1 calc(50% - 10px);
  }

  .ses-solutions__grid {
    grid-template-columns: 1fr;
  }

  .ses-process__inner {
    grid-template-columns: 1fr 320px;
    column-gap: 60px;
  }

  .ses-contact__inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1023px) {
  .ses-hero__inner {
    padding: calc(var(--header-height-mobile) + 30px) 30px 40px;
    border-radius: 16px;
  }

  .ses-hero__cards {
    flex-direction: column;
  }

  .ses-process__inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "head"
      "media"
      "steps";
    row-gap: 32px;
  }

  /* Stacked layout: the media box no longer sits in a stretched grid row, so
     `img { height: 100% }` has nothing to resolve against and a portrait photo
     inflates the band to its intrinsic height. `aspect-ratio` pins the box the
     same way the hero media is pinned at <=1199px. */
  .ses-process__media {
    width: 100%;
    min-height: 280px;
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 767px) {
  .ses-hero__inner {
    padding: calc(var(--header-height-mobile) + 20px) 16px 32px;
  }

  .ses-hero__title {
    font-size: 32px;
  }

  .ses-hero__desc {
    font-size: 16px;
  }

  .ses-categories__grid {
    grid-template-columns: 1fr;
  }

  .ses-categories__tile {
    min-height: 220px;
  }

  .ses-features__card {
    flex: 1 1 100%;
  }

  .ses-solutions__head {
    display: block;
  }

  .ses-solutions__desc {
    margin-top: 16px;
    max-width: none;
  }

  .ses-contact__inner {
    padding: 28px 18px;
  }

  .ses-contact__fields {
    grid-template-columns: 1fr;
  }

  .ses-contact__textarea {
    grid-column: auto;
  }

  .ses-contact__visual {
    min-height: 260px;
  }
}


/* ==================== PRODUCTION ADDITIONS ====================
   Everything below adapts the ported design above to real CMS data:
   a category tile count badge, a flexible category grid (production has
   3 categories, the design hardcodes 4), and field styling for the actual
   CMS-rendered contact form (Forms module markup, not the static
   .ses-contact__form markup above). See SES_SPEC.md §6. */

/* ---------- Categories: item-count badge ---------- */
/* <span class="ses-categories__title">Solar panels<span class="ses-categories__count">42</span></span> */

.ses-categories__count {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  vertical-align: middle;
  white-space: nowrap;
}

/* ---------- Categories: non-clickable tile variant (Amendment 1) ---------- */
/* A curated tile whose target section doesn't exist yet renders as
   <div class="ses-categories__tile ses-categories__tile--static"> instead of
   an <a> — same box, but hover intensification (photo scale, extra
   darkening) is suppressed via the :not(--static) scoping above, and the
   element is not meant to read as interactive. */

.ses-categories__tile--static {
  cursor: default;
}

/* ---------- Categories: flexible grid for 3 (or 4+) tiles ---------- */
/* The auto-fit rule lives on the base .ses-categories__grid declaration
   above (not here) so it stays before the ≤1199px / ≤767px column
   overrides in source order — putting it after them would win at every
   width despite equal specificity, since a later same-specificity rule
   always wins. See the comment on the base rule for details. */

/* ---------- Contact form: CMS-rendered Forms module markup ---------- */
/* themes/sensei/forms/lead.php renders <form class="sensei-form
   sensei-form--contact"> for the `ses_request` form (see
   themes/sensei/forms/lead.php + themes/sensei/assets/css/forms.css for the
   base cross-site styling). Scoped entirely under .ses-contact so no other
   sensei-form instance on the site (modals, /contacts) is affected. */

.ses-contact .sensei-form__row {
  gap: 12px;
}

.ses-contact .sensei-form__input,
.ses-contact .sensei-form__select,
.ses-contact .sensei-form__textarea {
  box-sizing: border-box;
  height: 50px;
  min-height: 50px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  padding: 10px 24px;
  background: var(--color-white);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--color-text-body);
  outline: none;
  transition: border-color var(--transition);
}

.ses-contact .sensei-form__input::placeholder,
.ses-contact .sensei-form__select::placeholder,
.ses-contact .sensei-form__textarea::placeholder {
  color: var(--color-text-light);
}

.ses-contact .sensei-form__input:focus,
.ses-contact .sensei-form__select:focus,
.ses-contact .sensei-form__textarea:focus {
  border-color: var(--color-primary);
  outline: 2px solid rgba(252, 0, 8, 0.15);
  outline-offset: 1px;
}

/* appearance:none strips the native <select> arrow — replace it with an
   inline chevron (the design's primary red, --color-primary = #fc0008). */
.ses-contact .sensei-form__select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='14'%20height='8'%20viewBox='0%200%2014%208'%20fill='none'%3E%3Cpath%20d='M1%201L7%207L13%201'%20stroke='%23fc0008'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 14px 8px;
}

.ses-contact .sensei-form__textarea {
  height: auto;
  min-height: 112px;
  padding: 14px 24px;
  resize: vertical;
  width: 100%;
}

/* Two-column field grid (12px gap) via .sensei-form__field--half; the base
   half-width flex-basis assumes the site-wide 20px row gap, so re-derive it
   for the 12px gap used here. */
.ses-contact .sensei-form__field--half {
  flex: 0 1 calc(50% - 6px);
}

/* Consent checkbox + submit button span the full field-grid width. */
.ses-contact .sensei-form__check,
.ses-contact .sensei-form__btn {
  width: 100%;
}

/* Submit button follows the theme's .btn-primary look (48px, radius 8px,
   --color-primary, --shadow-btn) instead of the taller generic
   .sensei-form__btn default. */
.ses-contact .sensei-form__btn {
  height: 48px;
  padding: 10px 28px;
  border-radius: 8px;
  font-size: var(--fs-body);
  background: var(--color-primary);
  box-shadow: var(--shadow-btn);
}

.ses-contact .sensei-form__btn:hover {
  background: var(--color-primary-hover);
  opacity: 1;
}

.ses-contact .sensei-form__btn:active {
  background: var(--color-primary-active);
}

@media (max-width: 767px) {
  .ses-contact .sensei-form__field--half {
    flex: 1 1 100%;
  }
}
