/* Self-hosted fonts (latin subsets, downloaded from Google Fonts) */
@font-face {
  font-family: "Alfa Slab One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/alfa-slab-one-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Staatliches";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/staatliches-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("/fonts/source-sans-3-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("/fonts/source-sans-3-italic-latin.woff2") format("woff2");
}

/* ==========================================================================
   Bridgewater Country Fair — design system
   Palette: rosette blue / barn red / sun gold / poster paper / ink
   Type: Alfa Slab One (display) · Staatliches (labels) · Source Sans 3 (body)
   ========================================================================== */

:root {
  --blue: #2b4c9b;
  --blue-dark: #1e3a78;
  --blue-night: #16274f;
  --red: #b3382c;
  --red-dark: #8f2c22;
  --gold: #e8a93d;
  --gold-soft: #f3cf8b;
  --paper: #faf7f0;
  --card: #fffdf7;
  --ink: #22201c;
  --ink-soft: #57534a;
  --line: #e4ddd0;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(34, 32, 28, 0.08);
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  font-size: 1.06rem;
  line-height: 1.65;
}

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

a { color: var(--blue); }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

/* ---------- Type roles ---------- */
h1, h2, h3, .display {
  font-family: "Alfa Slab One", "Rockwell", serif;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.01em;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2rem, 5.5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); color: var(--blue-dark); }
h3 { font-size: 1.22rem; color: var(--red-dark); }

.eyebrow {
  font-family: "Staatliches", "Oswald", sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  color: var(--red);
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.35rem;
}

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--blue);
  color: #fff;
  position: relative;
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 0.9rem;
  padding-bottom: 1.1rem;
}
.brand {
  font-family: "Alfa Slab One", serif;
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  color: #fff;
  text-decoration: none;
  line-height: 1.1;
}
.brand small {
  display: block;
  font-family: "Staatliches", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--gold-soft);
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.1rem;
  font-family: "Staatliches", sans-serif;
  font-size: 1.02rem;
  letter-spacing: 0.08em;
}
.site-nav a {
  color: #fff;
  text-decoration: none;
  padding: 0.2rem 0.1rem;
  border-bottom: 3px solid transparent;
}
.site-nav a:hover { color: var(--gold-soft); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--gold); color: var(--gold-soft); }

/* Hamburger toggle — hidden on desktop */
.nav-toggle {
  display: none;
  background: none;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  padding: 0.55rem 0.6rem;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  min-width: 44px;
  min-height: 44px;
}
.nav-toggle .bar {
  display: block;
  width: 24px;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] { border-color: var(--gold); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 860px) {
  /* The toggle only takes over when JS is running (html.js);
     without JS the nav stays visible as a wrapped list. */
  .js .nav-toggle { display: flex; }
  .js .site-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    padding-top: 0.6rem;
  }
  .js .site-nav.open { display: flex; }
  .js .site-nav a {
    padding: 0.65rem 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 1.15rem;
  }
  .js .site-nav a[aria-current="page"] {
    border-bottom: 1px solid var(--gold);
  }
}

/* bunting flags under the header */
.bunting {
  height: 18px;
  background:
    linear-gradient(135deg, var(--blue) 50%, transparent 50%) ,
    linear-gradient(225deg, var(--blue) 50%, transparent 50%);
  background-size: 24px 18px;
  background-repeat: repeat-x;
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 500px at 50% -20%, rgba(232, 169, 61, 0.16), transparent 65%),
    var(--paper);
  text-align: center;
  padding: 3.2rem 1.25rem 2.4rem;
}
.hero .dates {
  font-family: "Staatliches", sans-serif;
  font-size: clamp(1.3rem, 3.5vw, 1.9rem);
  letter-spacing: 0.16em;
  color: var(--red);
}
.hero h1 { color: var(--blue-dark); margin-bottom: 0.2em; }
.hero .edition {
  font-family: "Staatliches", sans-serif;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  font-size: 1.05rem;
}
.hero .cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  margin-top: 1.6rem;
}

.btn {
  display: inline-block;
  font-family: "Staatliches", sans-serif;
  font-size: 1.08rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  padding: 0.65rem 1.5rem;
  border-radius: 6px;
  border: 2px solid transparent;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-outline { border-color: var(--blue); color: var(--blue); background: transparent; }
.btn-outline:hover { background: var(--blue); color: #fff; }

/* ---------- Signature: admission-ticket info strip ---------- */
.ticket {
  position: relative;
  background: var(--card);
  border: 2px solid var(--blue);
  border-radius: 14px;
  box-shadow: var(--shadow);
  margin: 0 auto 2.5rem;
  max-width: var(--maxw);
  overflow: hidden;
}
.ticket::before,
.ticket::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 26px;
  height: 26px;
  background: var(--paper);
  border: 2px solid var(--blue);
  border-radius: 50%;
  transform: translateY(-50%);
}
.ticket::before { left: -15px; }
.ticket::after { right: -15px; }
.ticket-head {
  background: var(--blue);
  color: #fff;
  text-align: center;
  font-family: "Staatliches", sans-serif;
  letter-spacing: 0.3em;
  font-size: 1rem;
  padding: 0.45rem 1rem;
}
.ticket-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.ticket-cell {
  padding: 1.4rem 1.6rem;
  border-top: 2px dashed var(--line);
}
.ticket-cell + .ticket-cell { border-left: 2px dashed var(--line); }
@media (max-width: 760px) {
  .ticket-cell + .ticket-cell { border-left: none; }
  .ticket::before, .ticket::after { display: none; }
}
.ticket-cell h3 {
  font-family: "Staatliches", sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.14em;
  color: var(--blue-dark);
  margin-bottom: 0.5rem;
}
.ticket-cell ul { list-style: none; margin: 0; padding: 0; }
.ticket-cell li { padding: 0.14rem 0; }
.ticket-cell .price { float: right; font-weight: 700; color: var(--red-dark); }
.ticket-cell .free {
  display: inline-block;
  background: var(--gold);
  color: var(--ink);
  font-family: "Staatliches", sans-serif;
  letter-spacing: 0.08em;
  padding: 0 0.5rem;
  border-radius: 4px;
}

/* ---------- Notices ---------- */
.notice-row {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-bottom: 2.5rem;
}
.notice {
  border-radius: var(--radius);
  padding: 0.85rem 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.notice.warn { background: #f7e8d9; border: 1.5px solid var(--gold); }
.notice.ok { background: #e7ecf7; border: 1.5px solid var(--blue); }
.notice .dot {
  flex: none;
  width: 12px; height: 12px;
  border-radius: 50%;
}
.notice.warn .dot { background: var(--red); }
.notice.ok .dot { background: var(--blue); }

/* ---------- Sections & cards ---------- */
.section { padding: 2.6rem 0; }
.section.alt { background: #f2ede1; }
.section-head { text-align: center; max-width: 760px; margin: 0 auto 2rem; }

.card-grid {
  display: grid;
  gap: 1.3rem;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
}
.card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.card-body { padding: 1.2rem 1.3rem 1.4rem; flex: 1; }
.card-body h3 { margin-bottom: 0.4rem; }
.card-link {
  font-family: "Staatliches", sans-serif;
  letter-spacing: 0.1em;
  text-decoration: none;
}

/* ---------- Blue-ribbon rosette (story section) ---------- */
.story {
  background: var(--blue-night);
  color: #f4f1e8;
}
.story .wrap {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 2.2rem;
  align-items: center;
  padding-top: 3rem;
  padding-bottom: 3rem;
}
@media (max-width: 680px) {
  .story .wrap { grid-template-columns: 1fr; text-align: center; justify-items: center; }
}
.story h2 { color: var(--gold-soft); }
.story p { max-width: 62ch; }
.rosette { position: relative; width: 150px; height: 200px; }
.rosette .disc {
  position: absolute; inset: 0 0 auto 0;
  width: 150px; height: 150px;
  border-radius: 50%;
  background: repeating-conic-gradient(var(--blue) 0 10deg, var(--blue-dark) 10deg 20deg);
  border: 5px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
}
.rosette .disc-center {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: var(--card);
  color: var(--blue-dark);
  font-family: "Alfa Slab One", serif;
  font-size: 1.6rem;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
}
.rosette .tail {
  position: absolute;
  top: 130px;
  width: 34px; height: 70px;
  background: var(--blue);
  border-bottom: 12px solid var(--gold);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%);
}
.rosette .tail.left { left: 34px; transform: rotate(12deg); }
.rosette .tail.right { right: 34px; transform: rotate(-12deg); }

/* ---------- Sponsors ---------- */
.sponsor-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  align-items: center;
}
.sponsor-grid img {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
}

/* ---------- Food menu ---------- */
.tent {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-left: 6px solid var(--red);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.2rem;
}
.tent:nth-of-type(even) { border-left-color: var(--blue); }
.tent h3 { margin-bottom: 0.35rem; }
.tent p { margin: 0; }

/* ---------- Tables / results ---------- */
.results {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.results th, .results td { padding: 0.55rem 0.9rem; text-align: left; }
.results th {
  background: var(--blue);
  color: #fff;
  font-family: "Staatliches", sans-serif;
  letter-spacing: 0.1em;
  font-weight: 400;
}
.results tr:nth-child(even) td { background: #f4efe4; }

/* ---------- Contact lists ---------- */
.people-grid {
  display: grid;
  gap: 0.5rem 2rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}
.people-grid li { padding: 0.4rem 0; border-bottom: 1px dashed var(--line); }
.people-grid .role { font-weight: 700; color: var(--blue-dark); }

.photo-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.photo-grid figure { margin: 0; }
.photo-grid img { border-radius: var(--radius); border: 1.5px solid var(--line); }
.photo-grid figcaption {
  font-family: "Staatliches", sans-serif;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  padding-top: 0.4rem;
  text-align: center;
}

/* ---------- Prize list (raffle) ---------- */
.prize-list { list-style: none; margin: 0 0 2rem; padding: 0; counter-reset: prize; }
.prize-list li {
  counter-increment: prize;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 0.7rem;
  padding: 0.9rem 1.2rem 0.9rem 4.4rem;
  position: relative;
  font-weight: 600;
}
.prize-list li::before {
  content: counter(prize);
  position: absolute;
  left: 0.9rem; top: 50%;
  transform: translateY(-50%);
  width: 2.4rem; height: 2.4rem;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-family: "Alfa Slab One", serif;
  display: flex; align-items: center; justify-content: center;
}
.prize-list li:first-child { border-color: var(--gold); background: #fdf5e3; }
.prize-list li:first-child::before { background: var(--gold); color: var(--ink); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--blue-night);
  color: #cfd6e8;
  padding: 2.6rem 0 2rem;
  margin-top: 3rem;
}
.site-footer a { color: var(--gold-soft); }
.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.site-footer h3 {
  color: #fff;
  font-family: "Staatliches", sans-serif;
  letter-spacing: 0.14em;
  font-size: 1.1rem;
}
.footer-note {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.9rem;
  text-align: center;
}

/* ---------- Page-title band for interior pages ---------- */
.page-title {
  background: var(--blue);
  color: #fff;
  text-align: center;
  padding: 2.2rem 1.25rem 2rem;
}
.page-title h1 { color: #fff; margin-bottom: 0.1em; }
.page-title p {
  margin: 0;
  font-family: "Staatliches", sans-serif;
  letter-spacing: 0.14em;
  color: var(--gold-soft);
}

/* ---------- Utility ---------- */
.lead { font-size: 1.15rem; }
.center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.skip-link {
  position: absolute;
  left: -999px;
  background: var(--gold);
  color: var(--ink);
  padding: 0.5rem 1rem;
  z-index: 10;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }
