/* Magazine look: newsprint-warm paper, high-contrast serif headlines (in the spirit of the NYT / Foreign Affairs),
   Franklin-style sans for labels and bylines, hairline rules, one deep-red accent. Light only. */
:root {
  --paper: #fbf9f4;
  --paper-2: #f3efe6;
  --card: #ffffff;
  --ink: #1b1b1b;
  --ink-2: #3d3d3d;
  --muted: #6b665c;
  --rule: #ddd6c8;
  --rule-strong: #1b1b1b;
  --accent: #8b1e2d;
  --amaan: #1f4e79;
  --mae: #8b1e2d;
  --display: "Playfair Display", "Times New Roman", Georgia, serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Libre Franklin", "Franklin Gothic Medium", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.6 var(--serif);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
code { font-size: 85%; background: var(--paper-2); padding: 0.1em 0.35em; }
[hidden] { display: none !important; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* ---------- masthead ---------- */
.utility {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font: 500 12px/1 var(--sans); letter-spacing: 0.02em; color: var(--muted);
  padding: 12px 0 0; min-height: 24px;
}
.utility .who { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.masthead { text-align: center; padding: 14px 0 0; }
.masthead a { text-decoration: none; }
.nameplate { font: 700 clamp(40px, 8vw, 76px)/1 var(--display); letter-spacing: -0.01em; margin: 0; }
.tagline { font: italic 400 15px/1.4 var(--serif); color: var(--muted); margin: 8px 0 14px; }
.rule-double { border-top: 3px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); height: 6px; }
.nav {
  display: flex; justify-content: center; gap: 4px 28px; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid var(--rule);
  font: 600 12px/1 var(--sans); text-transform: uppercase; letter-spacing: 0.12em;
}
.nav a { text-decoration: none; color: var(--ink-2); padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--accent); }
.nav a.active { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- header art ---------- */
.hero { margin: 24px 0 0; }
.hero-img { aspect-ratio: 16 / 6; overflow: hidden; background: var(--paper-2); }
.hero-img img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; display: block; }
body:not([data-page="home"]) .hero-img { aspect-ratio: 16 / 3.2; }
.hero figcaption { font: 12px/1.4 var(--sans); color: var(--muted); margin-top: 6px; text-align: right; }

/* ---------- page head ---------- */
.page { padding-bottom: 32px; }
.page-head { margin: 36px 0 8px; }
.kicker { font: 700 12px/1.2 var(--sans); text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent); margin: 0 0 8px; }
.page-title { font: 700 clamp(32px, 5vw, 48px)/1.1 var(--display); margin: 0; letter-spacing: -0.005em; }
.dek { font: 400 20px/1.5 var(--serif); color: var(--ink-2); margin: 10px 0 0; max-width: 46em; }
h2 { font: 700 28px/1.2 var(--display); margin: 1.6em 0 0.4em; }
h3 { font: 700 22px/1.25 var(--display); margin: 1.4em 0 0.3em; }
.section-label {
  font: 700 13px/1 var(--sans); text-transform: uppercase; letter-spacing: 0.14em;
  border-top: 1px solid var(--rule-strong); padding-top: 10px; margin: 56px 0 8px;
}
.muted { color: var(--muted); }
.small { font-size: 15px; }

/* ---------- notes, names, buttons ---------- */
.note { border-left: 3px solid var(--accent); background: var(--card); padding: 12px 16px; margin: 20px 0; font: 15px/1.5 var(--sans); color: var(--ink-2); }
.note-warn { border-left-color: #b7791f; }

.pill { font: 600 12px/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.pill-amaan { color: var(--amaan); }
.pill-mae { color: var(--mae); }

.btn {
  font: 600 13px/1 var(--sans); text-transform: uppercase; letter-spacing: 0.1em;
  padding: 12px 18px; cursor: pointer; border-radius: 0;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  text-decoration: none; display: inline-block;
}
.btn:hover { background: var(--paper-2); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-danger { color: var(--accent); border-color: var(--accent); }
.link-btn { font: 500 12px/1 var(--sans); background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: var(--accent); }
.more { font: 600 13px/1 var(--sans); text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); text-decoration: none; }
.more:hover { text-decoration: underline; }

/* ---------- next meeting + story cards ---------- */
.meeting { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px;
  border-bottom: 1px solid var(--rule); padding-bottom: 14px; margin-bottom: 28px; }
.meeting-date { font: 700 clamp(26px, 4vw, 36px)/1.15 var(--display); }
.meeting-meta { font: 500 14px/1.4 var(--sans); color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; align-items: baseline; }

/* Columns separated by hairline rules drawn in the gap, so every card gets the same width. */
.stories, .people { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px 56px; }
.story, .person { position: relative; }
.story + .story::before, .person + .person::before {
  content: ""; position: absolute; left: -28px; top: 0; bottom: 0; border-left: 1px solid var(--rule);
}
.story { display: flex; flex-direction: column; gap: 10px; text-decoration: none; }
.story-img { position: relative; aspect-ratio: 3 / 2; background: var(--paper-2); overflow: hidden; }
.story-img img, .img-ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.story-img img { transition: transform 0.4s ease; }
.story:hover .story-img img { transform: scale(1.02); }
.img-ph { display: grid; place-items: center; padding: 16px; text-align: center; font: italic 700 26px/1.2 var(--display); color: var(--muted);
  background: linear-gradient(135deg, var(--paper-2), #e9e2d3); }
.story-kicker { font: 700 12px/1 var(--sans); text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent); margin-top: 4px; }
.story-title { font: 700 26px/1.2 var(--display); margin: 0; }
.story:hover .story-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.story-dek { font: 400 17px/1.5 var(--serif); color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.story-byline { font: 600 12px/1.3 var(--sans); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.empty { padding: 40px 16px; text-align: center; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); font: 18px/1.6 var(--serif); color: var(--ink-2); }

.archive { list-style: none; padding: 0; margin: 0; }
.archive li { padding: 14px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 4px; }
.archive a { font: 700 20px/1.3 var(--display); text-decoration: none; }
.archive a:hover { text-decoration: underline; text-underline-offset: 3px; }
.archive .meta { font: 500 13px/1.3 var(--sans); color: var(--muted); }

/* ---------- history table ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 28px 0 12px; font-family: var(--sans); }
.toolbar input, .toolbar select { font: 15px var(--sans); padding: 9px 12px; border: 1px solid var(--rule); border-radius: 0; background: var(--card); color: var(--ink); }
.toolbar input { flex: 1; min-width: 180px; }
.count { font: 500 13px var(--sans); color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th {
  text-align: left; padding: 10px 14px 8px 0; border-bottom: 2px solid var(--rule-strong);
  font: 700 11px/1.2 var(--sans); text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-2);
  white-space: nowrap; cursor: pointer; user-select: none;
}
th:hover, th.sorted { color: var(--accent); }
th.sorted::after { content: " \2193"; }
th.sorted.asc::after { content: " \2191"; }
td { padding: 14px 14px 14px 0; border-bottom: 1px solid var(--rule); vertical-align: top; font: 14px/1.45 var(--sans); color: var(--ink-2); }
td.title { min-width: 260px; font: 700 17px/1.3 var(--display); color: var(--ink); }
td.title a { text-decoration: none; }
td.title a:hover { text-decoration: underline; text-underline-offset: 3px; }
td.nowrap { white-space: nowrap; }
td .edit { display: block; margin-top: 6px; font: 500 11px var(--sans); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); text-decoration: none; opacity: 0; }
tr:hover td .edit, td .edit:focus { opacity: 1; }
td .edit:hover { color: var(--accent); }
@media (hover: none) { td .edit { opacity: 1; } }

/* ---------- forms ---------- */
.form { display: grid; gap: 18px; max-width: 680px; margin-top: 24px; }
.field { display: grid; gap: 6px; }
.field label { font: 700 11px/1.2 var(--sans); text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-2); }
.field input, .field select, .field textarea {
  font: 17px/1.4 var(--serif); width: 100%; padding: 10px 12px;
  border: 1px solid var(--rule); border-radius: 0; background: var(--card); color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; min-width: 0; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.status { font: 14px/1.4 var(--sans); color: var(--muted); }
.status.err { color: var(--accent); }
.preview { max-width: 360px; }
.login { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; max-width: 560px; }
.login input { font: 17px var(--serif); padding: 10px 12px; border: 1px solid var(--rule); background: var(--card); color: var(--ink); flex: 1; min-width: 220px; border-radius: 0; }
.list { list-style: none; padding: 0; margin: 8px 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--rule); display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font: 15px var(--sans); }
.list a { font: 700 17px var(--display); text-decoration: none; }

/* ---------- about ---------- */
.people { margin-top: 28px; }
.avatar { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font: 700 36px var(--display);
  background: var(--paper-2); color: var(--muted); margin-bottom: 16px; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.person h3 { margin: 0 0 6px; font-size: 26px; }

.footer { border-top: 1px solid var(--rule); margin-top: 64px; padding: 20px 0 40px; text-align: center; font: italic 15px var(--serif); color: var(--muted); }

@media (max-width: 680px) {
  body { font-size: 17px; }
  .row { grid-template-columns: 1fr; }
  .story + .story::before, .person + .person::before { display: none; }
  .story + .story, .person + .person { border-top: 1px solid var(--rule); padding-top: 32px; }
  .stories, .people { gap: 32px; }
  .nav { gap: 4px 18px; }
  .utility .date { display: none; }
}
.bio { font: italic 400 19px/1.55 var(--serif); color: var(--ink-2); margin: 0; }
.field input.missing, .field textarea.missing { border-color: #c9a227; background: #fffbea; }
#manual { justify-self: start; margin-top: 2px; }
