/* =========================================================================
   SOCIETY SKELETON — DESIGN SYSTEM
   Three layers:
     1. PRIMITIVES  — scales (type, space, radius, motion). Rarely touched.
     2. THEME       — the per-society customisation surface. Restyle a whole
                      site by editing this block (and DIRECTIONS.md presets).
     3. COMPONENTS  — read only from the two layers above.
   Rules for restyles live in DESIGN.md. CSP: fonts must be self-hosted from
   /static/fonts (tools/get_fonts.py) — no external CDNs, no inline styles.
   ========================================================================= */

/* ====================== 1. PRIMITIVES ==================================== */
:root {
  /* Fluid type scale (minor third-ish, clamps between 360px and 1280px) */
  --text-xs:      0.78rem;
  --text-sm:      0.9rem;
  --text-base:    1rem;
  --text-md:      clamp(1.05rem, 0.95rem + 0.4vw, 1.2rem);
  --text-lg:      clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem);
  --text-xl:      clamp(1.5rem, 1.25rem + 1.2vw, 2.1rem);
  --text-2xl:     clamp(1.9rem, 1.5rem + 2vw, 2.9rem);
  --text-display: clamp(2.3rem, 1.7rem + 3.2vw, 4rem);

  /* Space scale (4px rhythm) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-section: clamp(3.5rem, 2.5rem + 5vw, 6.5rem);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --speed-fast: 150ms;
  --speed-base: 250ms;

  /* Layers */
  --z-nav: 20;
  --z-overlay: 40;
}

/* ====================== 2. THEME (per-society surface) ===================
   Pick a direction from DIRECTIONS.md, then adjust from the client's photos
   and brand. Keep contrast: ink on bg/surface >= 4.5:1, accent-ink on
   accent >= 4.5:1. Check both light and dark blocks before shipping.
   ========================================================================= */
:root {
  color-scheme: dark;

  /* Colour — Corporate Law Club deep navy / gold (brand) */
  --color-bg: #0a1830;
  --color-surface: #10223f;
  --color-ink: #f3ede0;
  --color-ink-muted: #9fb0cc;
  --color-accent: #c6a24a;          /* brand gold */
  --color-accent-ink: #081226;      /* text ON the accent */
  --color-accent-soft: color-mix(in srgb, var(--color-accent) 10%, var(--color-bg));
  --color-accent-hover: #e2c876;
  --color-line: color-mix(in srgb, var(--color-accent) 24%, var(--color-bg));
  --color-focus: #e2c876;
  --shadow-tint: #000000;

  /* Type — self-hosted via tools/get_fonts.py; system stacks as fallback.
     Cinzel renders lowercase as small caps: the formal look is built in. */
  --font-display: "Cinzel", Georgia, "Times New Roman", serif;
  --font-body: "Jost", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --weight-display: 600;

  /* Shape — sharp formal, from the original site's 2-4px radii */
  --radius-card: 4px;
  --radius-btn: 2px;
  --radius-input: 3px;

  --container: 1120px;
}

/* Single dark theme: the society's brand IS the dark navy + gold. The
   prefers-color-scheme block is deliberately removed. */

/* ====================== reset & base ==================================== */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-ink);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  line-height: 1.12;
  margin: 0 0 0.55em;
  text-wrap: balance;
}
h1 { font-size: var(--text-display); letter-spacing: -0.015em; }
h2 { font-size: var(--text-2xl); letter-spacing: -0.01em; margin-top: 0; }
h3 { font-size: var(--text-lg); }
p { margin: 0 0 1em; }
a { color: var(--color-accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
::selection { background: var(--color-accent); color: var(--color-accent-ink); }

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--color-accent); color: var(--color-accent-ink);
  padding: var(--space-2) var(--space-4); z-index: var(--z-overlay);
  border-radius: 0 0 var(--radius-btn) 0; text-decoration: none;
}
.skip-link:focus-visible { left: 0; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-5); }
.container.narrow { max-width: 780px; }
.center { text-align: center; }
.muted { color: var(--color-ink-muted); }

/* Eyebrow: small uppercase label above a headline. Rationed — at most one
   per three sections on a page (DESIGN.md). The hero's counts as one. */
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-ink-muted);
  margin-bottom: 0.5em;
}
.role { /* committee roles, sponsor tiers: label style without the ration */
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-accent);
  margin: 0 0 0.5em;
}
.lead { font-size: var(--text-md); max-width: 44rem; text-wrap: pretty; }
.prose { max-width: 46rem; }
.prose p, .lead p { margin-bottom: 1em; }

/* ====================== header / nav ===================================== */
.site-header {
  background: color-mix(in srgb, var(--color-surface) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-line);
  position: sticky; top: 0; z-index: var(--z-nav);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); min-height: 68px;
}
.nav-brand {
  display: flex; align-items: center; gap: 12px;
  color: var(--color-ink); text-decoration: none;
}
.nav-brand svg { width: 38px; height: 38px; flex: none; }
.nav-brand-text { line-height: 1.15; }
.nav-brand-text b {
  display: block; font-family: var(--font-display);
  font-size: 13px; letter-spacing: 1px; font-weight: 600;
}
.nav-brand-text > span {
  font-family: var(--font-body); font-size: 9.5px;
  letter-spacing: 2px; color: var(--color-ink-muted); text-transform: uppercase;
}
.nav-links { display: flex; align-items: center; gap: var(--space-5); }
.nav-links a:not(.btn) {
  color: var(--color-ink); text-decoration: none; font-size: var(--text-sm);
  padding: var(--space-2) 0;
}
.nav-links a:not(.btn):hover { color: var(--color-accent); }
.nav-links a:not(.btn)[aria-current="page"] {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.nav-cta { margin-left: var(--space-2); flex-shrink: 0; }
.nav-toggle { display: none; }

@media (max-width: 800px) {
  .nav-toggle {
    display: inline-flex; flex-direction: column; gap: 5px;
    background: none; border: 0; padding: 12px; cursor: pointer;
    min-width: 44px; min-height: 44px; justify-content: center;
  }
  .nav-toggle span {
    width: 22px; height: 2px; background: var(--color-ink);
    transition: transform var(--speed-fast) var(--ease-out);
  }
  .nav-links {
    display: none;
    position: absolute; left: 0; right: 0; top: 68px;
    flex-direction: column; align-items: flex-start; gap: var(--space-3);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-line);
    padding: var(--space-4) var(--space-5) var(--space-6);
    box-shadow: 0 16px 32px -20px var(--shadow-tint);
  }
  .nav-links.open { display: flex; }
  .nav-links a { min-height: 44px; display: flex; align-items: center; width: 100%; }
  .nav-cta { margin-left: 0; }
}

/* ====================== buttons ========================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0.6em 1.5em;
  border-radius: var(--radius-btn); border: 1.5px solid transparent;
  font: inherit; font-size: var(--text-sm); font-weight: 600;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--speed-fast) var(--ease-out),
              border-color var(--speed-fast) var(--ease-out),
              color var(--speed-fast) var(--ease-out),
              transform var(--speed-fast) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--color-accent); color: var(--color-accent-ink); }
.btn-primary:hover { background: var(--color-accent-hover); }
.btn-ghost { border-color: var(--color-line); color: var(--color-ink); background: transparent; }
.btn-ghost:hover { border-color: var(--color-accent); color: var(--color-accent); }
.btn-small { min-height: 36px; padding: 0.3em 1em; font-size: var(--text-xs); }

/* ====================== sections & layout families =======================
   Vary the family per section — a page should not repeat one layout over
   and over (DESIGN.md: section variety). Available families:
     .hero        — top-of-page statement
     .section     — plain flow content
     .section-alt — tinted background variant
     .band        — full-width accent statement block
     .split       — two-column text + media (add .reverse to flip)
     .grid-feature— asymmetric card grid (first item featured)
   ========================================================================= */
.hero {
  padding: calc(var(--space-section) * 1.1) 0 var(--space-section);
  background:
    linear-gradient(160deg,
      color-mix(in srgb, var(--color-accent) 7%, var(--color-surface)) 0%,
      var(--color-surface) 55%);
  border-bottom: 1px solid var(--color-line);
}
.hero h1 { max-width: 20ch; }
.hero .lead { max-width: 38rem; }
.hero-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-6); }

.section { padding: var(--space-section) 0; }
.section-alt { background: var(--color-accent-soft); }
.page-head { padding-top: var(--space-7); }

.band {
  background: var(--color-accent);
  color: var(--color-accent-ink);
  padding: var(--space-section) 0;
}
.band h2, .band h3 { color: inherit; }
.band a:not(.btn) { color: inherit; }
.band .muted { color: color-mix(in srgb, var(--color-accent-ink) 78%, var(--color-accent)); }
.band .btn-primary { background: var(--color-accent-ink); color: var(--color-accent); }
.band .btn-primary:hover { background: color-mix(in srgb, var(--color-accent-ink) 88%, var(--color-accent)); }

.split {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--space-7); align-items: center;
}
.split.reverse > :first-child { order: 2; }
.split-media img { border-radius: var(--radius-card); width: 100%; object-fit: cover; }
@media (max-width: 800px) {
  .split { grid-template-columns: 1fr; gap: var(--space-5); }
  .split.reverse > :first-child { order: 0; }
}

/* ====================== cards & grids ==================================== */
.grid { display: grid; gap: var(--space-5); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-3 { grid-template-columns: 1fr; } }

/* Featured grid: first card spans the full first column height. Use when
   one item deserves the spotlight (next event, headline story). */
.grid-feature { grid-template-columns: 1.2fr 1fr; grid-auto-rows: auto; }
.grid-feature > :first-child { grid-row: span 2; }
.grid-feature > :first-child .card-img { aspect-ratio: 4 / 3; }
@media (max-width: 800px) {
  .grid-feature { grid-template-columns: 1fr; }
  .grid-feature > :first-child { grid-row: auto; }
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color var(--speed-base) var(--ease-out),
              box-shadow var(--speed-base) var(--ease-out),
              transform var(--speed-base) var(--ease-out);
}
.card:has(a):hover {
  border-color: color-mix(in srgb, var(--color-accent) 40%, var(--color-line));
  box-shadow: 0 14px 34px -18px var(--shadow-tint);
  transform: translateY(-2px);
}
.card-img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card-body { padding: var(--space-4) var(--space-5) var(--space-5); }
.card-body h3 { margin-bottom: 0.35em; }
.card-body h3 a { color: var(--color-ink); text-decoration: none; }
.card-body h3 a:hover { color: var(--color-accent); }
.card-body .eyebrow { margin-bottom: 0.6em; }
.card-body p:last-child { margin-bottom: 0; }

.person-img { aspect-ratio: 1; object-fit: cover; }
.person-placeholder {
  aspect-ratio: 1; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--color-accent-soft),
    color-mix(in srgb, var(--color-accent) 20%, var(--color-surface)));
  font-family: var(--font-display); font-size: var(--text-display);
  color: var(--color-accent);
}
.person-links { display: flex; gap: var(--space-3); font-size: var(--text-sm); }

.detail-img { border-radius: var(--radius-card); margin: var(--space-5) 0; }

/* gallery */
.gallery-grid {
  display: grid; gap: var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.gallery-item { margin: 0; }
.gallery-item img {
  border-radius: var(--radius-card); aspect-ratio: 4 / 3;
  object-fit: cover; width: 100%;
}
.gallery-item figcaption { font-size: var(--text-xs); margin-top: var(--space-2); }

/* sponsors */
.sponsor-strip {
  display: flex; gap: var(--space-7); align-items: center;
  flex-wrap: wrap;
}
.sponsor-logo { max-height: 56px; width: auto; }
.sponsor-row {
  display: flex; gap: var(--space-5); align-items: flex-start;
  padding: var(--space-5) 0; border-top: 1px solid var(--color-line);
}
.sponsor-row:first-of-type { border-top: 0; }
.sponsor-row .sponsor-logo { max-height: 72px; max-width: 140px; }

/* ====================== forms ============================================ */
.form { max-width: 560px; }
.form-row { margin-bottom: var(--space-4); display: flex; flex-direction: column; gap: var(--space-1); }
.form-row label { font-size: var(--text-sm); font-weight: 600; }
.form-row input:not([type="checkbox"]), .form-row textarea, .form-row select {
  font: inherit; padding: 0.6em 0.8em; min-height: 44px;
  border: 1.5px solid var(--color-line); border-radius: var(--radius-input);
  background: var(--color-surface); color: var(--color-ink);
}
.form-row textarea { min-height: auto; }
.form-row input:focus-visible, .form-row textarea:focus-visible {
  outline: 2px solid var(--color-focus); outline-offset: 1px;
  border-color: var(--color-accent);
}
.checkbox-label { display: flex; gap: var(--space-2); align-items: center; font-weight: 400; }

/* honeypot: visually removed, still in the DOM for bots */
.hp-field { position: absolute; left: -9999px; top: -9999px; }

/* flash messages */
.flashes { padding-top: var(--space-4); }
.flash {
  padding: 0.8em 1.1em; border-radius: var(--radius-input);
  margin-bottom: var(--space-2);
  border: 1px solid var(--color-line); background: var(--color-surface);
}
.flash-success {
  border-color: color-mix(in srgb, #15803d 40%, var(--color-line));
  background: color-mix(in srgb, #15803d 8%, var(--color-surface));
}
.flash-error {
  border-color: color-mix(in srgb, #b91c1c 40%, var(--color-line));
  background: color-mix(in srgb, #b91c1c 8%, var(--color-surface));
}

/* ====================== footer =========================================== */
.site-footer {
  margin-top: var(--space-section);
  background: var(--color-surface);
  border-top: 1px solid var(--color-line);
  padding: var(--space-7) 0;
  font-size: var(--text-sm);
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--space-6); }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand {
  font-family: var(--font-display); font-weight: var(--weight-display);
  font-size: var(--text-md); margin-bottom: 0.3em;
}
.footer-links { display: flex; flex-direction: column; gap: var(--space-2); }
.footer-links a { color: var(--color-ink-muted); text-decoration: none; }
.footer-links a:hover { color: var(--color-accent); }

/* ====================== motion guard ===================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .card:has(a):hover { transform: none; }
  .btn:active { transform: none; }
}

/* ====================== 4. BRAND LAYER — The Corporate Law Club ==========
   The club's poster identity: engraved small-caps headings, hairline gold
   rules with a diamond, corner brackets on the hero, gold-leaf primary
   buttons. Colours and shapes still come from the THEME tokens above. */

h1, h2 { letter-spacing: 0.05em; }
h3 { letter-spacing: 0.02em; }

/* hero: centered, framed by corner brackets like the poster */
.hero { text-align: center; position: relative; }
.hero h1 { margin-left: auto; margin-right: auto; }
.hero .lead { margin-left: auto; margin-right: auto; }
.hero .eyebrow { color: var(--color-accent); letter-spacing: 0.32em; }
.hero-actions { justify-content: center; }
.hero-frame { position: absolute; inset: 20px; pointer-events: none; }
.hero-frame i { position: absolute; width: 44px; height: 44px;
  border: 1.5px solid var(--color-accent); opacity: 0.65; }
.hero-frame .tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.hero-frame .tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.hero-frame .bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.hero-frame .br { bottom: 0; right: 0; border-left: 0; border-top: 0; }

/* society crest ghosted behind the hero, like the sister-site watermarks */
.hero { overflow: hidden; }
.hero .container { position: relative; }
.hero-crest {
  position: absolute; top: 50%; right: -120px;
  width: 520px; height: 520px;
  transform: translateY(-50%);
  opacity: 0.09;
  pointer-events: none;
}
@media (max-width: 720px) {
  .hero-crest { width: 340px; height: 340px; right: -140px; }
}

/* ====================== find-us hero channels ============================
   Slim letterhead contact line under the hero buttons: hairline-separated
   channels, small-caps label over a serif value. Keeps the hero centred. */
.hero-channels {
  list-style: none; margin: var(--space-7) 0 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center;
}
.hero-channels li {
  border-left: 1px solid var(--color-line);
  display: flex;
}
.hero-channels li:first-child { border-left: 0; }
.hero-channels a {
  display: flex; flex-direction: column; gap: 5px;
  padding: var(--space-1) var(--space-5);
  text-decoration: none;
}
.channel-label {
  font-family: var(--font-body); font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--color-ink-muted);
}
.channel-value {
  font-family: var(--font-display); font-size: var(--text-sm);
  color: var(--color-ink);
  transition: color var(--speed-fast) var(--ease-out);
}
.hero-channels a:hover .channel-value { color: var(--color-accent); }
@media (max-width: 800px) {
  .hero-channels { flex-direction: column; align-items: center; gap: var(--space-4); }
  .hero-channels li { border-left: 0; }
  .hero-channels a { padding: 0; }
}

/* hairline gold rule with a centre diamond */
.ornament { display: flex; align-items: center; justify-content: center;
  gap: 14px; margin: var(--space-4) auto var(--space-5); color: var(--color-accent); }
.ornament::before, .ornament::after { content: ""; height: 1px; width: 64px; }
.ornament::before { background: linear-gradient(90deg, transparent,
  color-mix(in srgb, var(--color-accent) 55%, transparent)); }
.ornament::after { background: linear-gradient(90deg,
  color-mix(in srgb, var(--color-accent) 55%, transparent), transparent); }
.ornament i { font-style: normal; font-size: 10px; line-height: 1; }
.ornament i::before { content: "\25C6"; }

/* gold-leaf primary buttons (poster gold), navy text */
.btn-primary { background: linear-gradient(120deg, #caa64d, #e6ce80);
  color: #0a1830; border: 0; }
.btn-primary:hover { background: linear-gradient(120deg, #d6b258, #efd98b); }
.btn-ghost { color: var(--color-accent-hover); }
.btn { text-transform: uppercase; letter-spacing: 0.14em; font-size: var(--text-xs); }

/* nav: gold brand, slim uppercase links */
.nav-brand { color: var(--color-accent-hover); letter-spacing: 0.08em; }
.nav-links a { text-transform: uppercase; font-size: var(--text-xs);
  letter-spacing: 0.14em; }

/* band: quiet navy statement panel with hairline rules, not a solid slab */
.band { background: linear-gradient(180deg, var(--color-surface), var(--color-bg));
  color: var(--color-ink); text-align: center;
  border-block: 1px solid var(--color-line); }
.band .muted { color: var(--color-ink-muted); }
.band a:not(.btn) { color: var(--color-accent-hover); }

/* cards: soft navy gradient with gold hairline, gold on hover */
.card { background: linear-gradient(180deg, rgba(255, 255, 255, 0.05),
  rgba(255, 255, 255, 0.015)); }
.card:has(a):hover { border-color: color-mix(in srgb, var(--color-accent) 60%, var(--color-line)); }

/* footer: centered, formal */
.site-footer { background: color-mix(in srgb, var(--color-bg) 80%, #000000); }

/* nav CTA: navy text on the gold-leaf button, not the link cream */
.nav-links a.btn-primary { color: #0a1830; }
.nav-links a.btn-primary:hover { color: #0a1830; }

/* the band CTA gets the same gold leaf as every other primary action */
.band .btn-primary { background: linear-gradient(120deg, #caa64d, #e6ce80); color: #0a1830; }
.band .btn-primary:hover { background: linear-gradient(120deg, #d6b258, #efd98b); }

/* tighter nav so the letterspaced items + JOIN US fit on one line */
.nav-links { gap: var(--space-4); }

/* ====================== page-end seam guard ==============================
   When a page ends on a .band, the footer's top margin shows as a stray
   strip of page background between two solid blocks — close the gap. */
main:has(> .band:last-child) + .site-footer { margin-top: 0; }
