/* Holy Grail Tournament — site styles */
:root {
  --bg: #f6f2e8;
  --surface: #fffdf8;
  --surface-2: #efe9da;
  --ink: #1d2420;
  --muted: #5d665f;
  --line: #ddd5c2;
  --green: #17402f;
  --green-2: #235c44;
  --gold: #b88a1b;
  --gold-soft: #f3e4b9;
  --red: #a23a2a;
  --pos: #1f7a4d;
  --neg: #a23a2a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 64, 47, .06), 0 8px 24px rgba(23, 64, 47, .07);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1613; --surface: #16201b; --surface-2: #1d2a24; --ink: #e9ede6; --muted: #9eaaa2;
    --line: #2a3a32; --green: #9fd3b6; --green-2: #6fbf95; --gold: #e0b44c; --gold-soft: #3a3120;
    --pos: #6fcf97; --neg: #f08a78; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 var(--sans); min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--green-2); text-underline-offset: 3px; }
a:hover { color: var(--gold); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.15rem; }
img { max-width: 100%; height: auto; }
.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
main { flex: 1; padding: 28px 0 56px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; font-weight: 600; color: var(--gold); margin: 0 0 .4rem; }

/* ---- Header ---- */
.site-header { background: var(--green); color: #f6f2e8; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 12px rgba(0,0,0,.15); }
@media (prefers-color-scheme: dark) { .site-header { background: #0b2219; } }
.site-header .container { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-family: var(--serif); font-size: 1.3rem; font-weight: 600; white-space: nowrap; }
.brand:hover { color: #fff; }
.brand svg { width: 32px; height: 32px; flex: none; }
.brand small { display: block; font: 500 .65rem/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: #e0c27a; margin-top: 3px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: #e8e3d4; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: .95rem; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.active { background: rgba(224,194,122,.18); color: #f3d98f; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 8px; padding: 6px 10px; font: inherit; cursor: pointer; }
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; background: var(--green); padding: 8px 16px 16px; }
  @media (prefers-color-scheme: dark) { .nav { background: #0b2219; } }
  .nav.open { display: flex; }
}

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .9rem; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; }
.site-footer blockquote { margin: 0; font-family: var(--serif); font-style: italic; max-width: 640px; }

/* ---- Hero ---- */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: clamp(28px, 5vw, 56px);
  background: radial-gradient(120% 140% at 100% 0%, #2f6b50 0%, #17402f 55%, #0f2d21 100%); color: #f6f2e8; box-shadow: var(--shadow);
}
.hero::after {
  content: ""; position: absolute; right: -60px; bottom: -80px; width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(224,194,122,.28), rgba(224,194,122,0) 70%);
}
.hero h1 { color: #fff; max-width: 22ch; }
.hero .eyebrow { color: #e0c27a; }
.hero p { color: #d7dfd8; max-width: 56ch; }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: end; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fact { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 12px 14px; }
.fact b { display: block; font-family: var(--serif); font-size: 1.35rem; color: #fff; font-weight: 600; }
.fact span { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: #c9d4cc; }
.badge-open { display: inline-flex; align-items: center; gap: 8px; background: #e0c27a; color: #1d2420; border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: .9rem; margin: 6px 0 14px; }
.badge-open::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #17402f; }

/* ---- Cards / grid ---- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.section { margin-top: 36px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); min-width: 0; }
.card h2, .card h3 { margin-bottom: .6em; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head p { margin: 0; color: var(--muted); max-width: 60ch; }

/* ---- Champions strip ---- */
.champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.champ { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-decoration: none; color: inherit; transition: transform .15s, border-color .15s; }
.champ:hover { transform: translateY(-2px); border-color: var(--gold); color: inherit; }
.champ .yr { font-family: var(--serif); font-size: 1.5rem; color: var(--gold); font-weight: 600; }
.champ .nm { font-weight: 600; }
.champ .vn { font-size: .8rem; color: var(--muted); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; background: var(--surface-2); position: sticky; top: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--gold-soft) 45%, transparent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.ctr, th.ctr { text-align: center; }
.pos { color: var(--pos); font-weight: 600; }
.neg { color: var(--neg); }
.rank { font-family: var(--serif); font-weight: 600; width: 52px; white-space: nowrap; }
tr.leader td { background: color-mix(in srgb, var(--gold-soft) 70%, transparent); }
tr.leader .rank::before { content: "♛ "; color: var(--gold); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.pill.yes { background: color-mix(in srgb, var(--pos) 16%, transparent); color: var(--pos); }
.pill.no { background: color-mix(in srgb, var(--neg) 14%, transparent); color: var(--neg); }
.pill.gold { background: var(--gold-soft); color: var(--gold); }

/* ---- Year tabs ---- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.tabs a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); background: var(--surface); font-weight: 500; font-variant-numeric: tabular-nums; }
.tabs a:hover { border-color: var(--gold); color: var(--ink); }
.tabs a.active { background: var(--green); border-color: var(--green); color: #fff; }
@media (prefers-color-scheme: dark) { .tabs a.active { color: #0f1613; } }

/* ---- Scorecard ---- */
.scorecard { font-size: .82rem; min-width: 760px; }
.scorecard th, .scorecard td { text-align: center; padding: 6px 4px; }
.scorecard th:first-child, .scorecard td:first-child { text-align: left; padding-left: 10px; white-space: nowrap; }
.scorecard .sub { background: var(--surface-2); font-weight: 600; }
.hole { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.hole.eagle { background: var(--gold); color: #1d2420; border-radius: 50%; font-weight: 700; }
.hole.birdie { box-shadow: inset 0 0 0 2px var(--pos); border-radius: 50%; color: var(--pos); font-weight: 700; }
.hole.par { }
.hole.bogey { box-shadow: inset 0 0 0 1px var(--muted); }
.hole.double { box-shadow: inset 0 0 0 2px var(--neg); color: var(--neg); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .8rem; color: var(--muted); margin-top: 10px; align-items: center; }

/* ---- Stats tiles ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-family: var(--serif); font-size: 1.7rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat span { font-size: .75rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }

/* ---- Spark bars ---- */
.bars { display: flex; align-items: center; gap: 6px; height: 170px; margin-bottom: 24px; position: relative; }
.bars::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed var(--line); }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; position: relative; min-width: 26px; }
.bars-wrap { overflow-x: auto; padding-bottom: 4px; }
.bar i { position: absolute; left: 22%; right: 22%; border-radius: 4px; }
.bar i.up { bottom: 50%; background: var(--pos); }
.bar i.down { top: 50%; background: var(--neg); }
.bar em { position: absolute; bottom: -18px; font-style: normal; font-size: .72rem; color: var(--muted); }
.bar strong { position: absolute; font-size: .72rem; }

/* ---- Forms ---- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 18px; }
label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 9px; padding: 9px 11px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--gold) 60%, transparent); border-color: var(--gold); }
input[type=checkbox], input[type=radio] { width: auto; }
textarea { min-height: 120px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; color: var(--ink); font-size: .95rem; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--green); background: var(--green); color: #fff; padding: 9px 16px; border-radius: 9px; font: 600 .95rem var(--sans); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--green-2); color: #fff; }
@media (prefers-color-scheme: dark) { .btn, .btn:hover { color: #0f1613; } }
.btn.ghost { background: transparent; color: var(--green); }
.btn.ghost:hover { background: var(--surface-2); color: var(--green); }
.btn.danger { background: var(--neg); border-color: var(--neg); }
.btn.sm { padding: 5px 10px; font-size: .85rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.alert { padding: 12px 16px; border-radius: 10px; background: color-mix(in srgb, var(--pos) 14%, transparent); color: var(--pos); margin-bottom: 18px; font-weight: 500; }
.alert.err { background: color-mix(in srgb, var(--neg) 14%, transparent); color: var(--neg); }
.field-validation-error, .validation-summary-errors { color: var(--neg); font-size: .85rem; }
.holes-grid { display: grid; grid-template-columns: 70px repeat(18, minmax(34px, 1fr)); gap: 4px; align-items: center; min-width: 760px; }
.holes-grid input { padding: 6px 2px; text-align: center; }
.holes-grid .hd { font-size: .72rem; text-align: center; color: var(--muted); font-weight: 600; }

/* ---- Admin nav ---- */
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.admin-nav a { padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 500; }
.admin-nav a:hover, .admin-nav a.active { background: var(--surface-2); }

/* ---- Gallery ---- */
.album { margin-top: 30px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.photo { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: zoom-in; transition: transform .15s; }
.photo:hover { transform: translateY(-2px); }
.photo .ph { aspect-ratio: 4/3; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo figcaption { padding: 10px 12px; font-size: .88rem; }
dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: min(1000px, 94vw); }
dialog.lightbox::backdrop { background: rgba(5, 10, 8, .85); }
dialog.lightbox img { max-height: 82vh; border-radius: 10px; display: block; margin: 0 auto; }
dialog.lightbox p { color: #f6f2e8; text-align: center; font-family: var(--serif); font-size: 1.1rem; }
dialog.lightbox button { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.55); color: #fff; border: 0; border-radius: 50%; width: 36px; height: 36px; font-size: 20px; cursor: pointer; }

/* ---- News ---- */
.topten { counter-reset: tt 11; list-style: none; padding: 0; margin: 0; }
.topten li { counter-increment: tt -1; display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.topten li::before { content: counter(tt); font-family: var(--serif); font-size: 1.4rem; color: var(--gold); width: 28px; text-align: right; flex: none; line-height: 1.2; }
.quote { margin: 0 0 16px; padding: 4px 0 4px 18px; border-left: 3px solid var(--gold); font-family: var(--serif); font-size: 1.08rem; }
.quote cite { display: block; font: 600 .85rem var(--sans); color: var(--muted); margin-top: 4px; font-style: normal; }

.filter { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter input[type=search] { max-width: 260px; }

/* ---- Documents ---- */
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr)); gap: 12px; }
.doc { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.doc-icon { width: 38px; height: 38px; flex: none; color: var(--red); }
.doc-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.doc-meta a { color: var(--ink); text-decoration: none; }
.doc-meta a:hover { color: var(--green-2); text-decoration: underline; }
.doc-actions { display: flex; gap: 6px; flex: none; }
@media (max-width: 480px) { .doc { flex-wrap: wrap; } .doc-actions { width: 100%; } }
