/*
 * Product hero. Transcribed from src/components/product/ProductHero.tsx and the
 * SOLAR.hero config on the React build.
 *
 * Same bones as the home page hero (copy left, art right) but everything comes
 * from config there and from a control here, so the battery page swaps the art
 * layer and the copy and is done.
 *
 * House rule: every declaration reads a --ge-* custom property whose FALLBACK is
 * the original design value. An untouched widget is therefore pixel-identical to
 * React, and a control only ever overrides the fallback. No inline styles except
 * the one per-bar ratio the widget has to compute, no !important, nothing keyed
 * to a post id.
 *
 * Keyframes are namespaced ge-phero-*. hero.css already owns ge-rise and
 * ge-unmask, and a product page loads only ge-prodhero, so sharing the names
 * would mean two files quietly competing for one definition.
 */

/* A defeated [hidden] renders the wrong state on top of the right one and logs
   nothing, so close it once here before any later display declaration can
   reopen it. The UA rule is a single attribute selector and loses to any class
   that sets display. */
.ge-phero [hidden] { display: none !important; }

.ge-phero {
  margin-inline: auto;
  max-width: var(--ge-phero-frame-max, var(--ge-frame-max, 1320px));
  /* The bottom padding is load-bearing. The section below this one is an
     edge-to-edge dark band, and without it the artwork sits flush against a
     black edge. */
  padding: var(--ge-phero-pad, 16px var(--ge-frame-gutter, 12px) 48px);
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .ge-phero { padding: var(--ge-phero-pad, 24px var(--ge-frame-gutter, 20px) 80px); }
}

.ge-phero__grid {
  display: grid;
  align-items: center;
  gap: var(--ge-phero-col-gap, 32px);
}

@media (min-width: 1024px) {
  .ge-phero__grid {
    /* A percentage, not a raw fr pair, because calc() cannot do arithmetic on
       fr and an editor does not think in fr either.
       The React grid is 0.9fr / 1.1fr with a 40px gap. fr splits what remains
       AFTER the gap, a percentage is of the whole track: 1280 - 40 = 1240,
       1240 * 0.45 = 558px, and 558 / 1280 = 43.59%. Using the naive 45% would
       be 18px wide. */
    grid-template-columns:
      minmax(0, var(--ge-phero-text-width, 43.59%))
      minmax(0, 1fr);
    gap: var(--ge-phero-col-gap, 40px);
  }
}

/* ------------------------------------------------------------------ text -- */

.ge-phero__text { padding: var(--ge-phero-text-pad, 24px 0 0); }
@media (min-width: 1024px) { .ge-phero__text { padding: var(--ge-phero-text-pad, 0 0 0 24px); } }

.ge-phero__eyebrow {
  display: flex; align-items: center;
  gap: var(--ge-phero-eb-inner-gap, 12px);
  margin: 0 0 var(--ge-phero-eb-gap, 24px);
  font-family: var(--ge-type-micro-family, var(--ge-font-mono, "IBM Plex Mono", ui-monospace, Menlo, monospace));
  font-size: var(--ge-type-micro-size, 11px);
  font-weight: var(--ge-type-micro-weight, 400);
  letter-spacing: var(--ge-type-micro-lsp, 0.2em);
  text-transform: uppercase;
  /* The alpha lives in the rule, never in the control default. A colour bound
     to the Ink global emits a solid value and the alpha in a CSS fallback never
     runs, which is how four hero colours silently went solid. */
  color: color-mix(in oklch, var(--ge-phero-eb-color, var(--ge-ink)) var(--ge-phero-eb-alpha, 70%), transparent);
}

.ge-phero__rule {
  display: block; flex: none;
  height: var(--ge-phero-rule-h, 1px);
  width: var(--ge-phero-rule-w, 36px);
  background: var(--ge-phero-rule-color, var(--ge-green));
}

.ge-phero__headline {
  margin: 0;
  font-family: var(--ge-type-h1-family, var(--ge-font-display, "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif));
  /* Not the h1 token. The product headline is clamp(2.4rem, 4.4vw, 3.9rem) and
     the token is clamp(2.5rem, 4.6vw, 4.1rem); binding the typography group to
     the global would grow it. The group is registered unbound instead. */
  font-size: var(--ge-phero-h1-size, clamp(2.4rem, 4.4vw, 3.9rem));
  font-weight: var(--ge-phero-h1-weight, 800);
  line-height: var(--ge-phero-h1-lh, 1.03);
  letter-spacing: var(--ge-phero-h1-lsp, -0.04em);
  color: var(--ge-phero-h1-color, var(--ge-ink));
  text-wrap: balance;
}

.ge-phero__standfirst {
  margin: var(--ge-phero-sf-gap, 24px) 0 0;
  max-width: var(--ge-phero-sf-measure, 46ch);
  font-size: var(--ge-phero-sf-size, 16px);
  line-height: var(--ge-phero-sf-lh, 1.65);
  color: var(--ge-phero-sf-color, var(--ge-body));
}

.ge-phero__actions {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--ge-phero-btn-gap, 12px);
  margin-top: var(--ge-phero-act-gap, 32px);
}

/* ----------------------------------------------------------------- ticks -- */

/* Three proof ticks, one row. They are proof of approach, never a performance
   claim, so none of them carries a number that would need a basis. They stack
   below sm: a third of a 390px screen cannot hold "Designed around your home"
   on one line. */
.ge-phero__ticks {
  display: flex; flex-direction: column;
  gap: var(--ge-phero-tick-gap, 12px);
  margin: var(--ge-phero-ticks-gap, 36px) 0 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 640px) {
  .ge-phero__ticks {
    flex-direction: row; flex-wrap: wrap;
    /* A grid child or a flex child that holds anything wide keeps its default
       min-width: auto and refuses to shrink, which pushes the page sideways at
       390 and 768. */
    column-gap: var(--ge-phero-tick-col-gap, 24px);
    row-gap: var(--ge-phero-tick-gap, 12px);
  }
}

.ge-phero__tick {
  display: flex; align-items: center; min-width: 0;
  gap: var(--ge-phero-tick-inner-gap, 10px);
}
.ge-phero__tick-badge {
  display: grid; place-items: center; flex: none;
  width: var(--ge-phero-badge-size, 28px);
  height: var(--ge-phero-badge-size, 28px);
  border-radius: var(--ge-phero-badge-radius, var(--ge-radius-pill, 999px));
  background: color-mix(in oklch, var(--ge-phero-badge-bg, var(--ge-green)) var(--ge-phero-badge-alpha, 15%), transparent);
  color: var(--ge-phero-badge-fg, var(--ge-ink));
}
.ge-phero__tick-icon {
  width: var(--ge-phero-badge-icon, 14px);
  height: var(--ge-phero-badge-icon, 14px);
}
.ge-phero__tick-label {
  font-size: var(--ge-phero-tick-size, 14px);
  font-weight: var(--ge-phero-tick-weight, 500);
  line-height: var(--ge-phero-tick-lh, 1.375);
  color: var(--ge-phero-tick-color, var(--ge-ink));
}

/* ------------------------------------------------------------------- art -- */

/* Two full frame layers. The cut was taken from the same render as the base, so
   its perspective and contact shadow already line up and nothing is positioned
   by hand.
   Read the base before adding an overlay: iso-home-clean.png is NOT a bare
   house, it already carries a rooftop array, which is why solar ships with no
   overlay at all. Laying a cut over it puts a second array on the first. */
.ge-phero__media { position: relative; isolation: isolate; }

/* The same radial green wash the home page puts behind its dark rail, here as
   daylight behind the roof. It is a token, not a new colour, and it is the
   cheapest way to stop the hero reading as artwork pasted onto a flat page.
   filter: blur(), never backdrop-filter: backdrop-filter drops layers on the
   isometric scenes and hid the solar panels outright. */
.ge-phero__wash {
  position: absolute; z-index: -1; pointer-events: none;
  left: 50%; top: var(--ge-phero-wash-y, 6%);
  transform: translateX(-50%);
  width: var(--ge-phero-wash-w, 76%);
  aspect-ratio: var(--ge-phero-wash-ratio, 1 / 1);
  border-radius: var(--ge-phero-wash-radius, var(--ge-radius-pill, 999px));
  opacity: var(--ge-phero-wash-opacity, 30%);
  filter: blur(var(--ge-phero-wash-blur, 64px));
  background: radial-gradient(circle, var(--ge-phero-wash-color, var(--ge-green)), transparent var(--ge-phero-wash-stop, 68%));
}

/* The box is reserved by aspect-ratio, not by the image, and the image is
   eager. A structural image with loading="lazy" and no reserved box has nothing
   to intersect the viewport with, so the browser never schedules the fetch, so
   the box never gets a height: complete false, currentSrc empty, naturalWidth
   zero, height zero forever. Everything in this column, the card included, is
   positioned inside this box. */
.ge-phero__art {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ge-phero-art-ratio, 1672 / 941);
  /* 0 by default, so every existing cut out render is untouched. A photograph
     in this slot sets it and needs the clip to actually round the image. */
  border-radius: var(--ge-phero-art-radius, 0);
  overflow: hidden;
}
.ge-phero__art-base,
.ge-phero__art-overlay {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  /* contain, not cover. A bundle that hardcodes cover is right for a hero
     photograph and wrong for a cut-out render: it crops the roof off. */
  object-fit: var(--ge-phero-art-fit, contain);
  object-position: var(--ge-phero-art-pos, center center);
}
.ge-phero__art-overlay { pointer-events: none; }

/* ------------------------------------------------------------ glass card -- */

.ge-phero__cardwrap { position: absolute; inset: 0; pointer-events: none; }

/* The offsets are one responsive control each rather than a min-width query on
   a second variable name. React moves the card from right-0/top-2 to
   right-2/top-4 at sm; Elementor's own breakpoints are max-width, so a hand
   written min-width query and a responsive control would be writing the same
   value from two directions. The desktop default is the sm figure and the
   mobile default is the base figure. */
.ge-phero__card {
  position: absolute;
  right: var(--ge-phero-card-x, 8px);
  top: var(--ge-phero-card-y, 16px);
  width: var(--ge-phero-card-w, 186px);
  box-sizing: border-box;
  border: var(--ge-phero-card-border-w, 1px) solid var(--ge-phero-card-border, var(--ge-hair));
  border-radius: var(--ge-phero-card-radius, var(--ge-radius-card, 20px));
  background: var(--ge-phero-card-bg, var(--ge-card));
  padding: var(--ge-phero-card-p, 16px);
  /* The brand's own "Floating card" shadow, which is what this is. React draws
     0 18px 44px -16px of a hand mixed navy; the token is 0 10px 40px -12px of
     Ink at the same 28%, so the token is taken and the React value stays as the
     last resort. A hardcoded shadow is a shadow a marketer cannot restyle, and
     a second near-identical soft shadow is how a design system starts to drift. */
  box-shadow: var(--ge-phero-card-shadow, var(--ge-shadow-float, 0 18px 44px -16px rgb(16 24 40 / 0.28)));
}
.ge-phero__card-label {
  margin: 0;
  font-family: var(--ge-font-mono, "IBM Plex Mono", ui-monospace, Menlo, monospace);
  font-size: var(--ge-phero-card-label-size, 10px);
  letter-spacing: var(--ge-phero-card-label-lsp, 0.2em);
  text-transform: uppercase;
  color: color-mix(in oklch, var(--ge-phero-card-label-color, var(--ge-ink)) var(--ge-phero-card-label-alpha, 70%), transparent);
}
.ge-phero__card-figure {
  margin: var(--ge-phero-card-figure-gap, 6px) 0 0;
  font-size: var(--ge-phero-card-figure-size, 23px);
  font-weight: var(--ge-phero-card-figure-weight, 800);
  line-height: var(--ge-phero-card-figure-lh, 1);
  letter-spacing: var(--ge-phero-card-figure-lsp, -0.03em);
  color: var(--ge-phero-card-figure-color, var(--ge-ink));
}
.ge-phero__card-sub {
  margin: var(--ge-phero-card-sub-gap, 6px) 0 0;
  font-size: var(--ge-phero-card-sub-size, 12.5px);
  line-height: var(--ge-phero-card-sub-lh, 1.4);
  color: var(--ge-phero-card-sub-color, var(--ge-body));
}

/* The bars render at their final height from the first paint. Nothing here
   waits on an animation: the transition only smooths a later change of series.
   This project has twice shipped a block that was blank below the fold because
   its visible state was the end of a keyframe. */
.ge-phero__bars {
  display: flex; align-items: flex-end;
  gap: var(--ge-phero-bar-gap, 3px);
  height: var(--ge-phero-bars-h, 36px);
  margin: var(--ge-phero-bars-gap, 12px) 0 0;
}
.ge-phero__bar {
  width: 100%;
  border-radius: var(--ge-phero-bar-radius, 3px);
  background: var(--ge-phero-bar-color, var(--ge-green));
  /* --ge-phero-bar-v is the one value the widget computes: this bar's value as
     a fraction of the largest in the series. The floor and the opacity ramp
     stay here as tokens, so an editor can reshape the chart without the PHP
     having to agree with a second copy of the same two numbers.
     A floor, so a quiet month reads as a bar and not as a gap in the chart. */
  height: max(var(--ge-phero-bar-floor, 8%), calc(var(--ge-phero-bar-v, 1) * 100%));
  /* The quieter end of the series reads back rather than shouting. Both stops
     are percentages, because opacity accepts one and a unitless Elementor
     slider is not expressible: size_units => [''] is not a valid unit, so the
     control would render in the panel and emit nothing at all. */
  opacity: calc(var(--ge-phero-bar-alpha-min, 45%) + var(--ge-phero-bar-alpha-range, 55%) * var(--ge-phero-bar-v, 1));
  transition-property: height, opacity;
  transition-duration: var(--ge-phero-bar-dur, var(--ge-dur-slow, 450ms));
  transition-timing-function: var(--ge-ease-out);
}

/* The estimate label. Every performance figure on a product page gets one of
   these beside it, not only a footnote at the bottom of the page. It is a
   caption, not an eyebrow, so it is set in the body face at full strength:
   mono uppercase tracked out to 0.2em at 9.5px in body/70 measures 3.55:1 and
   was the least readable thing on the page. */
.ge-phero__card-note {
  margin: var(--ge-phero-note-gap, 8px) 0 0;
  font-size: var(--ge-phero-note-size, 12px);
  font-weight: var(--ge-phero-note-weight, 500);
  line-height: var(--ge-phero-note-lh, 1.5);
  color: var(--ge-phero-note-color, var(--ge-body));
}

/* ---------------------------------------------------------------- motion -- */

/* Entrance only, on load, in CSS. No observer and no script: an
   IntersectionObserver reveal is how this project shipped a blank section
   twice, and a fractional threshold on a section taller than the viewport can
   never be met at all. A load animation with `forwards` always completes, and
   with JavaScript off the section is simply visible, which is the correct
   failure.
   Delays are the React d1 to d7 choreography: eyebrow .06, headline .13,
   art .2, standfirst .28, buttons .36, ticks .46, card .58. */
@media (prefers-reduced-motion: no-preference) {
  .ge-phero__eyebrow,
  .ge-phero__headline,
  .ge-phero__standfirst,
  .ge-phero__actions,
  .ge-phero__ticks {
    opacity: 0;
    animation: ge-phero-rise var(--ge-phero-reveal-dur, 780ms) var(--ge-phero-reveal-ease, var(--ge-ease-out)) forwards;
  }
  .ge-phero__eyebrow    { animation-delay: var(--ge-phero-d-eyebrow, 60ms); }
  .ge-phero__headline   { animation-delay: var(--ge-phero-d-headline, 130ms); }
  .ge-phero__standfirst { animation-delay: var(--ge-phero-d-standfirst, 280ms); }
  .ge-phero__actions    { animation-delay: var(--ge-phero-d-actions, 360ms); }
  .ge-phero__ticks      { animation-delay: var(--ge-phero-d-ticks, 460ms); }

  .ge-phero__media {
    opacity: 0;
    animation: ge-phero-unmask var(--ge-phero-art-dur, 950ms) var(--ge-phero-reveal-ease, var(--ge-ease-out)) var(--ge-phero-d-art, 200ms) forwards;
  }
  .ge-phero__card {
    opacity: 0;
    animation: ge-phero-drift var(--ge-phero-card-dur, 700ms) var(--ge-phero-reveal-ease, var(--ge-ease-out)) var(--ge-phero-d-card, 580ms) forwards;
  }
}

@keyframes ge-phero-rise {
  from { opacity: 0; transform: translate3d(0, 26px, 0); }
  to   { opacity: 1; transform: none; }
}
@keyframes ge-phero-unmask {
  from { opacity: 0; transform: scale(1.06); clip-path: inset(0 0 14% 0 round 22px); }
  to   { opacity: 1; transform: none;       clip-path: inset(0 0 0 0 round 22px); }
}
@keyframes ge-phero-drift {
  from { opacity: 0; transform: translate3d(0, 14px, 0) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

/* The editor replaces the widget's DOM on every panel keystroke, and a
   staggered entrance that replays on each one is unusable. Show everything
   immediately inside the canvas. */
.elementor-editor-active .ge-phero__eyebrow,
.elementor-editor-active .ge-phero__headline,
.elementor-editor-active .ge-phero__standfirst,
.elementor-editor-active .ge-phero__actions,
.elementor-editor-active .ge-phero__ticks,
.elementor-editor-active .ge-phero__media,
.elementor-editor-active .ge-phero__card {
  opacity: 1; animation: none;
}

/* ---------------------------------------------------------- the rebate box --
 *
 * Opposite the saving card, so the top fold carries both halves of the money:
 * what the system saves every year on the right, what comes off the job once on
 * the left. The rebate used to appear nowhere on these pages, which had the
 * largest number a visitor sees buried two folds down inside a planner.
 *
 * Dark where the saving card is light, because they are different KINDS of
 * number and reading as a matched pair would invite adding them together. One
 * is a rate, the other is a one-off discount.
 */
.ge-phero__rebate {
  position: absolute;
  left: var(--ge-phero-rb-x, 0px);
  top: var(--ge-phero-rb-y, 52%);
  width: var(--ge-phero-rb-w, 232px);
  max-width: var(--ge-phero-rebate-maxw, 68%);
  pointer-events: auto;
  border-radius: var(--ge-phero-rb-radius, 20px);
  background: var(--ge-phero-rb-bg, var(--ge-ink));
  padding: var(--ge-phero-rb-pad, 16px 18px);
  box-shadow: var(--ge-shadow-float, 0 10px 40px -12px rgba(14, 21, 51, .28));
}
.ge-phero__rb-label {
  margin: 0;
  font-family: var(--ge-font-mono, "IBM Plex Mono", monospace);
  font-size: var(--ge-phero-rb-label-fontsize, 9px); letter-spacing: .14em; text-transform: uppercase;
  color: color-mix(in oklch, var(--ge-phero-on-dark, #fff) var(--ge-phero-rb-label-color-a, 60%), transparent);
}
/* The figure line. "up to" and "off" are their own elements so they keep their
   size and cannot be mistaken for part of the amount, and so the amount can be
   the only thing that is large without the qualifiers disappearing. */
.ge-phero__rb-figure {
  margin: var(--ge-phero-rb-figure-m, 6px 0 0);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--ge-phero-rb-figure-gap, 5px);
  color: var(--ge-phero-rb-fig, var(--ge-green));
}
.ge-phero__rb-upto, .ge-phero__rb-off {
  font-size: var(--ge-phero-rb-upto-fontsize, 12.5px); font-weight: 600; color: color-mix(in oklch, var(--ge-phero-on-dark, #fff) var(--ge-phero-rb-upto-color-a, 75%), transparent);
}
.ge-phero__rb-amount {
  font-size: clamp(1.5rem, 2.2vw, 1.9rem); font-weight: 800;
  line-height: 1; letter-spacing: -.035em;
  /* NOT tabular-nums. Tabular figures give every glyph a digit's advance width,
     including the comma, so "$9,000" prints as "$9 ,000" with a hole in it.
     Tabular is for a COLUMN of figures that has to align; this is one headline
     number, so proportional is correct. The saving card never showed this
     because its own figure has no comma in it. */
  color: var(--ge-phero-rb-fig, var(--ge-green));
}
.ge-phero__rb-sub {
  margin: var(--ge-phero-rb-sub-m, 8px 0 0); font-size: var(--ge-phero-rb-sub-fontsize, 11.5px); line-height: 1.45;
  color: color-mix(in oklch, var(--ge-phero-on-dark, #fff) var(--ge-phero-rb-sub-color-a, 70%), transparent);
}
/* For a system with no authorised published figure. It must never read as
   "there is no rebate on this": the number is missing because we have not been
   given one, which for solar is the actual situation. */
.ge-phero__rb-tbc {
  margin: var(--ge-phero-rb-tbc-m, 8px 0 0); font-size: var(--ge-phero-rb-tbc-fontsize, 13px); font-weight: 600; line-height: 1.4;
  color: var(--ge-phero-rb-tbc-color, #fff);
}

/* Below the split the artwork is full width and a box hanging off its left edge
   has nothing to hang into, so both boxes come back inside the frame. */
@media (max-width: 1023px) {
  .ge-phero__rebate { left: 12px; top: auto; bottom: 12px; width: auto; max-width: var(--ge-phero-rebate-maxw2, 58%); }
}

/* On a phone the artwork is not tall enough to float two boxes over it.
 *
 * At 390px the art box is about 235px tall. The saving card is 193px and the
 * rebate box 120px, so wherever they are anchored they overlap: measured at
 * 390px the card sat at x192-378 / y736-929 and the rebate at x24-236 /
 * y803-923, and the card covered half the rebate figure. Shrinking either one
 * to fit would make the only two numbers on the page the smallest text in it.
 *
 * So below 600px they stop floating and become normal-flow blocks under the
 * artwork, full width, in DOM order, which puts the rebate above the saving.
 * That is the right way round anyway: the rebate is the larger number and the
 * reason to keep reading, and the saving is the one that needs the caveat.
 * Floating over the image is a desktop idea and it stays a desktop idea. */
@media (max-width: 599px) {
  .ge-phero__cardwrap {
    position: static; inset: auto;
    display: flex; flex-direction: column; gap: var(--ge-phero-cardwrap-gap, 10px);
    margin-top: var(--ge-phero-cardwrap-mt, 14px); pointer-events: auto;
  }
  .ge-phero__card,
  .ge-phero__rebate {
    position: static;
    left: auto; right: auto; top: auto; bottom: auto;
    width: auto; max-width: none;
  }
}
