/* Pete 2026-06-09 (onb-phase-2-5): shared CSS for the public ONB
   pages (event.html, club.html, events.html). Mirrors the brand
   palette of the main TallyTracker site (index.html) so the
   colour-and-typography world stays consistent — the only thing
   each page changes per-club is the `--club-primary` CSS variable
   which we inject at runtime from the club's branding doc. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:        #0a2540;
  --ink-soft:   #475569;
  --ink-quiet:  #94a3b8;
  --line:       #e2e8f0;
  --paper:      #ffffff;
  --paper-2:    #f8fafc;
  --paper-3:    #f1f5f9;
  --teal:       #0d9488;
  --teal-dark:  #0f766e;
  --amber:      #d97706;
  --amber-bg:   #fef3c7;
  --red:        #dc2626;
  --green:      #16a34a;
  /* Per-club primary colour — set on <body style> by the page bootstrap
     after fetching club branding. Defaults to TallyTracker's brand teal
     when the club hasn't uploaded a colour or before the fetch lands. */
  --club-primary: var(--teal);
  --club-primary-dark: var(--teal-dark);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--paper-2);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ───── Nav (TallyTracker brand) ───── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1080px; margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink); font-weight: 700;
  font-size: 15px;
}
.nav-brand img { width: 40px; height: 40px; border-radius: 9px; } /* Pete 2026-06-12 (logo-consistency): was 28px — match the other site pages */
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a {
  color: var(--ink-soft); text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: color .2s;
}
.nav-links a:hover { color: var(--ink); }
@media (max-width: 640px) {
  .nav-links a:not(.nav-cta) { display: none; }
}

/* ───── Hero (per-club branded backdrop) ───── */
.hero {
  position: relative;
  padding: 60px 0 80px;
  background: linear-gradient(135deg, var(--club-primary-dark) 0%, var(--club-primary) 100%);
  color: white;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 60px;
  background: linear-gradient(180deg, transparent, var(--paper-2));
  pointer-events: none;
}

/* Pete 2026-06-09 (onb-water-hero): water-photo backdrop modifier for
   the club + events pages — matches the main tallytracker.co.uk
   site's hero treatment (pycslip.jpg with a navy → teal gradient
   overlay). Pages add `class="hero water-bg"` to opt in. event.html
   keeps the plain `.hero` so the per-event page stays tinted with
   the host club's brand colour rather than the generic site palette. */
.hero.water-bg {
  /* Pete 2026-06-09 (onb-water-hero-bump): post-deploy review showed the
     overlay was too washed out vs the main site. Bumped from 0.78/0.55
     to 0.90/0.78 so the navy → teal branding reads as strong as the
     homepage. Also added a third stop that holds navy a bit longer so
     the H1 has more contrast in the upper-left where it lives. */
  background-image:
    linear-gradient(135deg,
      rgba(10,37,64,0.92) 0%,
      rgba(10,37,64,0.85) 35%,
      rgba(15,118,110,0.78) 100%),
    url('/pycslip.jpg');
  background-size: cover;
  background-position: center;
  padding: 100px 0 100px;
}
.hero.water-bg h1,
.hero.water-bg p {
  text-shadow: 0 2px 18px rgba(0,0,0,0.4);
}
.hero-brand-row {
  display: flex; align-items: center; gap: 18px;
  margin-bottom: 26px;
}
.hero-club-logo {
  width: 64px; height: 64px;
  border-radius: 14px;
  background: white;
  padding: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  object-fit: contain;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  color: white;
  font-size: 12px; font-weight: 600; letter-spacing: 0.3px;
  backdrop-filter: blur(8px);
}
.hero-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #5eead4;
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.30);
}
.hero h1 {
  font-size: clamp(28px, 4.5vw, 46px);
  font-weight: 800;
  line-height: 1.08; letter-spacing: -0.02em;
  max-width: 800px;
  margin-bottom: 16px;
  color: white;
  text-shadow: 0 2px 18px rgba(0,0,0,0.25);
}
.hero p {
  font-size: 17px; color: rgba(255,255,255,0.92);
  max-width: 640px;
  margin-bottom: 24px;
  text-shadow: 0 1px 12px rgba(0,0,0,0.15);
}
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 18px;
  color: rgba(255,255,255,0.92); font-size: 14px;
  font-weight: 500;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta strong { font-weight: 700; color: white; }

/* ───── Buttons / chips ───── */
.btn-primary, .btn-secondary, .btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 600; font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all .2s;
  font-family: inherit;
}
.btn-primary {
  background: var(--club-primary); color: white;
}
.btn-primary:hover {
  background: var(--club-primary-dark); transform: translateY(-1px);
}
.btn-secondary {
  background: white; color: var(--ink);
  border: 1px solid var(--line);
}
.btn-secondary:hover { background: var(--paper-3); }
.btn-ghost {
  background: transparent; color: var(--ink-soft);
}
.btn-ghost:hover { color: var(--ink); }
.chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--paper-3);
  color: var(--ink-soft);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.2px;
}

/* ───── Card / section ───── */
section.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 26px;
  margin-bottom: 18px;
}
section.card h2 {
  font-size: 18px; font-weight: 700;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px;
}
section.card h2 .count {
  font-size: 13px; font-weight: 600;
  color: var(--ink-quiet);
  background: var(--paper-3);
  padding: 2px 8px;
  border-radius: 999px;
}
.section-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 720px) {
  .section-row { grid-template-columns: 1fr; }
}

/* ───── Notice list ───── */
.notice-list { display: flex; flex-direction: column; gap: 10px; }
.notice-card {
  display: flex; gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
  transition: border-color .15s, transform .15s;
}
.notice-card:hover {
  border-color: var(--club-primary);
}
.notice-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--club-primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  flex-shrink: 0;
}
.notice-icon.results  { background: #16a34a; }
.notice-icon.protest  { background: #dc2626; }
.notice-icon.amend    { background: #c2410c; }
.notice-icon.redress  { background: #7c3aed; }
.notice-icon.general  { background: #6b7280; }
.notice-body { flex: 1; min-width: 0; }
.notice-title { font-weight: 700; font-size: 14.5px; margin-bottom: 2px; }
.notice-meta  { font-size: 12px; color: var(--ink-quiet); margin-bottom: 6px; }
.notice-text  { font-size: 13.5px; color: var(--ink-soft); white-space: pre-wrap; }
.notice-superseded {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px; font-weight: 700;
  color: var(--amber);
  background: var(--amber-bg);
  padding: 2px 7px; border-radius: 4px;
  letter-spacing: 0.3px; text-transform: uppercase;
}
.notice-download {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 8px;
  padding: 6px 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--club-primary-dark);
  font-size: 13px; font-weight: 600;
  text-decoration: none;
}
.notice-download:hover {
  background: var(--paper-3);
  border-color: var(--club-primary);
}

/* ───── Event card list (used on club + events pages) ───── */
.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.event-card {
  display: block;
  padding: 16px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
  transition: all .2s;
}
.event-card:hover {
  border-color: var(--club-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(10, 37, 64, 0.06);
}
.event-card-date {
  display: inline-block;
  background: var(--club-primary);
  color: white;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}
.event-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
.event-card .event-card-meta {
  font-size: 13px;
  color: var(--ink-quiet);
  display: flex; flex-wrap: wrap;
  gap: 10px;
}

/* ───── Sign-in / entered-only banner ───── */
.auth-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #fcd34d;
  border-radius: 12px;
  margin-bottom: 18px;
  color: #78350f;
  font-size: 14px;
}
.auth-banner.signed-in {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  border-color: #86efac;
  color: #14532d;
}
.auth-banner .auth-actions { margin-left: auto; display: flex; gap: 8px; }

/* ───── Footer ───── */
.footer {
  margin-top: 60px;
  padding: 36px 0 60px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--ink-quiet);
  font-size: 13px;
}
.footer a { color: var(--club-primary); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer-logo {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--ink-soft);
}
.footer-logo img { width: 20px; height: 20px; border-radius: 4px; }

/* ───── Loading / empty states ───── */
.skeleton {
  background: linear-gradient(90deg, var(--paper-3), var(--paper-2), var(--paper-3));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: 8px;
}
@keyframes shimmer { 0%{background-position:200% 0;} 100%{background-position:-200% 0;} }
.empty-state {
  text-align: center;
  padding: 36px 18px;
  color: var(--ink-quiet);
  font-size: 14px;
}
.error-state {
  text-align: center;
  padding: 36px 18px;
  color: var(--red);
  font-size: 14px;
}

/* ───── Search bar (events page) ───── */
.search-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 18px;
}
.search-row input, .search-row select {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: white;
  color: var(--ink);
}
.search-row input { flex: 1; min-width: 200px; }
.search-row input:focus, .search-row select:focus {
  outline: none;
  border-color: var(--club-primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}
