/* ═══════════════════════════════════════════
   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: space-between;
  padding: 0 4%;
  height: 70px;
}
.logo-link { display: flex; align-items: center; gap: 12px; }
.logo-img { height: 44px; width: 44px; 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); }

/* ═══════════════════════════════════════════
   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;
  min-width: 640px;
}
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); }

/* 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%; }
  .site-title { font-size: 0.95rem; }
}
