/* ==========================================================================
   OISMUN 2027: base (reset, typography, layout primitives, utilities, motion)
   Mobile first: every rule is written for phones, then widened with min-width queries.
   ========================================================================== */

/* ---- Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--navbar-h) + 1rem); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body, h1, h2, h3, h4, h5, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ---- Page ------------------------------------------------------------------ */
body {
  min-height: 100vh;
  background: var(--oismun-bg);
  color: var(--oismun-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* ---- Typography -------------------------------------------------------------- */
h1, h2, h3, h4, .t-editorial, .t-display, .t-serif {
  /* Playfair's contextual alternates put ball terminals over some capitals (COMMIṪTEE): off */
  font-variant-ligatures: common-ligatures no-contextual;
  font-feature-settings: "calt" 0, "dlig" 0;
}
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: var(--leading-tight);
  color: var(--oismun-royal);
  text-wrap: balance;
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
p { text-wrap: pretty; }
p + p { margin-top: 1em; }
strong { font-weight: 700; }

/* the two editorial heading voices of the concepts */
.t-editorial {               /* "OUR TEAM", "OUR DEPARTMENTS": bold slanted capitals */
  font-family: var(--font-editorial);
  font-style: italic;
  font-synthesis: style;     /* slant the upright face (see fonts.css) */
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--oismun-royal);
}
.t-display {                 /* "SPONSORS", "NAME OF THE COMMITTEE": upright capitals */
  font-family: var(--font-serif);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.035em;
  color: var(--oismun-royal);
}
.t-eyebrow {                 /* small sans label above titles */
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oismun-text-soft);
}
.t-lead { font-size: var(--text-lg); line-height: 1.6; color: var(--oismun-text-soft); }
.t-serif { font-family: var(--font-serif); }
.t-soft { color: var(--oismun-text-soft); }

.prose { max-width: var(--container-narrow); }
.prose p { color: var(--oismun-text); }
.prose a { color: var(--oismun-royal); text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ---- Layout primitives ----------------------------------------------------------- */
.l-container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.l-container--wide { width: min(100% - 2 * var(--gutter), var(--container-wide)); }
.l-container--narrow { width: min(100% - 2 * var(--gutter), var(--container-narrow)); }
.l-section { padding-block: var(--section-y); }
.l-section--tight { padding-block: calc(var(--section-y) * 0.6); }
.l-section--band { background: var(--oismun-band); }
.l-section--white { background: var(--oismun-surface); }
.l-stack > * + * { margin-top: var(--stack, var(--space-4)); }
.l-cluster { display: flex; flex-wrap: wrap; gap: var(--cluster-gap, var(--space-3)); align-items: center; }

/* responsive grid: columns = as many as fit the minimum card width */
.l-grid {
  display: grid;
  gap: var(--grid-gap, clamp(1rem, 0.7rem + 1.2vw, 1.75rem));
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--grid-min, 15rem)), 1fr));
}
/* fixed column counts where rows must stay even (committees, programmes, departments) */
.l-grid--2, .l-grid--3, .l-grid--4 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 22em) { .l-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 40em) { .l-grid--2, .l-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 48em) { .l-grid--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 64em) { .l-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .l-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* people: centred rows, so a department of 2 or 3 does not hang on the left */
.l-grid--people { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.25rem 0.75rem; list-style: none; padding: 0; }
.l-grid--people > * { flex: 0 1 calc((100% - 2 * 0.75rem) / 3); }                       /* 3 per row on phones */
@media (min-width: 40em) { .l-grid--people { gap: 2rem 1.5rem; } .l-grid--people > * { flex-basis: calc((100% - 3 * 1.5rem) / 4); } }
@media (min-width: 64em) { .l-grid--people > * { flex-basis: calc((100% - 5 * 1.5rem) / 6); } }

.l-split { display: grid; gap: clamp(2rem, 1rem + 4vw, 4.5rem); align-items: center; }
@media (min-width: 60em) {
  .l-split { grid-template-columns: 1fr 1fr; }
  .l-split--reverse > :first-child { order: 2; }
  .l-split--60-40 { grid-template-columns: 1.25fr 1fr; }
}

/* ---- Utilities --------------------------------------------------------------------- */
.u-center { text-align: center; }
.u-mx-auto { margin-inline: auto; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 200;
  padding: var(--space-3) var(--space-4); background: var(--oismun-navy); color: #fff;
  border-radius: var(--radius-sm); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: var(--space-4); }

/* ---- Focus --------------------------------------------------------------------------- */
:focus-visible { outline: 3px solid var(--oismun-focus); outline-offset: 3px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }

/* ---- Motion: reveal on scroll (IntersectionObserver adds .is-visible) --------------- */
.js .reveal {
  opacity: 0;
  transform: translate3d(0, var(--reveal-distance), 0);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  transition-delay: calc(var(--reveal-i, 0) * 70ms);
}
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---- Prototype-only marker (never shown on the live theme) -------------------------- */
.proto-note {
  display: inline-block; margin-top: var(--space-3); padding: 2px 10px; border-radius: var(--radius-pill);
  background: #fff4c2; color: #5b4700; font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.02em;
}
