/* =================================================================
   East Coast Wahine Championships archive, shared stylesheet.
   Identity carried forward from the original ECWC emblem:
   plum/purple, teal wave, gold stars, on white.
   System fonts only, no external dependencies (archive longevity).
   No em or en dashes anywhere.
   ================================================================= */

:root {
  --plum:        #7d2a7d;   /* primary, from the WAHINE wordmark */
  --plum-dark:   #5e1f5e;
  --plum-soft:   #f4ebf4;   /* tinted surface */
  --teal:        #1f9bb5;   /* secondary, the wave */
  --teal-dark:   #167389;
  --gold:        #e8b33d;   /* accent, the stars */
  --sand:        #fbf8f4;   /* warm page base */
  --ink:         #2c2431;   /* body text, plum-tinted charcoal */
  --ink-soft:    #6b6270;
  --line:        #e6dfe6;
  --white:       #ffffff;

  --wrap: 1080px;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(44,36,49,.10), 0 6px 18px rgba(44,36,49,.06);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--sand);
}

img { max-width: 100%; height: auto; }
a { color: var(--teal-dark); }
a:hover { color: var(--plum); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* ---- Skip link (accessibility) ---- */
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--plum); color: #fff; padding: 10px 16px; z-index: 100;
}
.skip:focus { left: 8px; top: 8px; }

/* ---- Site header + nav ---- */
.site-header {
  background: var(--white);
  border-bottom: 3px solid var(--plum);
  position: sticky; top: 0; z-index: 40;
}
.site-header .bar {
  display: flex; align-items: center; gap: 16px;
  max-width: var(--wrap); margin: 0 auto; padding: 10px 20px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 42px; width: auto; display: block; }
.brand .brand-text { font-family: var(--serif); font-weight: 700; color: var(--plum); font-size: 1.15rem; line-height: 1.1; }
.brand .brand-text small { display: block; font-family: var(--sans); font-weight: 400; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--teal-dark); }

nav.primary { margin-left: auto; }
nav.primary ul { list-style: none; display: flex; flex-wrap: wrap; gap: 2px; margin: 0; padding: 0; }
nav.primary a {
  display: block; padding: 8px 12px; border-radius: 7px;
  text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem;
}
nav.primary a:hover, nav.primary a[aria-current="page"] { background: var(--plum-soft); color: var(--plum); }

/* No-JS mobile menu via <details> */
.menu-toggle { display: none; }

/* ---- Archive notice ribbon ---- */
.archive-note {
  background: var(--plum-soft); color: var(--plum-dark);
  font-size: .9rem; text-align: center; padding: 8px 16px; border-bottom: 1px solid var(--line);
}
.archive-note strong { color: var(--plum); }

/* ---- Hero ---- */
.hero {
  background:
    radial-gradient(1200px 300px at 50% -50%, rgba(31,155,181,.14), transparent 70%),
    linear-gradient(180deg, var(--plum-soft), var(--sand));
  text-align: center; padding: 44px 20px 36px;
  border-bottom: 1px solid var(--line);
}
.hero img.emblem { width: 190px; max-width: 46vw; height: auto; margin-bottom: 14px; filter: drop-shadow(0 6px 14px rgba(125,42,125,.18)); }
.hero h1 { font-family: var(--serif); font-size: clamp(1.7rem, 4.5vw, 2.6rem); color: var(--plum); margin: 0 0 6px; }
.hero .years { display: inline-block; color: var(--teal-dark); font-weight: 700; letter-spacing: .08em; }
.hero p.lede { max-width: 640px; margin: 12px auto 0; color: var(--ink-soft); font-size: 1.05rem; }

/* ---- Section headings ---- */
h2.section { font-family: var(--serif); color: var(--plum); font-size: 1.5rem; margin: 40px 0 4px; }
h2.section + .sub { color: var(--ink-soft); margin: 0 0 18px; }

/* ---- Year grid ---- */
.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin: 22px 0 8px; }
.year-card {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 12px; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); transition: transform .12s ease, border-color .12s ease;
}
.year-card:hover { transform: translateY(-3px); border-color: var(--teal); }
.year-card .yr { font-family: var(--serif); font-size: 1.8rem; font-weight: 700; color: var(--plum); }
.year-card .lbl { font-size: .82rem; color: var(--ink-soft); letter-spacing: .04em; }

/* ---- Content article ---- */
main { display: block; }
article.page { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px clamp(18px, 4vw, 40px); margin: 24px 0 40px; }
article.page h1 { font-family: var(--serif); color: var(--plum); margin-top: 0; font-size: clamp(1.5rem, 3.5vw, 2rem); }
article.page h2 { font-family: var(--serif); color: var(--plum-dark); }
article.page h3 { color: var(--teal-dark); }
article.page a { text-decoration: underline; text-underline-offset: 2px; }
.breadcrumb { font-size: .88rem; color: var(--ink-soft); margin: 18px 0 0; }
.breadcrumb a { color: var(--teal-dark); }

/* Legacy LAYOUT tables (the majority): keep them invisible, just gentle spacing.
   Bordering these is what made pages look like broken grids. */
article.page table { border-collapse: collapse; margin: 8px 0; max-width: 100%; }
article.page td, article.page th { padding: 4px 10px 4px 0; text-align: left; vertical-align: top; }
article.page img { border-radius: 6px; max-width: 100%; }
article.page p { margin: 0 0 1em; }
article.page hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

/* Genuine DATA tables (results, entrant lists) are tagged table.data by the engine. */
article.page table.data { border: 1px solid var(--line); border-radius: 8px; margin: 18px 0; overflow: hidden; }
article.page table.data td, article.page table.data th { border-bottom: 1px solid var(--line); padding: 8px 12px; }
article.page table.data th { background: var(--plum); color: #fff; font-weight: 700; }
article.page table.data tbody tr:nth-child(even) td, article.page table.data tr:nth-child(even) td { background: var(--plum-soft); }

/* ---- Results tables ---- */
.table-scroll { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: var(--radius); }
table.results { border-collapse: collapse; width: 100%; font-size: .95rem; }
table.results caption { text-align: left; font-weight: 700; color: var(--plum); padding: 10px 12px; }
table.results th, table.results td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); }
table.results thead th { background: var(--plum); color: #fff; position: sticky; top: 0; }
table.results tbody tr:nth-child(even) { background: var(--plum-soft); }
table.results tbody tr:hover { background: #fdf6e6; }

/* ---- Photo gallery ---- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 20px 0; align-items: start; }
.gallery figure { margin: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.gallery img { display: block; width: 100%; height: auto; background: var(--plum-soft); }
.gallery figcaption { font-size: .82rem; color: var(--ink-soft); padding: 8px 10px; }

/* ---- Dead-tech / missing media placeholder ---- */
.placeholder {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 120px; padding: 16px; color: var(--ink-soft);
  background: repeating-linear-gradient(45deg, #faf6fa, #faf6fa 10px, #f2eaf2 10px, #f2eaf2 20px);
  border: 1px dashed #cdbccd; border-radius: var(--radius); font-size: .85rem;
}

/* ---- Footer ---- */
.site-footer { background: var(--plum-dark); color: #e9dcea; margin-top: 40px; }
.site-footer .wrap { padding: 26px 20px; display: flex; flex-wrap: wrap; gap: 16px 40px; align-items: baseline; }
.site-footer a { color: #fff; }
.site-footer .muted { color: #c6a9c6; font-size: .85rem; }
.site-footer .muted a { color: var(--gold); }

/* ---- Responsive nav: collapse to disclosure under 760px ---- */
@media (max-width: 760px) {
  .site-header .bar { flex-wrap: wrap; }
  nav.primary { margin-left: auto; }
  nav.primary ul { gap: 0; }
  nav.primary a { padding: 7px 9px; font-size: .9rem; }
}

/* ---- Year strip (secondary nav on interior pages) ---- */
.year-strip { background: var(--white); border-bottom: 1px solid var(--line); }
.year-strip ul { list-style: none; display: flex; flex-wrap: wrap; gap: 2px; margin: 0 auto; padding: 8px 20px; max-width: var(--wrap); }
.year-strip a { display: block; padding: 5px 11px; border-radius: 6px; text-decoration: none; color: var(--ink-soft); font-weight: 700; font-size: .9rem; }
.year-strip a:hover { background: var(--plum-soft); color: var(--plum); }
.year-strip a[aria-current="page"] { background: var(--teal); color: #fff; }
