/*
 * Goals. Four selectable cards. Transcribed from src/components/product/Goals.tsx.
 *
 * Every value reads a --ge-* property whose fallback is the original design
 * value, so an untouched widget is pixel-identical and a control only ever
 * overrides the fallback.
 *
 * The tint mechanism: each card carries --ge-gl-sys and --ge-gl-sys-ink inline,
 * set from its own key in render(). Everything below reads those two, so this
 * file never names a system colour and a card can be re-tinted from the panel
 * without a new class or a new rule.
 *
 * The mixes toward the neutral surface are in srgb, not oklch. Mixing an accent
 * toward --ge-card in oklch interpolates the hue that pure white still carries
 * (89.88), which is how a navy tint came out taupe elsewhere in this project.
 * The mixes toward transparent stay in oklch, matching the shadow tokens.
 */

/* `hidden` must win.
 *
 * The UA stylesheet's [hidden] { display: none } is a single attribute
 * selector, so any class below that sets display would silently beat it.
 * Declared once, here, before anything else, so a later state toggle cannot
 * reopen the hole. Nothing in this section is toggled that way today; the
 * point is that the next edit cannot introduce it.
 */
.ge-gl [hidden] { display: none !important; }

.ge-gl {
  margin-inline: auto;
  max-width: var(--ge-gl-frame-max, var(--ge-frame-max, 1320px));
  padding: var(--ge-gl-pad, 64px var(--ge-frame-gutter, 12px));
  box-sizing: border-box;
  /* The nav is fixed. Without this the anchor lands under it. */
  scroll-margin-top: var(--ge-gl-scroll-mt, 80px);
}
@media (min-width: 640px) {
  .ge-gl { padding: var(--ge-gl-pad, 80px var(--ge-frame-gutter, 20px)); }
}

/* ------------------------------------------------------------------ head -- */

/* The heading and the standfirst share a baseline row rather than stacking, so
   the shared intro part is laid out as a wrapping flex row here. The eyebrow
   takes the whole first line; the other two sit either end of the second. */
.ge-gl .ge-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  column-gap: var(--ge-gl-head-gap-x, 48px);
  row-gap: var(--ge-gl-head-gap-y, 16px);
}
.ge-gl .ge-intro__eyebrow { flex: 0 0 100%; }
.ge-gl .ge-intro__heading { max-width: var(--ge-intro-h-measure, 16ch); }
/* Same variable the shared part reads, a per-section fallback. The gap is 0 by
   design because the row gap handles the wrapped state, and the control still
   works for anyone who wants the standfirst pushed down. */
.ge-gl .ge-intro__standfirst {
  margin: var(--ge-intro-sf-gap, 0px) 0 0;
  max-width: var(--ge-intro-sf-measure, 40ch);
  font-size: 15px;
  line-height: 1.7;
}

/* ------------------------------------------------------------------ grid -- */

/* One rule, not three. The column count is a responsive control, so Elementor
   emits its own breakpoint values for --ge-gl-cols. Writing my own min-width
   queries as well would mean two systems fighting over the same property. */
.ge-gl__grid {
  display: grid;
  gap: var(--ge-gl-gap, 12px);
  grid-template-columns: repeat(var(--ge-gl-cols, 4), minmax(0, 1fr));
  margin-top: var(--ge-gl-grid-gap, 36px);
}

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

.ge-gl__card {
  /* min-width: 0 or a grid child with a long word refuses to shrink and pushes
     the page sideways at 390. */
  min-width: 0;
  display: flex;
  flex-direction: column;
  /* No align-items: the children stretch, as the original does, so the label
     and the body wrap against the card's own width rather than their content. */
  text-align: left;
  cursor: pointer;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  border-style: solid;
  border-width: var(--ge-gl-card-bw, 1px);
  border-color: color-mix(in srgb, var(--ge-gl-sys, var(--ge-hair)) var(--ge-gl-tint-border, 35%), var(--ge-gl-hair, var(--ge-hair)));
  border-radius: var(--ge-gl-card-radius, var(--ge-radius-lg, 20px));
  padding: var(--ge-gl-card-pad, 20px);
  background: color-mix(in srgb, var(--ge-gl-sys, var(--ge-card)) var(--ge-gl-tint-bg, 7%), var(--ge-gl-base, var(--ge-card)));
  transition-property: transform, border-color, background-color, box-shadow;
  transition-duration: var(--ge-gl-card-dur, var(--ge-dur-base, 300ms));
  transition-timing-function: var(--ge-gl-card-ease, var(--ge-ease-out));
}

/* The card is a <button>, and Hello Elementor's reset (the live theme) sets
   `[type=button], button { white-space: nowrap }` at (0,1,0). Inherited by the
   label and body, it stopped every line wrapping: battery's goals ran 416px in
   a 316px body and laid the whole page out at 453px on a 390 phone (checklist
   111, ge-golive item 08). Compound selector so it beats the reset whatever
   the load order. No breakpoint on purpose: at 1440 and 1680 the same nowrap
   ran each line under the NEXT card ("Use the power you already made instead
   of buyi..."), measured on all four product pages, so desktop needed the fix
   too. Wrapping against the card is the design at every width. */
.ge-gl .ge-gl__card { white-space: normal; }

.ge-gl__card:hover {
  transform: translateY(var(--ge-gl-card-lift, -4px));
  border-color: color-mix(in oklch, var(--ge-gl-sys, var(--ge-green)) var(--ge-gl-tint-border-h, 60%), transparent);
}

/* The focus ring is a token. The React original points at an undefined
   --volt here, which invalidated the whole declaration and left the keyboard
   ring at the browser default everywhere on the site. */
.ge-gl__card:focus-visible {
  outline: none;
  box-shadow: var(--ge-shadow-focus-ring);
}

/* Chosen, after hover on purpose: equal specificity, so source order is what
   keeps the volt border on a card that is both chosen and hovered. */
.ge-gl__card[aria-pressed="true"] {
  border-color: var(--ge-gl-on-border, var(--ge-green));
  background: color-mix(in srgb, var(--ge-gl-on-bg, var(--ge-green)) var(--ge-gl-on-bg-mix, 10%), var(--ge-gl-base, var(--ge-card)));
  box-shadow: var(--ge-gl-card-shadow-on, var(--ge-shadow-volt-option));
}
.ge-gl__card[aria-pressed="true"]:focus-visible {
  box-shadow: var(--ge-shadow-focus-ring);
}

/* ------------------------------------------------------------------ chip -- */

/* Tinted at rest, volt once chosen. Identity gives way to state, so the two
   never argue about what green means. */
.ge-gl__chip {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--ge-gl-chip-size, 44px);
  height: var(--ge-gl-chip-size, 44px);
  border-radius: var(--ge-gl-chip-radius, 14px);
  background: color-mix(in srgb, var(--ge-gl-sys, var(--ge-card)) var(--ge-gl-chip-mix, 22%), var(--ge-gl-base, var(--ge-card)));
  color: var(--ge-gl-sys-ink, var(--ge-ink));
  transition-property: background-color, color;
  transition-duration: var(--ge-gl-card-dur, var(--ge-dur-base, 300ms));
  transition-timing-function: var(--ge-gl-card-ease, var(--ge-ease-out));
}
.ge-gl__card[aria-pressed="true"] .ge-gl__chip {
  background: var(--ge-gl-on-chip-bg, var(--ge-green));
  color: var(--ge-gl-on-chip-fg, var(--ge-ink));
}

.ge-gl__icon {
  display: block;
  width: var(--ge-gl-icon-size, 20px);
  height: var(--ge-gl-icon-size, 20px);
}
.ge-gl__tick {
  display: none;
  width: var(--ge-gl-tick-size, 20px);
  height: var(--ge-gl-tick-size, 20px);
}
.ge-gl__card[aria-pressed="true"] .ge-gl__icon { display: none; }
.ge-gl__card[aria-pressed="true"] .ge-gl__tick { display: block; }

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

.ge-gl__label {
  display: block;
  margin-top: var(--ge-gl-label-gap, 16px);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--ge-gl-label-color, var(--ge-ink));
}
.ge-gl__body {
  display: block;
  margin-top: var(--ge-gl-body-gap, 6px);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ge-gl-body-color, var(--ge-body));
}

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

/*
 * The cards render visible and the keyframe brings them in. No observer, no
 * script in this path, so the failure mode is a plain visible row.
 *
 * The rise animates `translate`, not `transform`, on purpose. An animation
 * with fill-mode forwards outranks a normal declaration, so a filled keyframe
 * ending in `transform: none` would permanently kill the hover lift. Two
 * separate properties cannot fight.
 */
@media (prefers-reduced-motion: no-preference) {
  .ge-gl__card {
    opacity: 0;
    animation: ge-gl-rise var(--ge-gl-rise-dur, 600ms) var(--ge-gl-card-ease, var(--ge-ease-out)) forwards;
    animation-delay: calc(var(--ge-gl-i, 0) * var(--ge-gl-stagger, 60ms));
  }
}
@keyframes ge-gl-rise {
  from { opacity: 0; translate: 0 26px; }
  to   { opacity: 1; translate: 0 0; }
}

/* The editor re-renders on every keystroke, and a card that replays its
   entrance each time is unusable to edit. */
.elementor-editor-active .ge-gl__card { opacity: 1; animation: none; translate: none; }
