/* =========================================================
   Swansea & District Table Tennis League - stylesheet
   Colour palette (2026-10-06) taken from the league's 2026
   scorecard: navy #003672, deep navy #002455, red #cc0d1b,
   pale blue #e6f4fd. (Originally based on the TT Leagues
   Senior Team Championships site - see "Scorecard theme"
   section at the bottom for the restyle overrides.)
   ========================================================= */

/* Oswald = the bold condensed heading font used on the scorecard */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&display=swap');

:root {
  --navy-dark:   #002455;   /* header, footer (scorecard deep navy) */
  --navy:        #003672;   /* scorecard navy: section bars, table headers */
  --teal:        #003672;   /* kept as a name; now scorecard navy */
  --red:         #cc0d1b;   /* scorecard red: accents, links, buttons */
  --red-dark:    #a30a15;   /* hover state for red */
  --white:       #ffffff;
  --off-white:   #eef6fc;   /* pale scorecard blue page background */
  --pale-blue:   #e6f4fd;   /* scorecard alternate-row blue */
  --text-dark:   #0b1f45;
  --text-muted:  #5b6b82;
  --border:      #cddcec;

  --font-heading: 'Poppins', system-ui, -apple-system, Segoe UI, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  --font-display: 'Oswald', 'Arial Narrow', Impact, sans-serif;

  --radius: 10px;
  --shadow: 0 2px 10px rgba(0, 36, 85, 0.10);
  --transition: 180ms ease;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text-dark);
  background: var(--off-white);
  line-height: 1.55;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

a { color: var(--red); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--red-dark); }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.placeholder {
  background: #fff6e5;
  border: 1px dashed #d9a441;
  color: #7a5a10;
  font-size: 0.85rem;
  padding: 10px 14px;
  border-radius: 8px;
  margin: 10px 0 20px;
}
.placeholder strong { display: inline-block; margin-right: 4px; }

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

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--navy-dark);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo {
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo .logo-mark {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}
.nav-links {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: rgba(255,255,255,0.82);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.25;
  padding: 10px 14px;
  border-radius: 6px;
  height: 100%;
  transition: background var(--transition), color var(--transition);
}
.nav-links a:hover,
.nav-links a:focus {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.nav-links a.active {
  color: #fff;
  background: var(--red);
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 6px 10px;
}

/* ---------- Nav dropdown groups (Competition / Get Involved / About the League) ---------- */
.nav-group { position: relative; }
.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  padding: 10px 14px;
  border-radius: 6px;
  border: none;
  background: none;
  color: rgba(255,255,255,0.82);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.25;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.nav-group-toggle:hover,
.nav-group-toggle:focus {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.nav-group-toggle.active {
  color: #fff;
  background: var(--red);
}
.nav-group-toggle .chevron {
  font-size: 0.65em;
  transition: transform var(--transition);
}
.nav-group:hover .nav-group-toggle .chevron,
.nav-group.open .nav-group-toggle .chevron {
  transform: rotate(180deg);
}
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  margin: 0;
  padding: 12px 6px 6px;
  list-style: none;
  background: var(--navy-dark);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
  z-index: 200;
}
.nav-group:hover .nav-dropdown,
.nav-group.open .nav-dropdown {
  display: block;
}
.nav-dropdown a {
  display: block;
  padding: 10px 14px;
  border-radius: 6px;
  color: rgba(255,255,255,0.82);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}
.nav-dropdown a:hover,
.nav-dropdown a:focus {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.nav-dropdown a.active {
  color: #fff;
  background: var(--red);
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--navy-dark);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 260ms ease;
  }
  .nav-links.open { max-height: 480px; overflow-y: auto; }
  .nav-links a {
    display: block;
    padding: 14px 20px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  /* Groups become accordions on mobile: no hover-open, toggled by tap instead */
  .nav-group { position: static; }
  .nav-group-toggle {
    width: 100%;
    justify-content: space-between;
    padding: 14px 20px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    text-align: left;
  }
  .nav-group:hover .nav-dropdown { display: none; }
  .nav-group.open .nav-dropdown { display: block; }
  .nav-dropdown {
    position: static;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
    background: rgba(0,0,0,0.15);
  }
  .nav-dropdown a {
    padding: 12px 20px 12px 36px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 55%, var(--teal) 130%);
  color: #fff;
  padding: 64px 0 56px;
}
.hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  max-width: 700px;
}
.hero p {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.82);
  max-width: 560px;
}
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 22px; }

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
}
.hero-text { flex: 1 1 380px; }
.hero-graphic {
  flex: 0 0 auto;
  width: 190px;
}
.hero-graphic svg, .hero-graphic img { width: 100%; height: auto; display: block; }
@media (max-width: 700px) {
  .hero-graphic { width: 140px; margin: 0 auto; }
  .hero-inner { justify-content: center; text-align: center; }
  .hero-ctas { justify-content: center; }
  .hero p { margin-left: auto; margin-right: auto; }
}

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
  cursor: pointer;
  border: none;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); color: #fff; transform: translateY(-1px); }
.btn-outline { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.5); }
.btn-outline:hover { background: rgba(255,255,255,0.1); color: #fff; border-color: #fff; }

/* ---------- Section header bar (styled after the reference site) ---------- */
.section-bar {
  background: var(--teal);
  color: #fff;
  padding: 14px 20px;
  border-left: 6px solid var(--red);
  border-radius: 6px 6px 0 0;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.02rem;
}
.section-body {
  background: #fff;
  border-radius: 0 0 6px 6px;
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 34px;
}

/* top/bottom only, so .container's 20px side padding still applies (keeps a gap at the screen edges on phones) */
section.page-section { padding-top: 46px; padding-bottom: 46px; }
section.page-section h2 {
  font-size: 1.5rem;
  margin-bottom: 22px;
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  border-top: 4px solid var(--red);
}
.card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.card p { color: var(--text-muted); font-size: 0.92rem; margin: 0; }
.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card-link:hover,
.card-link:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(15, 28, 46, 0.15);
}
.card-link h3 { color: var(--navy-dark); }
.card-link h3::after {
  content: "\2192";
  margin-left: 6px;
  color: var(--red);
}
@media (prefers-reduced-motion: reduce) {
  .card-link { transition: none; }
  .card-link:hover, .card-link:focus-visible { transform: none; }
}

/* ---------- Tables ---------- */
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
table.data-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  padding: 10px 8px;
  border-bottom: 2px solid var(--border);
}
table.data-table td {
  padding: 11px 8px;
  border-bottom: 1px solid var(--border);
}
table.data-table tr:last-child td { border-bottom: none; }

.division-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.division-tabs button {
  background: #fff;
  border: 1.5px solid var(--border);
  padding: 9px 18px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--text-dark);
  transition: all var(--transition);
}
.division-tabs button.active {
  background: var(--navy-dark);
  color: #fff;
  border-color: var(--navy-dark);
}
.division-panel { display: none; }
.division-panel.active { display: block; }

.division-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text-dark);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  margin-bottom: 16px;
}
.division-select:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}

/* ---------- Fade-in-on-scroll ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 520ms ease, transform 520ms ease;
}
.fade-in.in-view { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-in { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Info / contact blocks ---------- */
.info-block {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
  border-left: 5px solid var(--teal);
}
.info-block.safeguard { border-left-color: var(--red); }
.contact-card {
  background: var(--navy-dark);
  color: #fff;
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
}
.contact-card a { color: #fff; text-decoration: underline; }
.contact-card h3 { color: #fff; }
.contact-card-inner { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.contact-photo { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 3px solid rgba(255,255,255,0.25); }
.contact-card-inner .contact-text-col { flex: 1; min-width: 200px; }
.contact-card-inner .contact-text-col h3 { margin: 0 0 6px; }
.contact-card-inner .contact-text { margin: 0; }

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.person-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  text-align: left;
}
.person-card .role { color: var(--red); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.4px; }
.person-card h3 { margin: 4px 0 4px; font-size: 1.05rem; }
.person-card p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.75);
  padding: 46px 0 20px;
  margin-top: 60px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 30px;
  padding-bottom: 26px;
}
.footer-logo { width: 120px; height: 120px; object-fit: contain; display: block; margin-bottom: 16px; }
.footer-grid h4 { color: #fff; font-size: 0.95rem; margin-bottom: 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.footer-grid a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 18px;
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: rgba(255,255,255,0.5);
}

@media (max-width: 600px) {
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* ---------- Previous Winners page ---------- */
.winners-intro { max-width: 760px; }
.winners-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 30px;
}
.winners-jump a {
  background: #fff;
  border: 1.5px solid var(--border);
  padding: 8px 16px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-dark);
  transition: all var(--transition);
}
.winners-jump a:hover {
  background: var(--navy-dark);
  color: #fff;
  border-color: var(--navy-dark);
}
.winners-block { scroll-margin-top: 88px; margin: 0 0 34px; max-width: 620px; }

/* ---------- Winners boxes side by side, equal size, scrollable content ---------- */
.winners-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 24px;
}
.winners-grid .winners-block {
  flex: 0 1 330px;   /* 3 x 330 + 2 x 24 gap = 1038px, fits the 1060px content width */
  margin: 0;
  height: 560px;
  display: flex;
  flex-direction: column;
}
.winners-grid .winners-block .section-bar {
  flex: 0 0 auto;
}
.winners-grid .section-body {
  margin-bottom: 0;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.winners-grid .section-body.scrollable {
  overflow-y: auto;
}
.winners-grid .section-body .tab-group {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.winners-grid .division-tabs,
.winners-grid .division-select {
  flex: 0 0 auto;
}
.winners-grid .division-panel.active {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
@media (max-width: 700px) {
  .winners-grid .winners-block { flex: 1 1 100%; height: 480px; }
}

.winners-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 10px 0 0;
}

/* ---------- Clubs & Venues page ---------- */
.club-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.club-card p { margin-bottom: 12px; }
.club-map {
  width: 100%;
  height: 160px;
  border: none;
  border-radius: 8px;
  display: block;
}

/* =========================================================
   Scorecard theme (2026-10-06) - restyle to match the
   league's 2026 scorecard. Overrides rules above.
   ========================================================= */

/* Red / white / navy ribbon, echoing the scorecard swooshes */
.site-header { box-shadow: none; }
.site-header::after,
.site-footer::before {
  content: "";
  display: block;
  height: 7px;
  background: linear-gradient(to bottom, var(--red) 0 4px, #fff 4px 5px, var(--navy) 5px 7px);
}
.site-header::after { position: absolute; left: 0; right: 0; top: 100%; }
.site-footer { position: relative; padding-top: 52px; }
.site-footer::before { position: absolute; left: 0; right: 0; top: 0;
  background: linear-gradient(to bottom, var(--navy) 0 2px, #fff 2px 3px, var(--red) 3px 7px); }

.logo { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem;
  text-transform: uppercase; letter-spacing: 0.5px; }

/* ---------- Hero: light, like the top of the scorecard ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #f4faff 0%, #e3f1fc 100%);
  color: var(--navy-dark);
  padding: 72px 0 110px;
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  width: 760px; height: 150px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 220' preserveAspectRatio='none'%3E%3Cpath d='M0 145 C300 200 600 216 900 220 L0 220Z' fill='%23cc0d1b'/%3E%3Cpath d='M0 128 C300 188 600 212 900 220 C600 216 300 200 0 145Z' fill='%23ffffff'/%3E%3Cpath d='M0 55 C300 160 600 205 900 220 C600 212 300 188 0 128Z' fill='%23002455'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
  pointer-events: none;
}
.hero::before { left: 0; bottom: 0; }
.hero::after  { right: 0; top: 0; transform: rotate(180deg); }
@media (max-width: 700px) {
  .hero::before, .hero::after { width: 300px; height: 60px; }
}
.hero .container { position: relative; z-index: 1; }
.hero h1 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.05;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
}
.hero h1 .l1 { display: block; color: var(--navy-dark); }
.hero h1 .l2 { display: block; color: var(--red); }
.hero p { color: #2c3f60; }
.hero .tagline { display: inline-block; margin: 2px 0 16px; padding: 0 0 6px;
  border-bottom: 2px solid var(--red); color: var(--navy); font-weight: 600; font-size: 0.98rem; }
.btn-outline { color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.hero-graphic { width: 210px; }

/* ---------- Headings & section bars ---------- */
section.page-section h2 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--navy-dark);
  font-size: 1.75rem;
}
section.page-section h2::after {
  content: "";
  display: block;
  width: 56px; height: 4px;
  margin-top: 8px;
  background: var(--red);
  border-radius: 2px;
}
.section-bar {
  background: var(--navy);
  border-left: none;
  border-bottom: 3px solid var(--red);
  border-radius: 8px 8px 0 0;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-size: 1.1rem;
}
.section-body { border: 1px solid var(--border); border-top: none; border-radius: 0 0 8px 8px; }

/* ---------- Buttons: like the red "Score Card" pill ---------- */
.btn { border-radius: 8px; font-family: 'Poppins', var(--font-body); }
.btn-primary { box-shadow: 0 2px 0 var(--red-dark); }

/* ---------- Tables: navy header row + pale blue striping ---------- */
table.data-table { border: 1px solid var(--border); }
table.data-table th {
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  border-bottom: none;
  padding: 10px 10px;
}
table.data-table td { padding: 10px 10px; border-bottom: 1px solid var(--border); }
table.data-table tbody tr:nth-child(even) td { background: var(--pale-blue); }

.division-select { border-color: var(--navy); color: var(--navy-dark); }
.division-tabs button.active { background: var(--navy); border-color: var(--navy); }

/* ---------- Cards / blocks ---------- */
.card { border-top-color: var(--red); border: 1px solid var(--border); border-top: 4px solid var(--red); }
.card h3, .card-link h3, .person-card h3, .info-block h3 { color: var(--navy-dark); }
.info-block { border-left-color: var(--navy); border: 1px solid var(--border); border-left: 5px solid var(--navy); }
.info-block.safeguard { border-left-color: var(--red); }
.contact-card { background: var(--navy); border-bottom: 4px solid var(--red); }
.person-card { border: 1px solid var(--border); }

@media (max-width: 860px) {
  .logo { font-size: 1rem; letter-spacing: 0.3px; }
}
