/*
 * 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; }

/* ================================================= per-org identity tokens
 *
 * The gallery skeleton is shared by all nine org pages; the voice is not.
 * Everything above this line stays identical everywhere. Everything below is
 * per-org: the typeface, the weight it wants, the tracking that weight needs,
 * and the bar across the top of the page.
 *
 * A page opts in with one attribute, alongside the accent it already sets:
 *   <main class="gx" data-org="gdgatfiu" style="--gx-accent:#4285F4">
 *
 * An org with no block below renders exactly as it did before.
 */

.gx {
  --gx-font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --gx-font-kicker: var(--gx-font);
  --gx-display-weight: 200;
  --gx-display-track: -.04em;
  --gx-lead-weight: 300;
  --gx-rule: var(--gx-accent);
  --gx-rule-h: 3px;

  font-family: var(--gx-font);
  border-top: 0;                 /* was: 3px solid var(--gx-accent) */
}

/*
 * The rule is a pseudo-element rather than a border, for two reasons. It can
 * carry a gradient -- Google's mark needs four colours in one bar -- and it
 * sits inside the content box, so it lands below the padding that clears the
 * fixed nav. The old border sat on the padding edge, which on every page with
 * a `pt-20` main meant the org's colour was drawn underneath the nav and never
 * seen at all.
 */
.gx::before {
  content: "";
  display: block;
  height: var(--gx-rule-h);
  background: var(--gx-rule);
}

/*
 * The nav is fixed at 80px and the clock strip is fixed under it to 120px,
 * while a page root starts at 40. Six of the nine cleared that with a Tailwind
 * `pt-20` on the element itself; the three without one -- Hack University,
 * Code Crunch Worldwide, Crunch305 Drop -- were drawing their rule at 40, i.e.
 * underneath the chrome. Stating the clearance here makes it true for all nine
 * and makes the pt-20 redundant rather than load-bearing.
 *
 * Scoped away from .gx-section so the video block, which is its own .gx
 * mid-page, does not gain 5rem of space it has no fixed chrome to clear.
 */
.gx:not(.gx-section) { padding-top: 5rem; }

.gx .gx-display,
.gx .gx-h2 {
  font-weight: var(--gx-display-weight);
  letter-spacing: var(--gx-display-track);
}
.gx .gx-lead { font-weight: var(--gx-lead-weight); }
.gx .gx-kicker,
.gx .gx-meta-label,
.gx .gx-row-num { font-family: var(--gx-font-kicker); }

/* ----------------------------------------------------------- the nine */

/* Google Sans is not licensed for web embedding. The stack names it first --
   it renders for anyone whose machine has it -- and falls back to Roboto,
   which is Google's own public face. The rule carries all four Google
   colours; the unified nav above it is white, so none of them is lost. */
.gx[data-org="gdgatfiu"] {
  --gx-font: "Google Sans", "Google Sans Text", "Product Sans", Roboto, Arial, sans-serif;
  --gx-display-weight: 400;
  --gx-display-track: -.022em;
  --gx-lead-weight: 400;
  --gx-rule-h: 6px;
  --gx-rule: linear-gradient(90deg,
      #4285F4 0 25%, #EA4335 25% 50%, #F9AB00 50% 75%, #34A853 75% 100%);
}

/* Real SF Pro on the Macs and iPhones this club actually builds on; Inter
   everywhere else. Nothing to download either way. */
.gx[data-org="swiftclubatfiu"] {
  --gx-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
             "Helvetica Neue", Inter, sans-serif;
  --gx-display-weight: 300;
  --gx-display-track: -.035em;
}

/* Poppins is the Raspberry Pi Foundation's own face, and it is on Google
   Fonts -- the one org whose real typeface costs nothing to ship. */
.gx[data-org="raspberrypicodecrunch"] {
  --gx-font: Poppins, "Segoe UI", sans-serif;
  --gx-display-weight: 300;
  --gx-display-track: -.03em;
  --gx-rule-h: 5px;
}

.gx[data-org="colorstackatfiu"] {
  --gx-font: "Space Grotesk", Inter, sans-serif;
  --gx-display-weight: 500;
  --gx-display-track: -.035em;
  --gx-lead-weight: 400;
}

.gx[data-org="cahsiatfiu"] {
  --gx-font: "IBM Plex Sans", Inter, sans-serif;
  --gx-display-weight: 300;
  --gx-display-track: -.028em;
}

/* The one serif in the set. An honor society should not read like the
   incubator two pages over. */
.gx[data-org="Upsilonphiepsilon"] {
  --gx-font: "EB Garamond", Georgia, serif;
  --gx-font-kicker: Inter, -apple-system, "Segoe UI", sans-serif;
  --gx-display-weight: 400;
  --gx-display-track: -.012em;
  --gx-lead-weight: 400;
  --gx-rule-h: 2px;
}

/* Display face unchanged; only the labels and the catalogue numbers go mono. */
.gx[data-org="hackuniversity"] {
  --gx-font-kicker: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --gx-display-track: -.045em;
}

/* The parent keeps the neutral treatment. It is the baseline the other eight
   are read against, so it deliberately has no voice of its own. */
.gx[data-org="codecrunchworldwide"] { }

.gx[data-org="crunch305drop"] {
  --gx-font: "Space Grotesk", Inter, sans-serif;
  --gx-font-kicker: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --gx-display-weight: 500;
  --gx-display-track: -.045em;
  --gx-lead-weight: 400;
}
