/* Litigating Margin, RADECS Workshop 2027. Single stylesheet, no build dependencies. */

:root {
  --paper: #faf8f3;
  --paper-alt: #f0ebe1;
  --ink: #1b2233;
  --ink-soft: #4a5261;
  --muted: #6b7280;
  --line: #d8d2c6;
  --accent: #c2561a;        /* burnt orange, referencing the host campus */
  --accent-ink: #ffffff;
  --hero-base: #1b2233;     /* shown when a hero image is absent or still loading */
  --hero-tint: rgba(16, 22, 36, 0.62);
  --focus: #2b6cb0;
  --max: 1120px;
  --measure: 70ch;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12151c;
    --paper-alt: #1a1e27;
    --ink: #e9e6df;
    --ink-soft: #c4c0b6;
    --muted: #9a9890;
    --line: #2d323d;
    --accent: #e3803f;
    --accent-ink: #12151c;
    --hero-base: #0d1017;
    --hero-tint: rgba(8, 11, 18, 0.66);
    --focus: #7fb3f0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #12151c;
  --paper-alt: #1a1e27;
  --ink: #e9e6df;
  --ink-soft: #c4c0b6;
  --muted: #9a9890;
  --line: #2d323d;
  --accent: #e3803f;
  --accent-ink: #12151c;
  --hero-base: #0d1017;
  --hero-tint: rgba(8, 11, 18, 0.66);
  --focus: #7fb3f0;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.005em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-top: 1.6em; }
h2:first-child { margin-top: 0; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
dl { margin: 0; }
dt { font-weight: 600; }
dd { margin: 0; }
ul, ol { padding-left: 1.4em; }
li { margin-bottom: 0.4em; }
strong { font-weight: 650; }
pre { white-space: pre-wrap; word-break: break-word; }

.wrap {
  max-width: calc(var(--max) + 2rem); margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.prose { max-width: var(--measure); }
.prose .button { margin-top: 0.25rem; }
.lede { max-width: var(--measure); color: var(--ink-soft); font-size: 1.1rem; }
.todo { color: var(--muted); font-style: italic; }
.text-link { font-weight: 600; }

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--accent); color: var(--accent-ink);
  padding: 0.5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* Header and navigation */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; flex-wrap: wrap; }
.brand { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); line-height: 1.15; padding: 0.5rem 0; }
.brand-kicker { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.brand-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line); color: var(--ink);
  padding: 0.4rem 0.8rem; font: inherit; border-radius: 4px; cursor: pointer;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.25rem 1.1rem; align-items: center; flex-wrap: wrap; }
.site-nav li { margin: 0; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 500; padding: 0.35rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--line); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--accent); }
.site-nav .nav-cta a { border: 1px solid var(--accent); border-radius: 4px; padding: 0.35rem 0.75rem; color: var(--accent); }
.site-nav .nav-cta a:hover, .site-nav .nav-cta a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .site-nav { display: none; width: 100%; padding-bottom: 0.75rem; }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0.25rem; }
  .site-nav a { display: block; padding: 0.5rem 0; }
  .site-nav .nav-cta a { display: block; text-align: center; margin-top: 0.25rem; }
}

/* Hero banners. The image is a background on .hero-media so that a missing
   file degrades to a solid tone rather than a broken image icon. */
.hero { position: relative; isolation: isolate; color: #fff; background: var(--hero-base); overflow: hidden; }
.hero-media {
  position: absolute; inset: 0; z-index: -2;
  background-color: var(--hero-base);
  background-size: cover; background-position: center 35%; background-repeat: no-repeat;
}
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--hero-tint) 0%, rgba(16, 22, 36, 0.78) 100%); }
/* Home: campus aerial with the San Gabriels, mountains kept in frame.
   Dabney pages (attend, propose, venue): Dabney Lounge interior.
   Other pages: the same aerial, cropped lower so the campus rather than the range fills the band. */
.hero-home .hero-media { background-image: url("img/hero-campus.jpg"); background-position: center 30%; }
.hero-media-dabney { background-image: url("img/hero-dabney.jpg"); background-position: center 28%; }
.hero-media-campus { background-image: url("img/hero-campus.jpg"); background-position: center 72%; }
.hero-inner { position: relative; z-index: 1; padding: 3rem 0; }
.hero-home .hero-inner { min-height: min(72vh, 640px); display: flex; flex-direction: column; justify-content: flex-end; padding: 5rem 0 3.5rem; }
.hero-page .hero-inner { min-height: 220px; display: flex; flex-direction: column; justify-content: flex-end; padding: 3.5rem 0 2.25rem; }
.hero-tall .hero-inner { min-height: 340px; }
.hero h1 { color: #fff; margin-bottom: 0.4em; max-width: 20ch; text-shadow: 0 1px 2px rgba(0,0,0,0.35); }
.hero-subtitle { display: block; font-size: 0.5em; font-weight: 400; font-style: italic; margin-top: 0.35em; letter-spacing: 0; opacity: 0.95; }
.hero-kicker { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem; color: rgba(255,255,255,0.85); margin-bottom: 1rem; }
.hero-meta { color: rgba(255,255,255,0.9); font-size: 1.05rem; max-width: 60ch; margin-bottom: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.hero a { color: #fff; }

/* Buttons */
.button {
  display: inline-block; padding: 0.65rem 1.2rem; border-radius: 4px; border: 1px solid var(--accent);
  color: var(--accent); background: transparent; text-decoration: none; font-weight: 600; font: inherit; cursor: pointer;
  line-height: 1.2;
}
.button:hover { background: var(--accent); color: var(--accent-ink); }
.button-primary { background: var(--accent); color: var(--accent-ink); }
.button-primary:hover { filter: brightness(1.08); }
.button-quiet { border-color: rgba(255,255,255,0.55); color: #fff; }
.button-quiet:hover { background: rgba(255,255,255,0.12); color: #fff; }
.hero .button { border-color: #fff; color: #fff; }
.hero .button:hover { background: #fff; color: var(--hero-base); }
.hero .button-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.hero .button-primary:hover { filter: brightness(1.1); background: var(--accent); color: #fff; }
.button[disabled] { opacity: 0.55; cursor: progress; }

/* Sections */
.section { padding: 3.25rem 0; }
.section-alt { background: var(--paper-alt); }
.two-col { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.priority-grid { list-style: none; padding: 0; margin: 1.5rem 0 1rem; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); counter-reset: pri; }
.priority-grid li { margin: 0; counter-increment: pri; }
.priority-grid a {
  display: block; height: 100%; padding: 1.1rem 1.2rem 1.1rem 3rem; position: relative;
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px; color: var(--ink); text-decoration: none;
}
.priority-grid a::before { content: counter(pri); position: absolute; left: 1.1rem; top: 1rem; font-family: var(--font-display); font-size: 1.3rem; color: var(--accent); font-weight: 600; }
.priority-grid a:hover { border-color: var(--accent); }
.priority-grid strong { display: block; margin-bottom: 0.25rem; }

.dates { display: grid; gap: 1rem 2rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 1rem; }
.dates div { border-top: 2px solid var(--accent); padding-top: 0.6rem; }
.dates dt { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.dates dd { font-size: 1.15rem; font-family: var(--font-display); }
.dates-inline { margin-bottom: 1rem; }

.defs div { margin-bottom: 1.1rem; }
.defs dt { font-family: var(--font-display); font-size: 1.15rem; }

/* Topics */
.cluster { padding: 2.5rem 0; border-top: 1px solid var(--line); }
.cluster-head { max-width: var(--measure); margin-bottom: 1.5rem; }
.cluster-head p { color: var(--ink-soft); }
.topic { display: grid; grid-template-columns: 3.5rem 1fr; gap: 0 1rem; padding: 1.4rem 0; border-top: 1px dashed var(--line); scroll-margin-top: 5rem; }
.topic:first-of-type { border-top: 0; }
.topic-num { font-family: var(--font-display); font-size: 1.6rem; color: var(--accent); font-weight: 600; line-height: 1.1; }
.topic h3 { margin-bottom: 0.3rem; }
.topic p { max-width: var(--measure); margin-bottom: 0.4rem; }
.topic-priority { font-size: 0.85rem; color: var(--muted); margin: 0; }
.topic-priority b { font-weight: 600; color: var(--ink-soft); }
.topic-anchor { color: var(--muted); text-decoration: none; font-size: 0.85rem; }
.topic-anchor:hover { color: var(--accent); }

/* Figures */
.figure-row { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin: 1.5rem 0 2rem; }
figure { margin: 0; }
figure img { display: block; width: 100%; height: auto; border-radius: 4px; }
.figure-row figure img { aspect-ratio: 5 / 3; object-fit: cover; }
figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 0.5rem; }
.venue-teaser { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: center; }
.venue-teaser figure img { max-height: 420px; width: auto; max-width: 100%; margin-inline: auto; }

/* Forms */
.form-wrap { max-width: 760px; }
.form { margin-top: 1.5rem; }
fieldset { border: 0; padding: 0; margin: 0 0 2.25rem; }
legend { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; padding: 0; margin-bottom: 0.9rem; width: 100%; border-bottom: 1px solid var(--line); padding-bottom: 0.4rem; }
.field { margin-bottom: 1.15rem; }
.field label, .field .label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.req { font-weight: 400; color: var(--muted); font-size: 0.82rem; margin-left: 0.3rem; }
.hint { font-size: 0.9rem; color: var(--muted); margin: 0.35rem 0 0; }
input[type="text"], input[type="email"], input[type="password"], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 4px; padding: 0.6rem 0.7rem;
}
textarea { resize: vertical; min-height: 5.5rem; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 0; }
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea { border-color: #b42318; }
.field-error { color: #b42318; font-size: 0.9rem; margin: 0.35rem 0 0; }
.checks { display: grid; gap: 0.45rem; }
.checks-topics { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0.35rem 1.25rem; }
.check { display: grid; grid-template-columns: auto 1fr; gap: 0.6rem; align-items: start; font-weight: 400; }
.check input { margin-top: 0.35rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; margin-top: 0.5rem; }
.form-status { margin: 0; color: var(--ink-soft); }
.form-status.is-error { color: #b42318; }
.form-status.is-success { color: #1f7a3a; }
.turnstile { margin: 0.5rem 0 1rem; }
.admin-output { background: var(--paper-alt); border: 1px solid var(--line); padding: 1rem; border-radius: 4px; max-height: 50vh; overflow: auto; font-size: 0.85rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--paper-alt); padding: 2.5rem 0; font-size: 0.92rem; color: var(--ink-soft); }
.footer-inner { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.footer-title { font-family: var(--font-display); color: var(--ink); font-size: 1.05rem; }
.footer-credit { color: var(--muted); font-size: 0.82rem; }

@media print {
  .site-header, .site-footer, .hero-media, .hero-actions, .nav-toggle { display: none; }
  .hero { color: var(--ink); background: none; }
  .hero h1 { color: var(--ink); text-shadow: none; }
  .hero-meta, .hero-kicker { color: var(--ink-soft); }
}
