/* ============================================================
   Rugeley Rugby Club — shared stylesheet
   Design tokens
   ============================================================ */

:root {
  --green:        #006A4E;
  --green-dark:   #004F3A;
  --green-deep:   #00332A;
  --gold:         #F9B233;
  --gold-deep:    #DE9A17;
  --cream:        #F5F1E4;
  --cream-dim:    #ECE5D0;
  --ink:          #23291A;
  --ink-soft:     #52573F;
  --line:         #CCC2A0;
  --line-on-green: rgba(245, 241, 228, 0.22);
  --max: 1180px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Karla", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

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

h1, h2, h3, h4 {
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-weight: 700;
  line-height: 1.02;
  margin: 0;
  letter-spacing: 0.2px;
}

h1 { font-size: clamp(44px, 7vw, 84px); font-weight: 800; }
h2 { font-size: clamp(32px, 4.4vw, 52px); }
h3 { font-size: clamp(22px, 2.6vw, 28px); font-weight: 700; }

p { max-width: 62ch; }
p.lead { font-size: 20px; color: var(--ink-soft); max-width: 54ch; }

.eyebrow {
  display: inline-block;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--green);
  border-bottom: 2px solid var(--gold);
  padding-bottom: 4px;
  margin-bottom: 18px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.3px;
  padding: 12px 26px;
  border-radius: 3px;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
}

.btn-gold {
  background: var(--gold);
  color: var(--green-deep);
}
.btn-gold:hover { background: var(--gold-deep); }

.btn-outline {
  background: transparent;
  border-color: var(--green);
  color: var(--green);
}
.btn-outline:hover { background: var(--green); color: var(--cream); }

.btn-outline-light {
  background: transparent;
  border-color: var(--line-on-green);
  color: var(--cream);
}
.btn-outline-light:hover { background: var(--line-on-green); }

/* ---------- Header / nav ---------- */

.site-header {
  background: var(--green);
  color: var(--cream);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 3px solid var(--gold);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--cream);
}
.brand img { height: 46px; width: auto; }
.brand-word {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.4px;
  line-height: 1;
}
.brand-word span {
  display: block;
  font-family: "Karla", sans-serif;
  font-weight: 400;
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 1px;
  margin-top: 2px;
}

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

nav.main-nav a,
.nav-dropdown > summary {
  text-decoration: none;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--cream);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
nav.main-nav a:hover,
nav.main-nav a.active,
.nav-dropdown > summary:hover,
.nav-dropdown > summary.active {
  border-bottom-color: var(--gold);
}

.nav-cta {
  margin-left: 6px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--cream);
  font-size: 30px;
  cursor: pointer;
}

@media (max-width: 900px) {
  .menu-toggle { display: block; }
  nav.main-nav {
    position: absolute;
    top: 78px;
    left: 0;
    right: 0;
    background: var(--green);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    border-bottom: 3px solid var(--gold);
  }
  nav.main-nav.open { max-height: 80vh; overflow-y: auto; }
  nav.main-nav a,
  .nav-dropdown > summary {
    width: 100%;
    padding: 14px 28px;
    border-bottom: 1px solid var(--line-on-green);
  }
  .nav-cta { margin: 14px 28px 20px; }
}

/* ---------- Hero ---------- */

.hero {
  background: var(--green);
  color: var(--cream);
  position: relative;
  overflow: hidden;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
  padding-top: 76px;
  padding-bottom: 76px;
}
.hero h1 { color: var(--cream); }
.hero h1 em {
  font-style: normal;
  color: var(--gold);
}
.hero p.lead { color: #DCE0C9; margin-top: 18px; }
.hero-actions {
  margin-top: 34px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.hero-crest { display: flex; justify-content: center; }
.hero-crest img { width: 100%; max-width: 320px; }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; padding-top: 48px; padding-bottom: 40px; }
  .hero-crest { order: -1; }
  .hero-crest img { max-width: 180px; }
}

/* ---------- Sections ---------- */

section { padding: 74px 0; }
section.dim { background: var(--cream-dim); }
section.on-green { background: var(--green); color: var(--cream); }
section.on-green h2, section.on-green h3 { color: var(--cream); }
section.on-green .eyebrow { color: var(--gold); border-bottom-color: var(--gold); }
section.on-green p { color: #DCE0C9; }

.section-head {
  max-width: 640px;
  margin-bottom: 44px;
}

hr.rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* ---------- Grids / blocks ---------- */

.grid {
  display: grid;
  gap: 32px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.block {
  border-top: 3px solid var(--gold);
  padding-top: 20px;
}
.block h3 { margin-bottom: 10px; }
.block p { color: var(--ink-soft); }

.card {
  border: 1px solid var(--line);
  background: var(--cream);
  padding: 28px;
}
.card h3 { margin-bottom: 10px; }
.card p { color: var(--ink-soft); margin-bottom: 0; }

/* ---------- Tables (subs / winners) ---------- */

table.data {
  width: 100%;
  border-collapse: collapse;
  font-family: "Karla", sans-serif;
}
table.data th, table.data td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
table.data th {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 15px;
  letter-spacing: 0.3px;
  color: var(--green);
  border-bottom: 2px solid var(--green);
}
table.data tbody tr:hover { background: rgba(67, 80, 39, 0.05); }

/* ---------- Callout / banner ---------- */

.callout {
  background: var(--green);
  color: var(--cream);
  padding: 48px;
  display: grid;
  grid-template-columns: 1.3fr auto;
  gap: 28px;
  align-items: center;
}
.callout h3 { color: var(--gold); margin-bottom: 8px; }
.callout p { color: #DCE0C9; margin-bottom: 0; }
@media (max-width: 760px) {
  .callout { grid-template-columns: 1fr; text-align: left; padding: 34px; }
}

/* ---------- Placeholder notes (visible to Sam, not end users to obsess over — but left visible & styled clearly for now) ---------- */

.to-fill {
  border: 1px dashed var(--gold-deep);
  background: rgba(249, 178, 51, 0.09);
  padding: 16px 20px;
  font-size: 15px;
  color: var(--ink-soft);
  margin: 18px 0;
}
.to-fill strong { color: var(--green-dark); }

/* ---------- Footer ---------- */

footer.site-footer {
  background: var(--green-deep);
  color: #C9CFB6;
  padding: 56px 0 30px;
}
footer.site-footer .wrap {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
}
footer.site-footer h4 {
  color: var(--cream);
  font-size: 18px;
  margin-bottom: 14px;
}
footer.site-footer a {
  display: block;
  text-decoration: none;
  color: #C9CFB6;
  font-size: 15px;
  padding: 5px 0;
}
footer.site-footer a:hover { color: var(--gold); }
footer.site-footer img { height: 40px; margin-bottom: 14px; }
.footer-bottom {
  max-width: var(--max);
  margin: 40px auto 0;
  padding: 20px 28px 0;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 13px;
  color: #8D9578;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
@media (max-width: 760px) {
  footer.site-footer .wrap { grid-template-columns: 1fr 1fr; }
}

/* ---------- Page header (non-home pages) ---------- */

.page-head {
  background: var(--green);
  color: var(--cream);
  padding: 56px 0 48px;
}
.page-head h1 { color: var(--cream); font-size: clamp(40px, 6vw, 60px); }
.page-head p.lead { color: #DCE0C9; margin-top: 12px; }

/* ---------- Auth forms ---------- */

.auth-card {
  border: 1px solid var(--line);
  background: var(--cream);
  padding: 36px;
  max-width: 440px;
}

.auth-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
}
.auth-tab {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 19px;
  background: none;
  border: none;
  padding: 8px 4px 12px;
  margin-right: 22px;
  color: var(--ink-soft);
  border-bottom: 3px solid transparent;
  cursor: pointer;
}
.auth-tab.active {
  color: var(--green);
  border-bottom-color: var(--gold);
}

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--green-dark);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: "Karla", sans-serif;
  font-size: 16px;
  color: var(--ink);
  border-radius: 2px;
}
.field input:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.form-msg {
  font-size: 15px;
  padding: 12px 14px;
  border-radius: 2px;
  margin-bottom: 18px;
  display: none;
}
.form-msg.show { display: block; }
.form-msg.error { background: rgba(178, 46, 46, 0.09); color: #8A2A2A; border: 1px solid rgba(178,46,46,0.25); }
.form-msg.success { background: rgba(67, 80, 39, 0.09); color: var(--green-dark); border: 1px solid rgba(67,80,39,0.25); }

.auth-form { display: none; }
.auth-form.active { display: block; }

.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.status-row:last-child { border-bottom: none; }
.status-label { font-family:"Barlow Condensed", sans-serif; font-weight:700; font-size:17px; color: var(--green-dark); }
.status-pill {
  font-family:"Barlow Condensed", sans-serif;
  font-weight:700;
  font-size:14px;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--cream-dim);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}

/* ---------- Sponsor cards ---------- */

.sponsor-card {
  border: 1px solid var(--line);
  background: var(--cream);
  padding: 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.sponsor-card.on-green {
  border-color: var(--line-on-green);
  background: transparent;
}
.sponsor-card img {
  max-height: 56px;
  max-width: 100%;
  margin: 0 auto 18px;
}
.sponsor-card .logo-panel {
  background: #3C9BB0;
  padding: 18px 24px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sponsor-card .logo-panel img { margin-bottom: 0; max-height: 40px; }
.sponsor-card h3 { margin-bottom: 8px; }
.sponsor-card p { font-size: 15px; margin-bottom: 14px; flex-grow: 1; }
.sponsor-card a.visit-link {
  margin-top: auto;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--gold);
  text-decoration: none;
}
.sponsor-card.light a.visit-link { color: var(--green); }
.sponsor-card a.visit-link:hover { text-decoration: underline; }

.sponsor-card-sm {
  border-top: 3px solid var(--line);
  padding-top: 16px;
}
.sponsor-card-sm img {
  max-height: 44px;
  max-width: 100%;
  margin-bottom: 12px;
}
.sponsor-card-sm h4 {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 19px;
  margin-bottom: 4px;
}
.sponsor-card-sm p { font-size: 14px; color: var(--ink-soft); margin-bottom: 8px; }
.sponsor-card-sm a {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--green);
  text-decoration: none;
}
.sponsor-card-sm a:hover { color: var(--gold-deep); }

.touchline-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.touchline-icon svg { width: 38px; height: 38px; }

/* ---------- Coaches nav dropdown ---------- */

.nav-dropdown {
  position: relative;
  display: inline-block;
}
.nav-dropdown > summary {
  list-style: none;
  cursor: pointer;
}
.nav-dropdown > summary::-webkit-details-marker { display: none; }
.nav-dropdown > summary::marker { content: ""; }
.nav-dropdown > summary::after {
  content: "▾";
  display: inline-block;
  margin-left: 6px;
  font-size: 13px;
  transition: transform 0.15s ease;
}
.nav-dropdown[open] > summary::after {
  transform: rotate(180deg);
}
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--green);
  border: 1px solid var(--gold);
  min-width: 200px;
  z-index: 60;
  padding: 4px 0;
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown[open] .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: block;
  padding: 10px 18px;
  color: var(--cream);
  text-decoration: none;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 600;
  font-size: 16px;
}
.nav-dropdown-menu a:hover { background: rgba(0,0,0,0.18); }

@media (max-width: 900px) {
  /* Hover doesn't apply on touch — the native <details>/<summary> tap-to-
     open behaviour handles it instead. Dropdowns also switch from an
     overlay to flowing inline in the stacked mobile nav — an absolutely-
     positioned overlay gets clipped by the nav's own overflow:hidden
     container. */
  .nav-dropdown:hover .nav-dropdown-menu { display: none; }
  .nav-dropdown-menu {
    position: static;
    border: none;
    border-top: 1px solid var(--line-on-green);
    border-bottom: 1px solid var(--line-on-green);
    background: rgba(0,0,0,0.12);
    min-width: 0;
  }
  .nav-dropdown-menu a { padding-left: 44px; }
  nav.main-nav .nav-dropdown-menu a { padding-left: 44px; background: rgba(0,0,0,0.1); }
  .nav-dropdown { display: block; width: 100%; }
}

/* ---------- Admin: per-section blocks ---------- */

.section-block {
  border-top: 3px solid var(--gold);
  padding-top: 24px;
  margin-bottom: 48px;
  scroll-margin-top: 100px;
}
.section-block-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.section-counts {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 15px;
  color: var(--ink-soft);
}
.section-counts strong { color: var(--green-dark); }
.show-cancelled-link {
  display: inline-block;
  margin-top: 14px;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--green);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.show-cancelled-link:hover { color: var(--gold-deep); }

/* ---------- Sub-nav (used on the combined Club page) ---------- */

.subnav {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 8px;
}
.subnav a {
  text-decoration: none;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--green);
}
.subnav a:hover { color: var(--gold-deep); }
