/* ═══════════════════════════════════════════
   CHURCHTOWN BADMINTON CLUB
   Shared Stylesheet
   ═══════════════════════════════════════════ */

/* ── CSS Custom Properties ── */
:root {
  --green-dark:    #1a5c38;
  --green-mid:     #2d7a4f;
  --green-light:   #d4edda;
  --green-accent:  #28a745;
  --grey-dark:     #2c3e50;
  --grey-mid:      #6c757d;
  --grey-light:    #e9ecef;
  --white:         #ffffff;
  --off-white:     #f8f9fa;
  --shadow-card:   0 4px 12px rgba(0,0,0,0.08);
  --shadow-hover:  0 8px 24px rgba(0,0,0,0.14);
  --radius:        8px;
  --transition:    0.2s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--grey-dark);
  background: var(--off-white);
}

/* ── Typography ── */
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; line-height: 1.2; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.1rem; font-weight: 600; }
a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.container { width: 92%; max-width: 1100px; margin: 0 auto; }

/* ── Skip Link ── */
.skip-link {
  position: absolute; top: -999px; left: 0;
  background: var(--green-dark); color: white;
  padding: .5rem 1rem; z-index: 9999;
}
.skip-link:focus { top: 0; }

/* ═══════════════════════════════════════════
   HEADER & NAV
   ═══════════════════════════════════════════ */
.site-header {
  background: var(--green-dark);
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4%;
  height: 70px;
}
.logo-link { display: none; }
.logo-img { height: 80px; width: 80px; object-fit: contain; }
.site-title {
  color: var(--white);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

/* Desktop nav */
.main-nav ul {
  display: flex; list-style: none; gap: 4px;
  flex-wrap: wrap; justify-content: flex-end;
}
.main-nav a {
  color: var(--white);
  padding: 8px 13px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: background var(--transition);
}
.main-nav a:hover { background: rgba(255,255,255,.14); text-decoration: none; }
.main-nav a.active { background: rgba(255,255,255,.18); }

/* Hamburger */
.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block; width: 26px; height: 3px;
  background: var(--white); border-radius: 3px;
  margin: 5px 0; transition: var(--transition);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* ═══════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════ */
.hero {
  background: linear-gradient(135deg, var(--green-dark) 0%, #0e3a22 100%);
  color: var(--white);
  text-align: center;
  padding: 4rem 1.5rem 3.5rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Ccircle cx='30' cy='30' r='1.5' fill='rgba(255,255,255,0.06)'/%3E%3C/svg%3E");
  pointer-events: none;
}
.hero h1 { margin-bottom: .75rem; text-shadow: 0 2px 8px rgba(0,0,0,.3); }
.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  opacity: .88;
  margin-bottom: 2rem;
  max-width: 600px; margin-left: auto; margin-right: auto;
}
.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 11px 24px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer; border: none;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); text-decoration: none; }
.btn-primary { background: var(--green-accent); color: var(--white); }
.btn-secondary { background: rgba(255,255,255,.15); color: var(--white); border: 2px solid rgba(255,255,255,.4); }
.btn-secondary:hover { background: rgba(255,255,255,.25); }

/* Page title with logo */
.page-title-wrapper {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.page-title-wrapper img {
  height: 85px;
  width: 85px;
  object-fit: contain;
  flex-shrink: 0;
}
.page-title-wrapper h1 {
  margin: 0;
}

/* ═══════════════════════════════════════════
   SECTIONS
   ═══════════════════════════════════════════ */
section { padding: 3rem 0; }
section.alt { background: var(--white); }
section h2 {
  text-align: center;
  color: var(--green-dark);
  margin-bottom: .5rem;
}
.section-sub {
  text-align: center;
  color: var(--grey-mid);
  margin-bottom: 2.5rem;
  font-size: 0.95rem;
}

/* ═══════════════════════════════════════════
   CARDS GRID
   ═══════════════════════════════════════════ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.card {
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card h3 { color: var(--green-dark); margin-bottom: .4rem; }
.card p { font-size: 0.92rem; color: var(--grey-mid); }
.card-link {
  display: inline-block;
  margin-top: .75rem;
  color: var(--green-accent);
  font-weight: 600;
  font-size: 0.9rem;
}

/* ═══════════════════════════════════════════
   FIXTURE TABLE (Core component)
   ═══════════════════════════════════════════ */
.fixture-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  margin: 1.5rem 0;
}
table.fixtures {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  font-size: 0.92rem;
}
table.fixtures thead tr {
  background: var(--green-dark);
  color: var(--white);
}
table.fixtures th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 0.82rem;
  text-transform: uppercase;
}
table.fixtures tbody tr:nth-child(even) { background: var(--green-light); }
table.fixtures tbody tr:hover { background: #c3e6cb; }
table.fixtures td { padding: 11px 16px; border-bottom: 1px solid var(--grey-light); color: var(--grey-dark); }

/* Fixture status badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-future { background: #dbeafe; color: #1e40af; }
.badge-played { background: var(--grey-light); color: var(--grey-mid); }
.badge-win    { background: #d4edda; color: #155724; }
.badge-loss   { background: #fce4d6; color: #7a2e0b; }
.badge-draw   { background: #fff3cd; color: #7a5c00; }

/* ═══════════════════════════════════════════
   IFRAME SPREADSHEET WRAPPER
   ═══════════════════════════════════════════ */
.spreadsheet-wrap {
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 12px;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-card);
}
.spreadsheet-wrap iframe {
  width: 100%;
  height: 780px;
  border: none;
  border-radius: 4px;
  display: block;
}
.ss-label {
  font-size: 0.8rem;
  color: var(--grey-mid);
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.ss-label::before {
  content: '📊';
  font-size: 1rem;
}

/* ═══════════════════════════════════════════
   CONTACT PAGE
   ═══════════════════════════════════════════ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}
.contact-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  border: 2px solid var(--green-light);
}
.contact-card .icon { font-size: 2rem; margin-bottom: .5rem; }
.contact-card h3 { color: var(--green-dark); }
.contact-card p { font-size: 0.93rem; color: var(--grey-mid); }

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */
footer {
  background: var(--grey-dark);
  color: rgba(255,255,255,.7);
  padding: 2rem 0;
  font-size: 0.88rem;
}
.footer-inner {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  align-items: center;
}
.footer-inner a { color: rgba(255,255,255,.85); }
.footer-inner a:hover { color: var(--white); }
.social-links { display: flex; gap: 14px; }
.social-links a { font-size: 1.3rem; }
.footer-brand { color: var(--white); font-weight: 700; }

/* ═══════════════════════════════════════════
   PAGE BREADCRUMB / TITLE BAR
   ═══════════════════════════════════════════ */
.page-head {
  background: var(--green-mid);
  color: var(--white);
  padding: 2rem 0;
}
.page-head h1 { margin-bottom: .25rem; }
.page-head .breadcrumb {
  font-size: 0.85rem;
  opacity: .8;
}
.page-head .breadcrumb a { color: rgba(255,255,255,.8); }

/* ═══════════════════════════════════════════
   HOME - Quick links strip
   ═══════════════════════════════════════════ */
.team-strip {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center;
  padding: 1rem 0;
}
.team-pill {
  background: var(--green-light);
  color: var(--green-dark);
  padding: 8px 18px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.88rem;
  border: 2px solid var(--green-dark);
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  text-decoration: none;
}
.team-pill:hover {
  background: var(--green-dark);
  color: var(--white);
  text-decoration: none;
}

/* ═══════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════ */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

/* ── Mobile Nav ── */
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute;
    top: 70px; left: 0; right: 0;
    background: var(--green-dark);
    border-top: 1px solid rgba(255,255,255,.15);
    padding: 0 4%;
    max-height: 0; overflow: hidden;
    transition: max-height .3s ease, padding .3s ease;
  }
  .main-nav.open { max-height: 500px; padding: .75rem 4% 1rem; }
  .main-nav ul { flex-direction: column; }
  .main-nav a { padding: 10px 0; display: block; border-bottom: 1px solid rgba(255,255,255,.1); }
  .hero { padding: 2.5rem 1rem 2rem; }
}
@media (max-width: 480px) {
  .hero-btns { flex-direction: column; align-items: center; }
  .btn { width: 100%; text-align: center; }
  .header-inner { flex-wrap: wrap; height: auto; padding: .75rem 4%; }
  /* Phone: show the team buttons across the top (no menu button) */
  .nav-toggle { display: none; }
  .main-nav { position: static; max-height: none; overflow: visible; padding: 0; width: 100%; background: none; border-top: none; transition: none; }
  .main-nav ul { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 4px; }
  .main-nav a { display: inline-block; padding: 6px 9px; border-bottom: none; font-size: 0.78rem; }
  .site-title { font-size: 0.95rem; }
  
  /* Mobile table: show all columns, shrink where needed */
  table.fixtures { font-size: 0.75rem; }
  table.fixtures th, table.fixtures td { padding: 6px 4px; text-align: left; }
  /* column widths: see the phone block below */
  .fixture-table-wrap { overflow-x: auto; border-radius: 0; margin: 1rem -4%; }
}

/* Match Week and Venue column adjustments */
table.fixtures th:nth-child(2),
table.fixtures td:nth-child(2) {
  width: 12%;
  white-space: normal;
  word-break: break-word;
}
table.fixtures th:nth-child(4),
table.fixtures td:nth-child(4) {
  width: 4%;
}
table.fixtures th:nth-child(6),
table.fixtures td:nth-child(6) {
  width: 22%;
}

/* Phone: small text, fixed column widths sized to their contents; Venue takes the remaining width */
@media (max-width: 480px) {
  .fixture-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.fixtures { table-layout: fixed; width: 100%; font-size: 0.5rem; }
  table.fixtures th, table.fixtures td { padding: 3px 1px; text-align: left; white-space: normal; word-break: normal; line-height: 1.2; }
  table.fixtures th { font-size: 0.45rem; letter-spacing: 0; }

  table.fixtures th:nth-child(1), table.fixtures td:nth-child(1) { width: 50px; white-space: nowrap; }  /* WC */
  table.fixtures th:nth-child(2), table.fixtures td:nth-child(2) { width: 60px; }                       /* Match Week (wraps) */
  table.fixtures th:nth-child(3), table.fixtures td:nth-child(3) { width: 50px; white-space: normal; }  /* Match Date */
  table.fixtures th:nth-child(4), table.fixtures td:nth-child(4) { width: 28px; white-space: nowrap; }  /* H/A */
  table.fixtures th:nth-child(5), table.fixtures td:nth-child(5) { width: 50px; }                       /* Opposition (wraps) */
  table.fixtures th:nth-child(6), table.fixtures td:nth-child(6) { width: auto; }                       /* Venue (takes the rest) */
  table.fixtures th:nth-child(7), table.fixtures td:nth-child(7) { width: 28px; white-space: nowrap; }  /* Time */
  table.fixtures th:nth-child(8), table.fixtures td:nth-child(8) { width: 32px; white-space: nowrap; }  /* Result */
}

/* Result dots (win / loss / draw) */
td.result .dot { display: inline-block; width: 0.6em; height: 0.6em; border-radius: 50%; margin-left: 4px; vertical-align: middle; }
td.result .dot.win { background: #2e7d32; }
td.result .dot.loss { background: #c62828; }
td.result .dot.draw { background: #9e9e9e; }

/* League table (top of team pages) */
.league-table {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1rem 1rem 0.75rem;
  margin: 0 0 1.75rem;
  overflow-x: auto;
}
.league-table h3 {
  margin: 0 0 .75rem;
  color: var(--green-dark);
  font-size: 1.05rem;
  border-left: 4px solid var(--green-accent);
  padding-left: .6rem;
}
.league-table-tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.85rem; }
.league-table-tbl thead th {
  background: var(--green-dark);
  color: var(--white);
  padding: 8px 6px;
  text-align: center;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: .02em;
}
.league-table-tbl thead th:first-child { border-top-left-radius: 6px; }
.league-table-tbl thead th:last-child { border-top-right-radius: 6px; }
.league-table-tbl td {
  padding: 7px 6px;
  text-align: center;
  color: var(--grey-dark);
  border-bottom: 1px solid var(--grey-light);
}
.league-table-tbl th:nth-child(2), .league-table-tbl td:nth-child(2) { text-align: left; }
.league-table-tbl td:last-child { font-weight: 700; color: var(--green-dark); }
.league-table-tbl tbody tr:nth-child(even) { background: var(--off-white); }
.league-table-tbl tbody tr:hover { background: var(--green-light); }
.league-table-tbl tr.club-row td { background: var(--green-light); font-weight: 700; color: var(--green-dark); }
.league-table-tbl tr.club-row td:first-child { box-shadow: inset 4px 0 0 var(--green-accent); }
.league-table-note { font-size: 0.7rem; color: var(--grey-mid); margin: .5rem 0 0; }
@media (max-width: 480px) {
  .league-table { padding: .75rem .5rem .5rem; }
  .league-table-tbl { font-size: 0.75rem; }
  .league-table-tbl th, .league-table-tbl td { padding: 5px 3px; }
  .league-table-tbl thead th { font-size: 0.68rem; }
}

/* Captain box (top of team pages) */
.captain-box {
  display: table;
  margin: 0 auto 1.25rem;
  background: #c3e6cb;
  border-radius: 999px;
  padding: 0.3rem 1.1rem;
  text-align: center;
}
.captain-box p { margin: 0; font-size: .92rem; color: var(--grey-dark); }
