/*
 * cc-gallery.css — the gallery layer.
 *
 * A near-monochrome, exhibition-catalogue treatment for the org home pages:
 * white canvas, thin oversized headings, hairline rules, one accent per org,
 * and a lot of air. Loaded LAST in <head> so it wins over the Tailwind CDN
 * build and the page's own inline <style> blocks.
 *
 * Scope: the opt-in .gx wrapper only. The global nav and the c305 footer keep
 * each org's brand colour and are deliberately untouched — per-org footer
 * branding must survive.
 *
 * Per-org accent: set --gx-accent on the element, e.g.
 *   <main class="gx" style="--gx-accent:#4285F4">
 */

.gx {
  --gx-ink: #0a0a0a;
  --gx-muted: #6b7280;
  --gx-line: #e6e6e6;
  --gx-paper: #ffffff;
  --gx-accent: #0a0a0a;

  --gx-pad: clamp(1.5rem, 5vw, 4rem);
  --gx-measure: 1240px;

  background: var(--gx-paper);
  color: var(--gx-ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* The canvas is white everywhere. No tinted bands, no gradients, no scrims. */
.gx section {
  background: var(--gx-paper);
  background-image: none;
  border: 0;
}

/* ---------------------------------------------------------------- rhythm */

.gx .gx-section {
  padding: clamp(4.5rem, 9vw, 9rem) 0;
  border-top: 1px solid var(--gx-line);
}

/* The org's colour, stated once at the top of the page and nowhere else at this
   weight. One hairline is enough to tell two org sites apart without tinting a
   single panel. */
.gx { border-top: 3px solid var(--gx-accent); }

.gx .gx-wrap {
  max-width: var(--gx-measure);
  margin: 0 auto;
  padding-left: var(--gx-pad);
  padding-right: var(--gx-pad);
}

/* ------------------------------------------------------------------ type */

/* Plain kicker text — a label, not a pill. */
.gx .gx-kicker {
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gx-muted);
  margin: 0 0 clamp(1.5rem, 3vw, 2.5rem);
}
.gx .gx-kicker .gx-num { color: var(--gx-accent); margin-right: .9em; }

.gx .gx-display {
  font-size: clamp(2.6rem, 7.5vw, 6.5rem);
  font-weight: 200;
  line-height: .96;
  letter-spacing: -.04em;
  margin: 0;
  color: var(--gx-ink);
}
.gx .gx-display .gx-thin { color: var(--gx-muted); }

.gx .gx-h2 {
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  font-weight: 200;
  line-height: 1.06;
  letter-spacing: -.035em;
  margin: 0 0 1.25rem;
  color: var(--gx-ink);
  text-align: left;
}

.gx .gx-h3 {
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1.35;
  margin: 0 0 .55rem;
  color: var(--gx-ink);
}

.gx .gx-lead {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  font-weight: 300;
  line-height: 1.6;
  color: var(--gx-muted);
  max-width: 46ch;
  margin: clamp(1.75rem, 3vw, 2.5rem) 0 0;
}

.gx .gx-body {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--gx-muted);
  max-width: 62ch;
  margin: 0;
}
.gx .gx-body + .gx-body { margin-top: 1.1rem; }

.gx a { color: inherit; }
.gx .gx-body a,
.gx .gx-lead a {
  color: var(--gx-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  text-decoration-color: var(--gx-line);
  transition: text-decoration-color .18s;
}
.gx .gx-body a:hover,
.gx .gx-lead a:hover { text-decoration-color: var(--gx-accent); }

/* ------------------------------------------------------------------ hero */

.gx .gx-hero {
  padding: clamp(5rem, 13vw, 12rem) 0 clamp(3.5rem, 7vw, 6rem);
  border-top: 0;
}
.gx .gx-hero .gx-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.75rem;
  padding-top: clamp(3rem, 6vw, 5rem);
  margin-top: clamp(3rem, 6vw, 5rem);
  border-top: 1px solid var(--gx-line);
}
.gx .gx-meta-item { min-width: 8rem; }
.gx .gx-meta-label {
  display: block;
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gx-muted);
  margin-bottom: .5rem;
}
.gx .gx-meta-value {
  font-size: .95rem;
  font-weight: 400;
  color: var(--gx-ink);
}

/* A meta value can be the way in to the thing it counts. */
.gx .gx-meta-value a {
  color: var(--gx-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  text-decoration-color: var(--gx-line);
  transition: text-decoration-color .18s;
}
.gx .gx-meta-value a:hover { text-decoration-color: var(--gx-accent); }

/* --------------------------------------------------------- links, actions */

.gx .gx-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 2.25rem;
  margin-top: clamp(2rem, 4vw, 3rem);
  align-items: center;
}

.gx .gx-link {
  display: inline-flex;
  align-items: baseline;
  gap: .6em;
  font-size: .95rem;
  font-weight: 400;
  color: var(--gx-ink);
  text-decoration: none;
  padding-bottom: .3em;
  border-bottom: 1px solid var(--gx-line);
  transition: border-color .18s, color .18s;
}
.gx .gx-link:hover { border-bottom-color: var(--gx-accent); }
.gx .gx-link .gx-arrow { transition: transform .18s; color: var(--gx-accent); }
.gx .gx-link:hover .gx-arrow { transform: translateX(.25em); color: var(--gx-accent); }

/* One solid action per view, no more. */
.gx .gx-cta {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  background: var(--gx-ink);
  color: #fff;
  font-size: .9rem;
  font-weight: 400;
  padding: .85rem 1.6rem;
  border: 0;
  border-radius: 0;
  text-decoration: none;
  transition: background .18s;
}
/*
 * The accent used to arrive only on hover, which meant that on a phone -- where
 * there is no hover -- an org's colour never appeared at all. The rule at rest
 * is now an accent underline; the hover fills with ink, not with the accent,
 * because four of the nine accents (gold, Swift orange, Google blue, amber) sit
 * under 4.5:1 against white text and would fail contrast as a filled button.
 */
.gx .gx-cta {
  background: transparent;
  color: var(--gx-ink);
  border-bottom: 2px solid var(--gx-accent);
}
/* Colour only on hover -- the padding stays put, so the button does not jump. */
.gx .gx-cta:hover { background: var(--gx-ink); color: var(--gx-paper); }

/* A wrapped list of quiet links — used where a catalogue row would be overkill. */
.gx .gx-linklist {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem 2rem;
  margin-top: clamp(2rem, 4vw, 3rem);
}

/* ------------------------------------------------------------ index rows */

/* A catalogue list: hairline-separated rows, number + title + note. */
.gx .gx-index { border-top: 1px solid var(--gx-line); }
.gx .gx-row {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 1rem 2rem;
  align-items: start;
  padding: clamp(1.5rem, 3vw, 2.25rem) 0;
  border-bottom: 1px solid var(--gx-line);
  text-decoration: none;
}
.gx a.gx-row { transition: background .18s; }
.gx a.gx-row:hover { background: #fafafa; }
.gx .gx-row-num {
  font-size: .75rem;
  letter-spacing: .1em;
  color: var(--gx-muted);
  padding-top: .35rem;
}
.gx .gx-row-note {
  font-size: .95rem;
  line-height: 1.7;
  color: var(--gx-muted);
  margin: 0;
}

/* ----------------------------------------------------- plates and embeds */

.gx .gx-plate {
  margin: clamp(2rem, 4vw, 3.5rem) 0 0;
  border: 1px solid var(--gx-line);
  background: var(--gx-paper);
}
.gx .gx-plate img,
.gx .gx-plate iframe { display: block; width: 100%; border: 0; border-radius: 0; }
.gx .gx-caption {
  margin: .9rem 0 0;
  font-size: .8rem;
  line-height: 1.6;
  color: var(--gx-muted);
}

/* -------------------------------------------------------------- two-column */

.gx .gx-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

/* ------------------------------------------------- neutralise old chrome */

/*
 * Widgets kept from the previous design (calendar, team roster, video) still
 * carry their own cards, gradients and shadows. Flatten them so they sit in
 * the gallery without being rebuilt from scratch.
 */
.gx .gx-flatten :is(section, article, div, details, summary, li, a, button) {
  box-shadow: none !important;
  border-radius: 0 !important;
  background-image: none !important;
}
.gx .gx-flatten :is(section, div, article) { background-color: transparent !important; }
.gx .gx-flatten :is(iframe, img, video, canvas) { border-radius: 0 !important; }
.gx .gx-flatten :is(h1, h2, h3, h4) {
  font-weight: 400 !important;
  letter-spacing: -.02em !important;
  color: var(--gx-ink) !important;
}

/* Buttons carried over from the old design become the one gallery action. */
.gx .gx-flatten :is(a, button):is(.is-primary, .btn-primary) {
  background: var(--gx-ink) !important;
  color: #fff !important;
  font-weight: 400 !important;
  padding: .85rem 1.6rem !important;
}
.gx .gx-flatten :is(a, button):is(.is-secondary, .btn-ghost) {
  background: transparent !important;
  color: var(--gx-ink) !important;
  border: 1px solid var(--gx-line) !important;
  font-weight: 400 !important;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 860px) {
  .gx .gx-split { grid-template-columns: minmax(0, 1fr); }
  .gx .gx-row { grid-template-columns: 2.5rem minmax(0, 1fr); }
  .gx .gx-row-note { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .gx * { transition: none !important; }
}

/* --------------------------------------------------------- scroll reveal */

.gx.js-anim .gx-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s cubic-bezier(.22, .7, .2, 1), transform .7s cubic-bezier(.22, .7, .2, 1);
}
.gx.js-anim .gx-reveal.is-in { opacity: 1; transform: none; }
