/* ============================================================
   Foyle Harps YFC — site stylesheet
   Colours sampled from the club crest:
     green #326A0D · gold #AE7C04
   ============================================================ */

/* ---------- Font (self-hosted, variable weight 200–1000) ---------- */
@font-face {
  font-family: "Nunito Sans";
  src: url("/assets/fonts/nunito-sans-var.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  --fh-green: #326A0D;        /* sampled from crest */
  --fh-green-dark: #26520a;
  --fh-green-tint: #eaf2e3;
  --fh-gold: #AE7C04;         /* sampled from crest */
  --fh-gold-bright: #FBC442;  /* same hue, lightened for text on green */
  --ink: #1c241a;
  --ink-soft: #4c574a;
  --paper: #ffffff;
  --paper-alt: #f4f7f1;
  --line: #dbe3d4;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(28, 36, 26, 0.12);
  --content-width: 1100px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Nunito Sans", "Segoe UI", Arial, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.2; font-weight: 700; color: var(--fh-green-dark); }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1em; }

/* Body links: green, gold + underline on hover/focus (site-wide rule) */
main a {
  color: var(--fh-green);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}
main a:hover, main a:focus-visible {
  color: var(--fh-gold);
  text-decoration-color: currentColor;
}
:focus-visible {
  outline: 3px solid var(--fh-gold);
  outline-offset: 2px;
  border-radius: 2px;
}

.container {
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: 1rem;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap;
}
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--fh-gold-bright); color: var(--ink);
  padding: 0.6rem 1rem; z-index: 100; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* ============================================================
   HEADER / NAV — green background, white text
   ============================================================ */
.site-header {
  background: var(--fh-green);
  color: #fff;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow);
}
.nav {
  max-width: var(--content-width);
  margin-inline: auto;
  padding: 0.4rem 1rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.brand {
  display: flex; align-items: center; gap: 0.6rem;
  color: #fff; text-decoration: none; font-weight: 700; font-size: 1.05rem;
  margin-right: auto; white-space: nowrap;
}
.brand img { width: 44px; height: auto; }
.brand:hover, .brand:focus-visible { color: var(--fh-gold-bright); text-decoration: underline; text-underline-offset: 3px; }

.nav-toggle {
  display: none;
  background: none; border: 2px solid rgba(255,255,255,0.6); border-radius: 8px;
  color: #fff; padding: 0.45rem 0.6rem; cursor: pointer;
}
.nav-toggle:hover, .nav-toggle:focus-visible { color: var(--fh-gold-bright); border-color: var(--fh-gold-bright); text-decoration: underline; }
.nav-toggle svg { display: block; }

.nav-menu {
  display: flex; align-items: center; gap: 0.15rem;
  list-style: none; margin: 0; padding: 0;
}
.nav-menu > li { position: relative; }
.nav-menu a, .dropdown-btn {
  display: block;
  color: #fff; text-decoration: none;
  font-size: 0.98rem; font-weight: 600;
  padding: 0.55rem 0.65rem;
  background: none; border: 0; cursor: pointer; font-family: inherit;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.nav-menu a:hover, .nav-menu a:focus-visible,
.dropdown-btn:hover, .dropdown-btn:focus-visible {
  color: var(--fh-gold-bright);
  text-decoration: underline;
}
.nav-menu a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--fh-gold-bright); text-decoration-thickness: 3px; }

.dropdown-btn::after { content: " ▾"; font-size: 0.75em; }

/* Dropdown panel: white background, green text */
.dropdown {
  position: absolute; top: 100%; left: 0;
  min-width: 12rem;
  background: var(--paper);
  border: 1px solid var(--line); border-top: 3px solid var(--fh-gold);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 6px 18px rgba(28,36,26,0.18);
  list-style: none; margin: 0; padding: 0.35rem 0;
  z-index: 60;
}
.dropdown[hidden] { display: none; }
.dropdown a {
  color: var(--fh-green); font-weight: 600; padding: 0.45rem 1rem;
}
.dropdown a:hover, .dropdown a:focus-visible {
  color: var(--fh-gold); text-decoration: underline;
}

/* Club Shop button — gold, distinct against the green bar */
.shop-btn, a.shop-btn {
  border: 2px solid var(--fh-gold-bright);
  border-radius: 999px;
  color: var(--fh-gold-bright);
  font-weight: 700;
  padding: 0.4rem 1rem;
  margin-left: 0.35rem;
}
/* Hover: white text (gold-on-green failed contrast); extra
   .nav-menu selector outguns the generic .nav-menu a:hover colour */
.shop-btn:hover, .shop-btn:focus-visible,
.nav-menu a.shop-btn:hover, .nav-menu a.shop-btn:focus-visible {
  color: #fff;
  text-decoration: underline;
}

/* Mobile nav */
@media (max-width: 860px) {
  .nav { flex-wrap: wrap; }
  .nav-toggle { display: block; }
  .nav-menu {
    display: none;
    flex-direction: column; align-items: stretch;
    width: 100%; padding: 0.5rem 0 0.75rem;
  }
  .nav-menu.open { display: flex; }
  .dropdown {
    position: static;
    border: 0; border-left: 3px solid var(--fh-gold);
    border-radius: 0;
    box-shadow: none;
    background: rgba(255,255,255,0.06);
  }
  .dropdown a { color: #fff; }
  .dropdown a:hover, .dropdown a:focus-visible { color: var(--fh-gold-bright); }
  .shop-btn, a.shop-btn { text-align: center; margin: 0.5rem 0.65rem 0; }
}

/* ============================================================
   FOOTER — green background, white text
   ============================================================ */
.site-footer {
  background: var(--fh-green);
  color: #fff;
  margin-top: 3rem;
  padding: 2rem 0 1.5rem;
}
.site-footer .container {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem;
  justify-content: space-between;
}
.footer-social { display: flex; gap: 1rem; }
.footer-social a { color: #fff; display: inline-flex; padding: 0.3rem; }
.footer-social a:hover, .footer-social a:focus-visible { color: var(--fh-gold-bright); }
.footer-social svg { width: 26px; height: 26px; fill: currentColor; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; list-style: none; margin: 0; padding: 0; }
.site-footer a { color: #fff; text-decoration: none; font-weight: 600; text-underline-offset: 3px; }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--fh-gold-bright); text-decoration: underline; }
.footer-copy { width: 100%; font-size: 0.9rem; opacity: 0.9; margin: 0; }

/* ============================================================
   SHARED COMPONENTS
   ============================================================ */
.page-title { margin: 2rem 0 0.5rem; }
.lede { font-size: 1.1rem; color: var(--ink-soft); max-width: 60ch; }

.section { margin: 2.5rem 0; }
.section-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1rem;
  border-bottom: 3px solid var(--fh-gold);
  padding-bottom: 0.4rem; margin-bottom: 1.2rem;
}
.section-head h2 { margin: 0; }
.updated-note { font-size: 0.85rem; color: var(--ink-soft); margin-left: auto; }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--fh-green); color: #fff;
  border: 2px solid var(--fh-green);
  border-radius: 999px;
  font: inherit; font-weight: 700;
  padding: 0.55rem 1.4rem;
  cursor: pointer; text-decoration: none;
  text-underline-offset: 3px;
}
.btn:hover, .btn:focus-visible { color: var(--fh-gold-bright); text-decoration: underline; }
.btn--outline { background: transparent; color: var(--fh-green); }
.btn--outline:hover, .btn--outline:focus-visible { color: var(--fh-gold); text-decoration: underline; }
main a.btn { color: #fff; }
main a.btn:hover, main a.btn:focus-visible { color: var(--fh-gold-bright); text-decoration: underline; }
main a.btn--outline { color: var(--fh-green); }
main a.btn--outline:hover, main a.btn--outline:focus-visible { color: var(--fh-gold); }

/* Filter controls (fixtures / results / team pages) */
.filters {
  display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center;
  background: var(--paper-alt);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.75rem 1rem; margin: 1.25rem 0;
}
.filters label { font-weight: 700; font-size: 0.95rem; }
.filters select {
  font: inherit; color: var(--fh-green); font-weight: 600;
  background: var(--paper);
  border: 2px solid var(--fh-green); border-radius: 8px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}
.filters select:hover { color: var(--fh-gold); text-decoration: underline; }
.filters .filter-field { display: inline-flex; align-items: center; gap: 0.4rem; }
.filters .filter-field[hidden] { display: none; }

/* Tab strip (Matches page): Fixtures | Results (+ Tables later) */
.tab-strip {
  display: flex; gap: 0.25rem;
  border-bottom: 3px solid var(--line);
  margin: 1.5rem 0 0;
}
.tab-strip [role="tab"] {
  font: inherit; font-weight: 700; font-size: 1.05rem;
  background: none; border: 0; cursor: pointer;
  color: var(--fh-green);
  padding: 0.6rem 1.2rem;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
  text-underline-offset: 3px;
}
.tab-strip [role="tab"]:hover, .tab-strip [role="tab"]:focus-visible {
  color: var(--fh-gold); text-decoration: underline;
}
.tab-strip [role="tab"][aria-selected="true"] {
  color: var(--fh-green-dark);
  border-bottom-color: var(--fh-gold);
  background: var(--fh-green-tint);
  border-radius: 6px 6px 0 0;
}

/* Highlighted next-match card (Fixtures tab) */
.next-match-card {
  background: linear-gradient(160deg, var(--fh-green) 0%, var(--fh-green-dark) 100%);
  color: #fff;
  border-radius: var(--radius);
  border-left: 6px solid var(--fh-gold-bright);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
.next-match-card .nm-label {
  color: var(--fh-gold-bright);
  font-size: 0.8rem; font-weight: 800;
  letter-spacing: 0.09em; text-transform: uppercase;
  margin: 0 0 0.35rem;
}
.next-match-card .nm-teams { font-size: clamp(1.15rem, 3vw, 1.5rem); font-weight: 800; margin: 0 0 0.35rem; }
.next-match-card .nm-teams .nm-vs { color: var(--fh-gold-bright); font-weight: 700; padding: 0 0.35rem; }
.next-match-card .nm-meta { margin: 0; opacity: 0.95; }
.next-match-card .nm-comp { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--fh-gold-bright); font-weight: 700; }

/* Full-width match rows grouped under month headings */
.month-group { margin-bottom: 1.75rem; }
.month-group > h3 {
  background: var(--fh-green); color: #fff;
  border-radius: 6px;
  padding: 0.35rem 0.8rem;
  font-size: 1rem;
  margin: 0 0 0.6rem;
}
.match-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.match-row {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1.6fr) minmax(0, 1fr) 5rem;
  gap: 0.35rem 1rem; align-items: center;
  background: var(--paper);
  border: 1px solid var(--line); border-left: 4px solid var(--fh-gold);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
}
.match-row--result { grid-template-columns: 7.5rem minmax(0, 1.6fr) minmax(0, 1fr); }
.match-row .mr-date { font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.match-row .mr-teams {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 0.6rem; align-items: center; min-width: 0;
}
.match-row .mr-team { font-weight: 800; color: var(--fh-green-dark); text-align: right; }
.match-row .mr-opp { font-weight: 600; text-align: left; }
.match-row .mr-vs { color: var(--ink-soft); font-weight: 700; font-size: 0.9rem; }
.match-row .mr-venue { font-size: 0.88rem; color: var(--ink-soft); text-align: right; }
.match-row .mr-time { font-weight: 700; text-align: right; white-space: nowrap; }
.match-row .mr-score { white-space: nowrap; font-weight: 700; font-size: 1.05rem; }
.fh-score {
  background: var(--fh-green); color: #fff;
  border-radius: 6px; padding: 0.05rem 0.45rem;
  font-weight: 800;
}

/* Linked rows (home page): whole row is the anchor */
a.match-row { text-decoration: none; }
main a.match-row { color: inherit; }
a.match-row:hover, a.match-row:focus-visible { border-color: var(--fh-gold); background: var(--paper-alt); }
a.match-row:hover .mr-opp, a.match-row:focus-visible .mr-opp { color: var(--fh-gold); text-decoration: underline; text-underline-offset: 3px; }
.match-row--home { grid-template-columns: 13rem minmax(0, 1.6fr) minmax(0, 1fr) 5rem; }

@media (max-width: 720px) {
  .match-row, .match-row--result, .match-row--home {
    grid-template-columns: 1fr auto;
    grid-template-areas: "date time" "teams teams" "venue venue";
    gap: 0.3rem 0.75rem;
  }
  .match-row .mr-date { grid-area: date; }
  .match-row .mr-time { grid-area: time; }
  .match-row .mr-teams { grid-area: teams; grid-template-columns: auto auto 1fr; justify-content: start; }
  .match-row .mr-team, .match-row .mr-opp { text-align: left; }
  .match-row .mr-venue { grid-area: venue; text-align: left; }
  .match-row--result { grid-template-areas: "date date" "teams teams" "venue venue"; }
}

.empty-note {
  background: var(--paper-alt); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 1.25rem; text-align: center; color: var(--ink-soft);
}
.empty-note .btn { margin-top: 0.75rem; }

/* Card grids */
.card-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card {
  background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.card-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.card--narrow { max-width: 420px; }
.card-body h3 { margin: 0; }
.card .date { font-size: 0.85rem; font-weight: 700; color: var(--fh-gold); text-transform: uppercase; letter-spacing: 0.04em; }
.card img.card-img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }

/* ============================================================
   HOME
   ============================================================ */
.hero {
  background: linear-gradient(160deg, var(--fh-green) 0%, var(--fh-green-dark) 100%);
  color: #fff;
  text-align: center;
  padding: 3rem 1rem 3.5rem;
}
.hero img { width: 150px; margin: 0 auto 1rem; }
.hero h1 { color: #fff; font-size: clamp(1.9rem, 5vw, 2.8rem); margin: 0 0 0.5rem; }
.hero .strap { font-size: 1.15rem; margin: 0 auto; max-width: 38ch; }
.hero .founded {
  display: inline-block; margin-top: 1rem;
  border: 2px solid var(--fh-gold-bright); color: var(--fh-gold-bright);
  border-radius: 999px; padding: 0.25rem 1.1rem; font-weight: 700; letter-spacing: 0.06em;
}

/* Home: next-fixture rows live in #next-fixtures as .match-row--home */

/* Home: one news story per full-width section */
.news-story .section-head {
  flex-direction: column; align-items: flex-start; gap: 0.15rem;
}
.news-story .date {
  font-size: 0.85rem; font-weight: 700; color: var(--fh-gold);
  text-transform: uppercase; letter-spacing: 0.04em; margin: 0;
}
.news-story .card {
  flex-direction: row; align-items: stretch;
}
.news-story .card img.card-img {
  width: 280px; aspect-ratio: auto; object-fit: cover; flex: none;
}
@media (max-width: 720px) {
  .news-story .card { flex-direction: column; }
  .news-story .card img.card-img { width: 100%; aspect-ratio: 16 / 10; }
}

/* Home-only scroll reveal (classes are added by reveal.js, which
   only the home page loads — without JS nothing is ever hidden) */
.reveal-pending { opacity: 0; transform: translateY(18px); }
.reveal-pending.revealed {
  opacity: 1; transform: none;
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .reveal-pending { opacity: 1; transform: none; }
  .reveal-pending.revealed { transition: none; }
}

.follow-link { margin-top: 1.25rem; font-weight: 600; }

/* ============================================================
   TEAM PAGES
   ============================================================ */
.coach-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.coach-card { text-align: center; }
.coach-card img {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top;
  border-radius: var(--radius); border: 1px solid var(--line);
}
.coach-card .name { font-weight: 700; margin-top: 0.5rem; color: var(--fh-green-dark); }
.team-photo img { border-radius: var(--radius); border: 1px solid var(--line); width: 100%; }
.ddyfa-links { font-size: 0.9rem; color: var(--ink-soft); }

/* ============================================================
   OUR STORY / ALUMNI
   ============================================================ */
.story-block { display: grid; gap: 1.5rem 2.5rem; align-items: start; margin: 2rem 0; }
@media (min-width: 760px) {
  .story-block { grid-template-columns: 280px 1fr; }
  .story-block.flip { grid-template-columns: 1fr 280px; }
  .story-block.flip figure { order: 2; }
}
.story-block figure { margin: 0; }
.story-block img { border-radius: var(--radius); border: 1px solid var(--line); width: 100%; }
.story-block figcaption { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.4rem; }
.tribute {
  background: var(--paper-alt);
  border-left: 5px solid var(--fh-gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
}
.tribute h2 { margin-top: 0; }
.press-links { font-size: 0.9rem; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-details {
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin: 1.5rem 0;
}
.contact-details .card-body strong { color: var(--fh-green-dark); }
.placeholder-flag {
  display: inline-block; background: var(--fh-gold); color: #fff;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  border-radius: 4px; padding: 0.1rem 0.45rem; vertical-align: middle;
}
.committee-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.committee-card { text-align: center; }
.committee-card img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--line); background: #d5d9d3;
}
.committee-card .name { font-weight: 700; margin-top: 0.5rem; }
.committee-card .role { font-size: 0.9rem; color: var(--ink-soft); }

/* ============================================================
   SHOP INTERSTITIAL
   ============================================================ */
.shop-panel {
  max-width: 620px; margin: 3rem auto;
  border: 1px solid var(--line); border-top: 5px solid var(--fh-gold);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 2rem;
  text-align: center;
}
.shop-panel h1 { margin-top: 0; }
.shop-panel .actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }

/* ============================================================
   REGISTRATION FORM (screen + A4 print)
   ============================================================ */
.reg-form { max-width: 760px; }
.reg-form .field { margin-bottom: 1.4rem; }
.reg-form .field-label { font-weight: 700; display: block; margin-bottom: 0.4rem; }
.reg-form .write-line {
  border: 0; border-bottom: 2px solid var(--ink);
  height: 2rem; width: 100%;
}
.reg-form .write-line.short { max-width: 220px; }
.reg-form .consent { display: flex; gap: 0.75rem; align-items: flex-start; margin: 1.5rem 0; }
.reg-form .checkbox {
  flex: none; width: 1.3rem; height: 1.3rem;
  border: 2px solid var(--ink); border-radius: 4px; margin-top: 0.2rem;
}
.reg-form .sig-row { display: flex; gap: 2rem; flex-wrap: wrap; }
.reg-form .sig-row .field { flex: 1; min-width: 220px; }
.reg-legal { font-size: 0.85rem; color: var(--ink-soft); }

@media print {
  @page { size: A4; margin: 14mm; }
  body { font-size: 11pt; color: #000; background: #fff; }
  .site-header, .site-footer, .no-print, .skip-link { display: none !important; }
  main { margin: 0; }
  .reg-form { max-width: none; }
  .reg-form .write-line { border-bottom: 1.5px solid #000; }
  h1, h2, h3 { color: #000; }
  .print-crest { display: block !important; width: 70px; margin-bottom: 0.5rem; }
}
.print-crest { display: none; }
