/*
 * Project showcase. A two column split: type on the left, one photograph on the
 * right, a detail card hanging off the photograph's edge. Transcribed from
 * src/components/product/ProjectShowcase.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.
 */

/* `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, before anything else, so a later state toggle cannot reopen
 * the hole. The slide and card states are attribute driven and use opacity, not
 * display; this is here so the next edit cannot introduce the bug.
 */
.ge-sc [hidden] { display: none !important; }

/*
 * Full bleed, with the max-width on the inner grid rather than here.
 *
 * The detail card hangs past the grid's content edge, and the only room it has
 * is the grid's own gutter plus whatever margin is left once the 1320px frame
 * is centred. Clipping at the section, which is the full viewport width, means
 * a card that runs out of room is trimmed instead of dragging the whole page
 * sideways. `overflow-x: clip` never creates a scroll container, so unlike
 * `hidden` it cannot break a sticky descendant either.
 */
.ge-sc {
  padding: var(--ge-sc-pad, 64px 0);
  overflow-x: clip;
  box-sizing: border-box;
  /* The nav is fixed. Without this the anchor lands under it. */
  scroll-margin-top: var(--ge-sc-scroll-mt, 80px);
}
@media (min-width: 640px) {
  .ge-sc { padding: var(--ge-sc-pad, 96px 0); }
}

.ge-sc__grid {
  margin-inline: auto;
  box-sizing: border-box;
  max-width: var(--ge-sc-frame-max, var(--ge-frame-max, 1320px));
  padding-inline: var(--ge-sc-gutter, var(--ge-frame-gutter, 12px));
  display: grid;
  align-items: center;
  gap: var(--ge-sc-col-gap, 40px);
}
@media (min-width: 1024px) {
  /* 40.16%, not 42%. The original splits 42fr / 58fr with a 56px gap, and fr
     divides what is left AFTER the gap while a percentage is of the whole
     track. At the 1280px container this is drawn at, 42fr of (1280 - 56) is
     514px, which is 40.16% of 1280. 42% would put the split 23px out. */
  .ge-sc__grid {
    grid-template-columns: minmax(0, var(--ge-sc-copy-w, 40.16%)) minmax(0, 1fr);
    gap: var(--ge-sc-col-gap, 56px);
  }
}

/* min-width: 0 on both, or a grid child with a wide photograph in it refuses to
   shrink and pushes the page sideways at every width below the breakpoint. */
.ge-sc__copy,
.ge-sc__media { min-width: 0; }

/* The card is positioned against this from lg. */
.ge-sc__media { position: relative; }

/* ------------------------------------------------------------------ copy -- */

/* Same variables the shared intro part reads, with this section's own
   fallbacks. The original measures the heading at 14ch and the paragraph at
   42ch, and draws the paragraph a touch larger than the body token. */
.ge-sc .ge-intro__heading { max-width: var(--ge-intro-h-measure, 14ch); }
.ge-sc .ge-intro__standfirst {
  margin: var(--ge-intro-sf-gap, 20px) 0 0;
  max-width: var(--ge-intro-sf-measure, 42ch);
  font-size: 15px;
  line-height: 1.7;
}

/* A pill, not an underlined link. A link floating in a header row read as
   navigation rather than as the next step. */
.ge-sc__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--ge-sc-cta-icon-gap, 10px);
  margin-top: var(--ge-intro-cta-gap, 28px);
  border: 1px solid var(--ge-sc-cta-border, var(--ge-hair));
  border-radius: var(--ge-sc-cta-radius, var(--ge-radius-pill, 999px));
  padding: var(--ge-sc-cta-pad, 14px 24px);
  background: var(--ge-sc-cta-bg, var(--ge-card));
  color: var(--ge-sc-cta-color, var(--ge-ink));
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition-property: transform, border-color, background-color, box-shadow, color;
  transition-duration: var(--ge-sc-cta-dur, var(--ge-sc-dur, var(--ge-dur-base, 300ms)));
  transition-timing-function: var(--ge-sc-ease, var(--ge-ease-out));
}
/* No hover transform here: the button control group owns the lift and emits its
   own default, which would beat anything written at this specificity. */
.ge-sc__cta:hover {
  border-color: var(--ge-sc-cta-border-h, var(--ge-green));
  background: var(--ge-sc-cta-bg-h, var(--ge-green));
  box-shadow: var(--ge-shadow-volt-light);
}
.ge-sc__cta:focus-visible {
  outline: none;
  box-shadow: var(--ge-shadow-focus-ring);
}
.ge-sc__cta-arrow {
  width: var(--ge-sc-cta-arrow, 14px);
  height: var(--ge-sc-cta-arrow, 14px);
  transition: transform var(--ge-dur-fast, 200ms) var(--ge-ease-out);
}
.ge-sc__cta:hover .ge-sc__cta-arrow { transform: translateX(4px); }

/* ----------------------------------------------------------- photograph -- */

/* z-index: 1 deliberately, so the frame is a stacking context and the arrows
   inside it cannot climb past the detail card. Without it the nav's z-index
   would be compared against the card's in a shared context and win, which on a
   small screen puts a control on top of the card that overlaps the frame. */
.ge-sc__frame {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-radius: var(--ge-sc-frame-radius, var(--ge-radius-xl, 24px));
}

/* The frame owns the shape, so the box is reserved before any photograph
   arrives. A structural image with no reserved box has nothing to intersect the
   viewport with, which is how a section ends up zero height forever. */
.ge-sc__stage {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ge-sc-stage-ratio, 16 / 11);
}
@media (min-width: 640px) {
  .ge-sc__stage { aspect-ratio: var(--ge-sc-stage-ratio, 16 / 10); }
}

/* Every photograph is in the DOM and stacked in the same box. The inactive ones
   are faded, never removed, so the next one is already fetched when an arrow is
   pressed. render() marks the first one active, so with no JavaScript this is
   one readable project rather than an empty frame. */
.ge-sc__slide {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ge-sc-fade, 500ms) var(--ge-sc-ease, var(--ge-ease-out));
}
.ge-sc__slide[data-active] { opacity: 1; }

.ge-sc__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ge-sc__scrim {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: var(--ge-sc-scrim-h, 33%);
  background: linear-gradient(to top, color-mix(in oklch, var(--ge-sc-scrim-color, var(--ge-dark)) var(--ge-sc-scrim-alpha, 35%), transparent), transparent);
  pointer-events: none;
}

/* ---------------------------------------------------------------- arrows -- */

.ge-sc__nav {
  position: absolute;
  top: var(--ge-sc-nav-inset, 16px);
  right: var(--ge-sc-nav-inset, 16px);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: var(--ge-sc-nav-gap, 8px);
}
@media (min-width: 1024px) {
  /* Bottom right only once the card has moved out beside the photograph. Below
     lg the card tucks over the frame's lower edge and sits straight on top of
     these, so on a phone there is no way to reach the second project at all. */
  .ge-sc__nav {
    top: auto;
    bottom: var(--ge-sc-nav-inset-lg, 20px);
    right: var(--ge-sc-nav-inset-lg, 20px);
  }
}

/* Read out, never drawn: the comp has two arrows and nothing else, and a screen
   reader still needs to know where it is. */
.ge-sc__count {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* A solid background rather than a translucent one over a blur. backdrop-filter
   forces the layers behind it to rasterise, and on this project it has already
   dropped artwork out of a composite. The arrows must be legible over a bright
   sky without depending on the scrim, so they carry their own surface. */
.ge-sc__arrow {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--ge-sc-arrow-size, 36px);
  height: var(--ge-sc-arrow-size, 36px);
  border-radius: var(--ge-radius-pill, 999px);
  border: 1px solid color-mix(in srgb, var(--ge-sc-arrow-border, var(--ge-card)) var(--ge-sc-arrow-border-alpha, 40%), transparent);
  background: color-mix(in srgb, var(--ge-sc-arrow-bg, var(--ge-card)) var(--ge-sc-arrow-alpha, 85%), transparent);
  color: var(--ge-sc-arrow-fg, var(--ge-ink));
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition-property: background-color, border-color, color;
  transition-duration: var(--ge-dur-fast, 200ms);
  transition-timing-function: var(--ge-sc-ease, var(--ge-ease-out));
}
.ge-sc__arrow:hover {
  border-color: var(--ge-sc-arrow-bg-h, var(--ge-green));
  background: var(--ge-sc-arrow-bg-h, var(--ge-green));
  color: var(--ge-sc-arrow-fg-h, var(--ge-ink));
}
.ge-sc__arrow:focus-visible {
  outline: none;
  box-shadow: var(--ge-shadow-focus-ring);
}
.ge-sc__arrow-icon {
  width: var(--ge-sc-arrow-icon, 16px);
  height: var(--ge-sc-arrow-icon, 16px);
}
/* One arrow shape, mirrored, rather than a second path to keep in step. */
.ge-sc__arrow--prev .ge-sc__arrow-icon { transform: scaleX(-1); }

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

/*
 * Inside the frame until there is room beside it, then hanging off the right
 * edge as the comp draws it. Below lg it tucks over the foot of the frame,
 * because an element that bleeds past its parent at 390 is a horizontal
 * scrollbar.
 */
.ge-sc__cards {
  position: relative;
  z-index: 2;
  display: grid;
  margin-top: var(--ge-sc-card-rise, -48px);
  margin-inline: var(--ge-sc-card-inset, 16px);
}
@media (min-width: 640px) {
  .ge-sc__cards { margin-inline: var(--ge-sc-card-inset, 28px); }
}

.ge-sc__card {
  /* Every card sits in the same cell, so the box is as tall as the tallest one
     and swapping projects cannot make the layout jump. */
  grid-area: 1 / 1;
  border: 1px solid var(--ge-sc-card-border, var(--ge-hair));
  border-radius: var(--ge-sc-card-radius, var(--ge-radius-lg, 20px));
  background: var(--ge-sc-card-bg, var(--ge-card));
  padding: var(--ge-sc-card-pad, 20px);
  /* The design's shadow is Ink at 50 percent, so it is derived from the token
     rather than being a hand-written rgba a marketer cannot restyle. */
  box-shadow: var(--ge-sc-card-shadow, 0 26px 60px -34px color-mix(in srgb, var(--ge-ink) 50%, transparent));
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ge-sc-fade, 500ms) var(--ge-sc-ease, var(--ge-ease-out));
}
.ge-sc__card[data-active] { opacity: 1; pointer-events: auto; }

/*
 * The overhang, and why it steps up twice.
 *
 * The card hangs past the grid's content edge, and the room it has is the
 * grid's own gutter plus whatever margin is left once the 1320px frame is
 * centred. At 1024 there is no margin at all, so an overhang bigger than the
 * gutter is a horizontal scrollbar. The design's 40px needs (100vw - 1320) / 2
 * to be at least 20px, which is a 1360 viewport; its 56px needs 1392. So the
 * overhang steps at 1360 and 1400 rather than at the original's 1280, which
 * genuinely overflows between 1280 and 1432.
 */
@media (min-width: 1024px) {
  .ge-sc__cards {
    position: absolute;
    top: 50%;
    right: calc(-1 * var(--ge-sc-card-out-min, var(--ge-frame-gutter, 20px)));
    width: var(--ge-sc-card-w, 290px);
    margin: 0;
    transform: translateY(-50%);
  }
}
@media (min-width: 1360px) {
  .ge-sc__cards { right: calc(-1 * var(--ge-sc-card-out, 40px)); }
}
@media (min-width: 1400px) {
  .ge-sc__cards {
    right: calc(-1 * var(--ge-sc-card-out-xl, 56px));
    width: var(--ge-sc-card-w-xl, 310px);
  }
}
/* Safari before 16 ignores `overflow: clip`, so there is no belt under the
   geometry there. Keep the card inside the column rather than risk the page. */
@supports not (overflow-x: clip) {
  @media (min-width: 1024px) {
    .ge-sc__cards { right: 0; }
  }
}

.ge-sc__title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--ge-sc-title-color, var(--ge-ink));
}
.ge-sc__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--ge-sc-meta-gap-x, 10px);
  row-gap: var(--ge-sc-meta-gap-y, 4px);
  margin: var(--ge-sc-meta-gap, 8px) 0 0;
  font-size: 12.5px;
  color: var(--ge-sc-place-color, var(--ge-body));
}
.ge-sc__system {
  font-weight: 600;
  color: var(--ge-sc-system-color, var(--ge-ink));
}
.ge-sc__place {
  display: inline-flex;
  align-items: center;
  gap: var(--ge-sc-pin-gap, 4px);
}
.ge-sc__pin {
  flex: none;
  width: var(--ge-sc-pin-size, 14px);
  height: var(--ge-sc-pin-size, 14px);
}
.ge-sc__quote {
  margin: var(--ge-sc-quote-gap, 12px) 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ge-sc-quote-color, var(--ge-body));
}

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

/*
 * Both columns render visible and the keyframe brings them in. No observer, no
 * script in this path, so the failure mode is a plain visible section.
 *
 * 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 any hover transform underneath
 * it. Two separate properties cannot fight.
 */
@media (prefers-reduced-motion: no-preference) {
  .ge-sc__copy,
  .ge-sc__media {
    opacity: 0;
    animation: ge-sc-rise var(--ge-sc-rise-dur, 660ms) var(--ge-sc-ease, var(--ge-ease-out)) forwards;
  }
  .ge-sc__media { animation-delay: var(--ge-sc-rise-delay, 80ms); }
}
@keyframes ge-sc-rise {
  from { opacity: 0; translate: 0 22px; }
  to   { opacity: 1; translate: 0 0; }
}

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