/* =====================================================================
   Menomonee Falls Dart Association - styles.css
   One stylesheet for the whole site. Design tokens live in :root.
   Modernized "classic" look: dark theme, navy + dart-red + gold,
   condensed display type (Oswald) over a clean body face (Inter).
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Oswald:wght@500;600;700&display=swap');

/* ---- Design tokens -------------------------------------------------- */
:root {
  /* Brand */
  --navy:        #1b3a8f;   /* modernized from the classic #00026e */
  --navy-deep:   #0f2557;
  --navy-line:   #24449a;
  --red:         #d5202f;   /* dart-flight red, from #980606 */
  --red-deep:    #a5121e;
  --gold:        #f5c542;   /* highlight, from the classic #edf01f */
  --green:       #22a45d;   /* dartboard green - positive stats */

  /* Surfaces */
  --bg:          #0b0f17;
  --surface:     #131a26;
  --surface-2:   #1a2331;
  --surface-3:   #212c3d;

  /* Text */
  --text:        #eef2f8;
  --muted:       #9db0c9;
  --dim:         #6f819b;

  /* Lines & effects */
  --line:        rgba(255,255,255,.10);
  --line-strong: rgba(255,255,255,.18);
  --shadow:      0 10px 30px rgba(0,0,0,.45);
  --shadow-sm:   0 4px 14px rgba(0,0,0,.35);

  /* Metrics */
  --wrap:        1120px;
  --r:           14px;
  --r-sm:        9px;
}

/* ---- Reset / base --------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Subtle dartboard wash behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 600px at 50% -10%, rgba(27,58,143,.30), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(213,32,47,.12), transparent 55%),
    var(--bg);
}

img { max-width: 100%; display: block; }

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: 'Oswald', 'Inter', sans-serif;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: .01em;
  margin: 0 0 .5em;
}

h1 { font-size: clamp(2rem, 5vw, 3.1rem); text-transform: uppercase; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); text-transform: uppercase; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1rem; }

/* Accessibility: skip link */
.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--gold); color: #1a1200; padding: .6rem 1rem;
  border-radius: 0 0 var(--r-sm) 0; font-weight: 700; z-index: 100;
}
.skip:focus { left: 0; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---- Layout helpers ------------------------------------------------- */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.section { padding: 56px 0; }
.section-tight { padding: 34px 0; }

.eyebrow {
  display: inline-block;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-size: .8rem;
  color: var(--gold);
  margin-bottom: .5rem;
}

.lead { font-size: 1.12rem; color: var(--muted); max-width: 60ch; }

.center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Red header rule - a nod to the classic red section bars */
.bar-head {
  display: flex; align-items: center; gap: .8rem;
  margin-bottom: 1.4rem;
}
.bar-head::after {
  content: ""; flex: 1 1 auto; height: 3px;
  background: linear-gradient(90deg, var(--red), transparent);
  border-radius: 3px;
}

/* ---- Header / nav --------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, var(--navy-deep), rgba(15,37,87,.94));
  border-bottom: 1px solid var(--navy-line);
  backdrop-filter: blur(6px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 10px 20px; max-width: var(--wrap); margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: .7rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-badge {
  width: 46px; height: 46px; border-radius: 50%;
  background: #fff; padding: 3px; flex: none;
  box-shadow: 0 0 0 2px var(--gold), var(--shadow-sm);
  object-fit: contain;
}
.brand-name { display: flex; flex-direction: column; line-height: 1; }
.brand-name b {
  font-family: 'Oswald', sans-serif; font-weight: 700;
  font-size: 1.06rem; letter-spacing: .02em; text-transform: uppercase;
}
.brand-name span { font-size: .68rem; letter-spacing: .22em; color: var(--gold); text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: .25rem; }
.nav a {
  color: var(--text); font-weight: 500; font-size: .95rem;
  padding: .5rem .7rem; border-radius: var(--r-sm);
}
.nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.nav a.active { color: var(--gold); }
.nav a.cta {
  background: var(--red); color: #fff; font-weight: 600;
}
.nav a.cta:hover { background: var(--red-deep); }

.nav-toggle {
  display: none; background: transparent; border: 1px solid var(--line-strong);
  color: var(--text); width: 44px; height: 40px; border-radius: var(--r-sm);
  cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle svg { width: 22px; height: 22px; }

/* ---- Buttons -------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 600; font-size: .98rem;
  padding: .72rem 1.15rem; border-radius: var(--r-sm);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-deep); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-deep); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-lg { padding: .9rem 1.5rem; font-size: 1.05rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; }

/* ---- Hero ----------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background: url('../img/dartboard-bg.jpg') center/cover no-repeat;
  opacity: .18; filter: saturate(1.1);
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,15,23,.55), rgba(11,15,23,.92));
}
.hero-inner {
  position: relative; z-index: 1;
  max-width: var(--wrap); margin: 0 auto; padding: 74px 20px 66px;
  display: grid; grid-template-columns: 1.3fr .9fr; gap: 40px; align-items: center;
}
.hero h1 { margin-bottom: .4rem; }
.hero h1 .accent { color: var(--red); }
.hero .lead { margin-bottom: 1.6rem; }
.hero-badges { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.6rem; }
.pill {
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--muted); font-size: .82rem; font-weight: 500;
  padding: .4rem .75rem; border-radius: 999px;
}
.pill svg { width: 15px; height: 15px; color: var(--gold); }
.hero-art {
  justify-self: center;
  width: min(340px, 80%);
  background: #fff; border-radius: 50%; padding: 14px;
  box-shadow: 0 0 0 4px var(--gold), 0 0 0 12px rgba(213,32,47,.25), var(--shadow);
}

/* ---- Cards & grids -------------------------------------------------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card h3 { margin-bottom: .4rem; }
.card p { color: var(--muted); margin-bottom: 0; }
.card.accent-top { border-top: 3px solid var(--red); }

.card-link {
  display: flex; align-items: center; gap: .9rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px 18px; color: var(--text);
  transition: border-color .15s ease, background .15s ease, transform .06s ease;
}
.card-link:hover { text-decoration: none; border-color: var(--navy-line); background: var(--surface-2); transform: translateY(-2px); }
.card-link .ico {
  width: 44px; height: 44px; flex: none; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--navy); color: #fff;
}
.card-link .ico svg { width: 22px; height: 22px; }
.card-link b { display: block; font-family: 'Oswald', sans-serif; font-weight: 600; letter-spacing: .02em; }
.card-link small { color: var(--muted); }

.icon-badge {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--navy), var(--navy-deep));
  color: var(--gold); margin-bottom: .8rem;
}
.icon-badge svg { width: 24px; height: 24px; }

/* ---- News / updates panels ----------------------------------------- */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden;
}
.panel-head {
  background: var(--red); color: #fff; padding: .6rem 1rem;
  font-family: 'Oswald', sans-serif; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; font-size: 1.02rem;
}
.panel-head.navy { background: var(--navy); }
.panel-body { padding: 18px 20px; }
.panel-body .muted { color: var(--muted); }
.notice { color: var(--gold); font-weight: 600; }

/* ---- Tables (standings / stats) ------------------------------------ */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table.stats {
  width: 100%; border-collapse: collapse; min-width: 560px;
  font-variant-numeric: tabular-nums;
}
table.stats caption { text-align: left; padding: 12px 14px; color: var(--muted); font-size: .9rem; }
table.stats thead th {
  background: var(--navy-deep); color: #fff; text-align: left;
  font-family: 'Oswald', sans-serif; font-weight: 500; letter-spacing: .03em;
  text-transform: uppercase; font-size: .82rem;
  padding: 11px 14px; white-space: nowrap; position: sticky; top: 0;
}
table.stats thead th.sortable { cursor: pointer; user-select: none; }
table.stats thead th.sortable:hover { background: var(--navy); }
table.stats thead th .arrow { opacity: .4; font-size: .7em; }
table.stats thead th[aria-sort="ascending"] .arrow,
table.stats thead th[aria-sort="descending"] .arrow { opacity: 1; color: var(--gold); }
table.stats tbody td { padding: 10px 14px; border-top: 1px solid var(--line); }
table.stats tbody tr:nth-child(even) { background: rgba(255,255,255,.025); }
table.stats tbody tr:hover { background: rgba(27,58,143,.18); }
table.stats td.num, table.stats th.num { text-align: right; }
.rank { color: var(--dim); font-weight: 600; width: 2.2rem; }
.rank.top { color: var(--gold); }
.pos { color: var(--green); font-weight: 600; }
.neg { color: var(--red); font-weight: 600; }

/* Tabs (divisions / stat categories) */
.tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.1rem; }
.tab {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
  padding: .5rem .95rem; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .9rem;
}
.tab[aria-selected="true"] { background: var(--red); border-color: var(--red); color: #fff; }
.tabpanel[hidden] { display: none; }

.updated-stamp {
  display: inline-flex; align-items: center; gap: .4rem;
  color: var(--muted); font-size: .88rem;
}
.updated-stamp b { color: var(--text); }

/* ---- Forms ---------------------------------------------------------- */
.form { display: grid; gap: 1rem; max-width: 640px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: grid; gap: .35rem; }
.field label { font-weight: 600; font-size: .92rem; }
.field .req { color: var(--red); }
.field input, .field select, .field textarea {
  background: var(--surface-2); border: 1px solid var(--line-strong);
  color: var(--text); border-radius: var(--r-sm); padding: .7rem .8rem;
  font: inherit; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--gold); outline: none;
}
.field textarea { min-height: 120px; resize: vertical; }
.hp { position: absolute; left: -5000px; } /* honeypot */
.form-msg { font-weight: 600; }
.form-msg.err { color: var(--red); }
.form-msg.ok  { color: var(--green); }

/* Roster picker (team registration) */
.roster-add { display: flex; gap: .6rem; margin-bottom: .7rem; }
.roster-add .roster-input { flex: 1 1 auto; }
.roster-add .btn { flex: none; }
.roster-list { list-style: none; margin: 0 0 .6rem; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.roster-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--surface-3); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: .3rem .35rem .3rem .8rem; font-size: .9rem;
}
.roster-chip button {
  background: transparent; border: none; color: var(--muted); cursor: pointer;
  font-size: 1.05rem; line-height: 1; width: 1.4rem; height: 1.4rem; border-radius: 50%;
}
.roster-chip button:hover { background: var(--red); color: #fff; }

/* ---- League score sheet -------------------------------------------- */
.sheet-block { margin-bottom: 1.4rem; }
.sheet-select {
  background: var(--surface-2); border: 1px solid var(--line-strong);
  color: var(--text); border-radius: var(--r-sm); padding: .45rem .5rem;
  font: inherit; width: 100%; max-width: 100%;
}
.sheet-select:focus { border-color: var(--gold); outline: none; }
.sheet-num {
  background: var(--surface-2); border: 1px solid var(--line-strong);
  color: var(--text); border-radius: var(--r-sm); padding: .35rem; width: 58px;
  font: inherit; text-align: center;
}
.sheet-num:focus { border-color: var(--gold); outline: none; }

.sheet-team { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.sheet-team-head {
  font-family: 'Oswald', sans-serif; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: #fff; background: var(--navy); padding: .35rem .8rem; border-radius: var(--r-sm); margin-bottom: 1rem;
}
.sheet-team-head.away { background: var(--red); }
.sheet-sub { display: block; font-weight: 600; font-size: .88rem; margin: 1rem 0 .45rem; color: var(--muted); }

.sheet-addrow { display: flex; gap: .5rem; margin-bottom: .6rem; }
.sheet-addinput {
  flex: 1 1 auto; background: var(--surface-2); border: 1px solid var(--line-strong);
  color: var(--text); border-radius: var(--r-sm); padding: .5rem .6rem; font: inherit;
}
.sheet-addinput:focus { border-color: var(--gold); outline: none; }
.sheet-count { font-size: .82rem; margin-top: .3rem; }

.sheet-positions { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.sheet-pos { display: flex; flex-direction: column; gap: .2rem; }
.sheet-pos label { font-size: .78rem; color: var(--muted); font-weight: 600; }

.sheet-scoreline {
  font-family: 'Oswald', sans-serif; font-size: 1.5rem; font-weight: 600; text-align: center;
  padding: .6rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 1rem;
}

table.sheet-games tbody tr.game-team { background: rgba(245,197,66,.09); }
.order-cell .sheet-order { display: inline-block; width: auto; min-width: 104px; margin: .15rem .2rem; }
table.sheet-games td:last-child, table.sheet-games th:last-child { width: 160px; }
table.sheet-games td:last-child .sheet-select { min-width: 130px; }

table.sheet-stats th.grp { background: var(--navy-deep); border-left: 2px solid var(--line-strong); text-align: center; }
table.sheet-stats th.grp.cricket { background: var(--red-deep); }

@media (max-width: 720px) { .sheet-positions { grid-template-columns: 1fr; } }

/* ---- Print (site is dark-themed; print in black on white) ---------- */
.no-print { }
@media print {
  .no-print { display: none !important; }
  body::before { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .section { padding: 0 !important; }
  .sheet-team, .sheet-scoreline, .card, .table-wrap { background: #fff !important; color: #000 !important; border-color: #999 !important; }
  .sheet-team-head { background: #333 !important; color: #fff !important; }
  .sheet-team-head.away { background: #666 !important; }
  table.stats thead th { background: #ddd !important; color: #000 !important; }
  table.stats th.grp { background: #bbb !important; }
  table.stats tbody td, table.stats thead th { border-color: #999 !important; color: #000 !important; }
  table.stats tbody tr:nth-child(even) { background: #f3f3f3 !important; }
  .sheet-select, .sheet-num, .sheet-addinput { background: #fff !important; color: #000 !important; border-color: #999 !important; }
  h1, h2, h3, .bar-head, .muted, label { color: #000 !important; }
  .bar-head::after { display: none; }
}

/* ---- Gallery -------------------------------------------------------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.gallery figure { margin: 0; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.gallery img { width: 100%; height: 180px; object-fit: cover; }
.gallery figcaption { padding: .6rem .8rem; color: var(--muted); font-size: .85rem; }
.gallery-empty { color: var(--muted); }

/* ---- Memorial ------------------------------------------------------- */
.memoriam { border-left: 3px solid var(--gold); padding-left: 1.2rem; }
.memoriam h3 { color: var(--gold); }

/* ---- Sponsors ------------------------------------------------------- */
.sponsor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.sponsor {
  background: #fff; color: #10131a; border-radius: var(--r);
  padding: 20px; text-align: center; font-weight: 600;
  display: grid; place-items: center; min-height: 110px;
}

/* ---- Callout / CTA strip ------------------------------------------- */
.cta-strip {
  background: linear-gradient(120deg, var(--navy-deep), var(--navy));
  border: 1px solid var(--navy-line); border-radius: var(--r);
  padding: 30px; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 18px;
}
.cta-strip h2 { margin: 0; }
.cta-strip p { margin: .3rem 0 0; color: #cdd8ee; }

/* ---- Footer --------------------------------------------------------- */
.site-footer {
  margin-top: 40px; border-top: 1px solid var(--line);
  background: var(--navy-deep);
}
.footer-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 40px 20px 28px;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px;
}
.footer-inner h4 {
  font-family: 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: .08em;
  font-size: .9rem; color: var(--gold); margin: 0 0 .8rem;
}
.footer-inner a { color: #cdd8ee; display: block; padding: .18rem 0; }
.footer-inner a:hover { color: #fff; }
.footer-brand { display: flex; gap: .8rem; align-items: flex-start; }
.footer-brand img { width: 54px; height: 54px; border-radius: 50%; background: #fff; padding: 3px; flex: none; }
.footer-brand p { color: #aebbd6; font-size: .92rem; margin: .4rem 0 0; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.10);
  text-align: center; color: #8ea0be; font-size: .85rem; padding: 16px 20px;
}

/* ---- Breadcrumb / page head ---------------------------------------- */
.page-head {
  background: linear-gradient(180deg, rgba(27,58,143,.35), transparent);
  border-bottom: 1px solid var(--line); padding: 40px 0 30px;
}
.page-head p { margin: 0; color: var(--muted); max-width: 65ch; }

/* ---- Utilities ------------------------------------------------------ */
.muted { color: var(--muted); }
.gold { color: var(--gold); }
.stack > * + * { margin-top: 1rem; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
hr.rule { border: none; border-top: 1px solid var(--line); margin: 2rem 0; }

/* ---- Responsive ----------------------------------------------------- */
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: .2rem;
    background: var(--navy-deep); border-bottom: 1px solid var(--navy-line);
    padding: 10px 14px 16px; display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: .7rem .6rem; }
  .hero-inner { grid-template-columns: 1fr; gap: 26px; }
  .hero-art { order: -1; width: min(220px, 60%); }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form .row { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .cta-strip { flex-direction: column; align-items: flex-start; }
  .section { padding: 40px 0; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
