
:root {
  --bg: #F6F8F5; --card: #FFFFFF; --ink: #15211A; --muted: #4C5C52; --line: #D5DDD6;
  --green: #17472F; --green-2: #1D5638; --on-green: #F2F6F1; --red: #A61E22; --tint: #E9EFE9;
  --font-head: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1511; --card: #16211A; --ink: #E6EEE8; --muted: #A3B3A9; --line: #26342B;
    --green: #0B2A1C; --green-2: #12402B; --on-green: #F2F6F1; --red: #E4696C; --tint: #182319;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1511; --card: #16211A; --ink: #E6EEE8; --muted: #A3B3A9; --line: #26342B;
  --green: #0B2A1C; --green-2: #12402B; --on-green: #F2F6F1; --red: #E4696C; --tint: #182319;
}
*, *::before, *::after { box-sizing: inherit; }
html { background: var(--green); scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 60px); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.7; }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 1.25rem; }

/* Top bar */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--green); color: var(--on-green); border-bottom: 3px solid var(--red); }
.top .wrap { display: flex; align-items: center; gap: 1rem; }
.brand { font-family: var(--font-head); font-weight: 800; font-size: 1.35rem; text-transform: uppercase; text-decoration: none; padding: .55rem 0; white-space: nowrap; }
.nav { display: flex; gap: .1rem; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.nav::-webkit-scrollbar { display: none; }
.nav a { font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; padding: .7rem .7rem; text-decoration: none; white-space: nowrap; opacity: .82; border-bottom: 3px solid transparent; margin-bottom: -3px; }
.nav a:hover { opacity: 1; }
.nav a[aria-current="page"] { opacity: 1; border-bottom-color: var(--on-green); }

/* Page banner (outfield stripes) */
.banner { background: repeating-linear-gradient(90deg, rgba(255,255,255,.045) 0 64px, rgba(0,0,0,.05) 64px 128px), var(--green); color: var(--on-green); padding: 3rem 0 3.25rem; }
.banner h1 { font-family: var(--font-head); font-weight: 800; text-transform: uppercase; font-size: clamp(2.8rem, 10vw, 5.5rem); line-height: .92; margin: 0 0 .75rem; }
.banner .era { font-family: var(--font-head); font-weight: 700; font-size: 1.6rem; color: #F0B7B9; margin: 0 0 .5rem; }
.banner p { max-width: 60ch; margin: 0; font-size: 1.15rem; }

/* Home hero */
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 820px) { .hero-grid { grid-template-columns: 1.15fr .85fr; } }
.hero h1 { font-size: clamp(4rem, 15vw, 9rem); line-height: .86; }
.frame { background: var(--card); padding: 10px; border-radius: 4px; box-shadow: 0 18px 40px rgba(0,0,0,.35); max-width: 380px; width: 100%; justify-self: center; }
.frame img { width: 100%; aspect-ratio: 4/5; object-fit: cover; object-position: center top; }
.frame figcaption { color: #4C5C52; font-size: .85rem; padding-top: .5rem; }

/* Stat strip */
.strip { display: grid; grid-template-columns: repeat(2, 1fr); background: var(--card); border: 1px solid var(--line); margin-top: -2rem; position: relative; }
@media (min-width: 760px) { .strip { grid-template-columns: repeat(4, 1fr); } }
.strip div { padding: 1.1rem 1.25rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.strip b { display: block; font-family: var(--font-head); font-weight: 800; font-size: 2.6rem; line-height: 1; color: var(--red); font-variant-numeric: tabular-nums; }
.strip span { font-size: .95rem; color: var(--muted); }

/* Content */
main { min-height: 60vh; }
.page { display: none; }
.page.active { display: block; }
section.block { padding: 3rem 0; }
section.block + section.block { border-top: 1px solid var(--line); }
h2 { font-family: var(--font-head); font-weight: 800; font-size: clamp(2rem, 5.5vw, 3rem); line-height: 1; margin: 0 0 1.25rem; text-transform: uppercase; }
h3 { font-family: var(--font-head); font-weight: 700; font-size: 1.65rem; margin: 2rem 0 .4rem; line-height: 1.1; }
p { margin: 0 0 1.05rem; max-width: 66ch; }
ul.plain { margin: 0 0 1.25rem; padding-left: 1.25rem; max-width: 66ch; }
ul.plain li { margin-bottom: .55rem; }
.lead { font-size: 1.2rem; }
.muted { color: var(--muted); }
.small { font-size: .92rem; }

.cols { display: grid; gap: 2rem; }
@media (min-width: 860px) { .cols.two { grid-template-columns: 1.4fr 1fr; align-items: start; } }
figure.fig { margin: 0; background: var(--card); border: 1px solid var(--line); padding: 8px; }
figure.fig img { width: 100%; height: auto; }
figure.fig figcaption { font-size: .9rem; color: var(--muted); padding: .5rem .25rem .15rem; }
figure.fig.crop img { aspect-ratio: 4/5; object-fit: cover; object-position: center top; }

.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-top: 6px solid var(--green-2); padding: 1.1rem 1.25rem 1.25rem; text-decoration: none; }
.card:hover { border-top-color: var(--red); }
.card .yrs { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; color: var(--red); }
.card h3 { margin: .1rem 0 .4rem; }
.card p { margin: 0; font-size: .98rem; color: var(--muted); }

.panel { background: var(--card); border: 1px solid var(--line); border-top: 6px solid var(--green-2); padding: 1.25rem 1.4rem; margin: 1.5rem 0; }
.panel p:last-child, .panel ul:last-child { margin-bottom: 0; }
.panel h3 { margin-top: 0; }
.other { background: var(--tint); border-left: 6px solid var(--muted); padding: 1.1rem 1.4rem; margin: 1.75rem 0; }
.other h3 { margin-top: 0; }
.other p:last-child, .other ul:last-child { margin-bottom: 0; }

.scroll { overflow-x: auto; max-width: 100%; margin: 1rem 0 1.5rem; }
table.data { border-collapse: collapse; width: 100%; min-width: 560px; background: var(--card); border: 1px solid var(--line); font-size: .98rem; }
table.data th, table.data td { padding: .65rem .85rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data thead th { background: var(--green); color: var(--on-green); font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; }
table.data td.n, table.data th.n { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.big { font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; }

/* Timeline */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.75rem; }
.chip { font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; background: var(--card); color: var(--ink); border: 2px solid var(--line); border-radius: 999px; padding: .25rem .95rem; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--green); color: var(--on-green); border-color: var(--green); }
ol.tl { list-style: none; margin: 0; padding: 0 0 0 0; border-left: 3px solid var(--green-2); }
ol.tl li { position: relative; padding: 0 0 1.4rem 1.5rem; }
ol.tl li::before { content: ""; position: absolute; left: -9px; top: .6rem; width: 15px; height: 15px; border-radius: 50%; background: var(--bg); border: 3px solid var(--red); }
ol.tl li[hidden] { display: none; }
ol.tl .yr { font-family: var(--font-head); font-weight: 800; font-size: 1.7rem; line-height: 1.1; }
ol.tl .pill { display: inline-block; font-family: var(--font-head); font-weight: 600; font-size: .95rem; background: var(--tint); border: 1px solid var(--line); border-radius: 999px; padding: 0 .6rem; margin-left: .5rem; vertical-align: .15em; }
ol.tl p { margin: .15rem 0 0; }

/* Gallery */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.tile { background: var(--card); border: 1px solid var(--line); padding: 8px; margin: 0; }
.tile button { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.tile img { width: 100%; aspect-ratio: 1; object-fit: contain; object-position: center; background: var(--tint); }
.tile figcaption { font-size: .9rem; color: var(--muted); padding: .5rem .2rem .1rem; }
.lb { position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 50; display: none; align-items: center; justify-content: center; padding: 1rem; }
.lb.open { display: flex; }
.lb figure { margin: 0; max-width: 900px; max-height: 100%; display: flex; flex-direction: column; gap: .5rem; }
.lb img { max-height: 78vh; width: auto; margin: 0 auto; object-fit: contain; }
.lb figcaption { color: #fff; text-align: center; font-size: .95rem; }
.lb .x { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 14px; }

.btn { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; letter-spacing: .02em; background: var(--red); color: #fff; border: 0; border-radius: 3px; padding: .55rem 1.1rem; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.btn.small { font-size: .95rem; padding: .3rem .75rem; }

/* Messages */
form.msg { display: grid; gap: .75rem; max-width: 560px; margin-bottom: 2rem; }
label { font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; }
input[type=text], textarea { width: 100%; font: inherit; font-size: 1rem; padding: .65rem .8rem; background: var(--card); color: var(--ink); border: 2px solid var(--line); border-radius: 3px; }
textarea { min-height: 100px; resize: vertical; }
.wall { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.note { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--red); padding: 1rem 1.1rem; }
.note p { margin: 0 0 .6rem; overflow-wrap: anywhere; }
.note .by { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; display: flex; justify-content: space-between; gap: .5rem; align-items: center; }

.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 2rem 0 3rem; border-top: 1px solid var(--line); }
.src { font-size: .9rem; color: var(--muted); max-width: 80ch; }
footer { background: var(--green); color: var(--on-green); padding: 2.5rem 0; font-size: .95rem; }
footer p { max-width: 75ch; opacity: .92; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ===== Added for sign in, admin and custom pages ===== */
[hidden] { display: none !important; }
.top .wrap { gap: .75rem; }
.nav { flex: 1; min-width: 0; }
.who { font-size: .9rem; opacity: .85; white-space: nowrap; max-width: 9rem; overflow: hidden; text-overflow: ellipsis; }
.btn.on-green { background: transparent; color: var(--on-green); border: 2px solid rgba(255,255,255,.55); padding: .25rem .7rem; font-size: .95rem; white-space: nowrap; }
.btn.danger { background: #7d1519; color: #fff; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* Sign in page */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; background: var(--bg); }
@media (min-width: 900px) { .auth { grid-template-columns: 1.1fr 1fr; } }
.auth-photo { position: relative; min-height: 46vh; background: var(--green); overflow: hidden; }
@media (min-width: 900px) { .auth-photo { min-height: 100vh; min-height: 100dvh; } }
.auth-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }
.auth-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,42,28,0) 45%, rgba(11,42,28,.9) 100%); }
.auth-cap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 1.5rem 1.5rem 2rem; color: #F2F6F1; }
.auth-cap h1 { font-family: var(--font-head); font-weight: 800; text-transform: uppercase; font-size: clamp(3rem, 10vw, 6rem); line-height: .88; margin: 0 0 .5rem; }
.auth-cap p { margin: 0; font-size: 1.15rem; max-width: 34ch; }
.auth-panel { display: grid; place-items: center; padding: 2rem 1.25rem 3rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { font-size: 2.2rem; margin-bottom: 1rem; }
.tabs { display: flex; border-bottom: 2px solid var(--line); margin-bottom: 1.25rem; }
.tabs button { flex: 1; font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; padding: .6rem; background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; cursor: pointer; color: var(--muted); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--red); }
.field { display: grid; gap: .35rem; margin-bottom: .95rem; }
.field .hint { font-size: .88rem; color: var(--muted); }
.check { display: flex; align-items: center; gap: .5rem; font-family: var(--font-body); font-weight: 400; font-size: .98rem; margin: 0 0 1rem; }
.check input { width: 1.1rem; height: 1.1rem; }
.auth input[type=text], .auth input[type=email], .auth input[type=password],
.field input[type=text], .field input[type=file], .field textarea {
  width: 100%; font: inherit; font-size: 1rem; padding: .7rem .8rem; background: var(--card); color: var(--ink); border: 2px solid var(--line); border-radius: 3px;
}
.auth .btn.wide { width: 100%; padding: .75rem 1rem; font-size: 1.2rem; }
.auth-msg { min-height: 1.5rem; margin: .9rem 0 0; color: var(--red); font-size: .98rem; }
.auth-msg.ok { color: var(--green-2); }
.linkbtn { background: none; border: 0; padding: .4rem 0; margin-top: .5rem; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: .95rem; }
.auth-note { font-size: .9rem; color: var(--muted); margin-top: 1rem; }

/* Admin */
.atabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.75rem; }
#admin-body h2 { font-size: 2rem; margin: 0 0 1rem; }
#admin-body h2.gap { margin-top: 2.5rem; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row.between { justify-content: space-between; margin-bottom: 1rem; }
.row.between h2 { margin: 0; }
.item { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; background: var(--card); border: 1px solid var(--line); padding: .75rem 1rem; margin-bottom: .6rem; }
.item .grow { flex: 1; min-width: 12rem; }
.checks { display: grid; gap: .1rem; }
.empty { border: 2px dashed var(--line); padding: 2rem 1.25rem; text-align: center; color: var(--muted); margin-bottom: 1rem; }
.empty p { margin: 0 auto; }
.thumbs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); margin-top: 1rem; }
.thumb { background: var(--card); border: 1px solid var(--line); padding: 8px; display: grid; gap: .5rem; align-content: start; }
.thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.thumb input[type=text] { width: 100%; font: inherit; font-size: .92rem; padding: .4rem .5rem; background: var(--card); color: var(--ink); border: 2px solid var(--line); border-radius: 3px; }
.astrip { margin-top: 0; margin-bottom: 1.5rem; }
ol.steps { margin: 0 0 .5rem; padding-left: 1.4rem; max-width: 66ch; }
ol.steps li { margin-bottom: .45rem; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); background: var(--ink); color: var(--bg); padding: .65rem 1.1rem; border-radius: 4px; z-index: 80; display: none; max-width: 92vw; font-size: .95rem; box-shadow: 0 8px 24px rgba(0,0,0,.35); }

/* Small screens: menu gets its own row */
@media (max-width: 719px) {
  .top .wrap { flex-wrap: wrap; row-gap: 0; }
  .brand { flex: 1; }
  .who { display: none; }
  .nav { order: 3; flex: 1 0 100%; }
  .auth-photo img { object-position: center 6%; }
}
