/* AmsalFC pitch-gold redesign + whole-app light/dark theme system
 * (2026-11-02). This is a VISUAL layer only, loaded after style.css +
 * amsal.css. It overrides colours, type and key surfaces; it does not
 * change markup, data, API routes, bracket logic, admin functions,
 * captcha or permissions.
 *
 * Palette: pitch #12402A, pitch-2 #1B5E3B, gold #E3B03B, ink #0F1F17,
 * chalk #F6F8F5, line #DCE3DD. Display: Barlow Condensed. Body: Source Sans 3.
 *
 * Theme model: light is the default on :root; dark is applied via
 * html[data-theme="dark"] (set by public/theme.js from the OS setting or a
 * saved choice). All surfaces are driven by semantic tokens so both modes
 * stay cohesive and a manual page never needs its own theme rules.
 */
:root {
  --pitch: #12402A;
  --pitch-2: #1B5E3B;
  --gold: #E3B03B;
  --gold-hover: #C9972A;
  --ink: #070f1e;
  --chalk: #f3f5f8;
  --line: rgba(12, 19, 34, 0.1);
  --muted: #64748b;
  --card: #ffffff;
  --display: "Barlow Condensed", "Inter", -apple-system, sans-serif;
  --body-font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* ---- LIGHT theme tokens (default) ---- */
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #e8ecf2;
  --surface-3: #ffffff;
  --text: #070f1e;
  --text-2: #334155;
  --text-3: #64748b;
  --border: rgba(12, 19, 34, 0.1);
  --border-2: rgba(12, 19, 34, 0.18);
  --brand: #12402A;
  --brand-2: #1B5E3B;
  --accent: #1B5E3B;
  --accent-hover: #12402A;
  --on-accent: #FFFFFF;
  --input-bg: #ffffff;
  --nav-bg: #12402A;
  --nav-link: #DCEBE2;
  --nav-link-hover: #FFFFFF;
  --footer-bg: #0A1911;
  --footer-text: #9FB0A6;
  --overlay: linear-gradient(180deg, rgba(7, 11, 18, 0.6) 0%, rgba(7, 11, 18, 0.85) 100%);
  --modal-scrim: rgba(4, 8, 16, 0.65);
  --scroll-track: #e8ecf2;
  --scroll-thumb: #94a3b8;
}

html[data-theme="dark"] {
  --bg: #070b12;
  --surface: #0c1322;
  --surface-2: #151d30;
  --surface-3: #182238;
  --text: #f8fafc;
  --text-2: #cbd5e1;
  --text-3: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.16);
  --brand: #070b12;
  --brand-2: #0c1322;
  --accent: #10b981;
  --accent-hover: #059669;
  --on-accent: #042017;
  --input-bg: #151d30;
  --nav-bg: rgba(12, 19, 34, 0.88);
  --nav-link: #cbd5e1;
  --nav-link-hover: #10b981;
  --footer-bg: #05080f;
  --footer-text: #8b98ab;
  --modal-scrim: rgba(0, 0, 0, 0.82);
  --scroll-track: #0c1322;
  --scroll-thumb: #334155;
}

html {
  scroll-padding-top: 72px;
}

body {
  font-family: var(--body-font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  font-size: 17px;
  transition: background .25s ease, color .25s ease;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

h1,
h2,
h3,
.section-title,
.dashboard-title,
.card-title {
  font-family: var(--display);
  letter-spacing: .01em;
  line-height: 1;
}

/* Sticky pitch-green header with gold bottom border (old navbar kept, restyled). */
.navbar {
  background: var(--nav-bg) !important;
  border-bottom: 3px solid var(--accent) !important;
}

.navbar.scrolled {
  background: var(--nav-bg) !important;
}

.nav-container {
  height: 64px;
  padding: 0 20px;
  max-width: 1120px;
  margin: 0 auto;
}

.club-title-white {
  font-family: var(--display) !important;
  color: #fff !important;
  font-size: 24px !important;
  letter-spacing: .04em !important;
}

.brand-title-link:hover .club-title-white {
  color: var(--accent) !important;
}

.nav-links a {
  color: var(--nav-link) !important;
  font-weight: 500;
  font-size: 15px;
  border-radius: 6px;
}

.nav-links a:hover {
  background: rgba(255, 255, 255, .1) !important;
  color: var(--nav-link-hover) !important;
}

.nav-links a::before {
  display: none;
}

.nav-links a.active {
  background: rgba(255, 255, 255, .12);
  color: #fff !important;
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .4);
  color: #fff;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  line-height: 1;
  transition: background .2s ease;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, .12);
}

.theme-toggle-btn i {
  pointer-events: none;
}

.menu-toggle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .4);
  color: #fff;
  border-radius: 6px;
}

/* Hero: pitch background, pitch-markings overlay, big condensed heading. */
.hero {
  background: var(--pitch) !important;
  padding-top: 64px;
}

.hero .pitch-markings {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .14;
  z-index: 1;
  pointer-events: none;
}

.hero-slider .slide::after {
  background: var(--overlay) !important;
}

.hero-content {
  max-width: 1120px;
  text-align: left;
  padding: 72px 20px 0;
}

.hero-content h1 {
  font-family: var(--display);
  font-size: clamp(54px, 11vw, 132px);
  font-weight: 800;
  text-transform: uppercase;
  max-width: 9ch;
  -webkit-text-fill-color: #fff;
  background: none;
  text-shadow: none;
}

.hero-content h2 {
  color: #D5E6DB;
}

.hero-content p {
  color: #D5E6DB;
  max-width: 46ch;
  font-size: 19px;
}

.hero-cta {
  justify-content: flex-start;
}

.btn {
  border-radius: 8px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;
}

.btn-primary,
.form-submit.accent {
  background: var(--accent) !important;
  color: var(--on-accent) !important;
  border: 2px solid transparent !important;
}

.btn-secondary {
  background: transparent !important;
  border: 2px solid rgba(255, 255, 255, .5) !important;
  color: #fff !important;
}

/* Two-section hero: white next-match panels. */
#hero-match-display {
  margin-top: 56px;
}

.hero-two {
  gap: 16px;
}

.hero-two>div {
  background: var(--surface);
  color: var(--text);
  border-radius: 14px 14px 0 0;
  padding: 22px 24px;
}

.hero-panel-label {
  color: var(--brand-2) !important;
  text-align: left !important;
  font-size: 14px;
}

.hero-two .hero-match-minimal {
  background: transparent !important;
  color: var(--text) !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.hero-two .hero-match-team span {
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
}

.hero-two .hero-match-vs,
.hero-two .hero-live-score {
  color: var(--text);
}

.hero-two .hero-match-minimal small {
  color: var(--text-3);
}

/* Sections: body background, alternating white panel, condensed uppercase titles. */
.section {
  padding: 72px 0 !important;
}

.section:nth-of-type(even) {
  background: var(--surface-2);
}

.section-header {
  text-align: left;
}

.section-title {
  font-family: var(--display);
  font-size: clamp(34px, 5vw, 52px) !important;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text) !important;
}

.section-title::after {
  left: 0 !important;
  transform: none !important;
  background: var(--accent) !important;
  width: 64px !important;
}

.section-subtitle {
  color: var(--text-3) !important;
  margin-left: 0 !important;
}

.container {
  max-width: 1120px;
  padding: 0 20px;
}

/* Cards: surface, line border, soft radius — fixture cards get the pitch accent. */
.news-card,
.match-card,
.player-card-minimal .minimal-card,
.ground-card,
.dashboard-card,
.cup-card,
.modal-content {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  color: var(--text);
}

.news-card p,
.match-card p,
.ground-card p,
.dashboard-card p {
  color: var(--text-2);
}

.cup-card {
  border-left: 5px solid var(--brand-2) !important;
}

.cup-card .cup-meta {
  color: var(--text-3);
}

.bracket-col h4,
.event-bracket-block h3 {
  font-family: var(--display);
  text-transform: uppercase;
}

.event-bracket-block h3 {
  font-size: 32px;
}

.ground-card h3 {
  color: var(--text);
}

#ground-display-image {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 12px;
}

/* Donate: dark-green panel (existing QR handling untouched). */
.donate-container {
  background: var(--pitch) !important;
  color: #fff !important;
  border-radius: 16px !important;
  padding: 40px !important;
}

.donate-container h3 {
  color: #fff;
  font-family: var(--display);
  font-size: clamp(34px, 5vw, 52px);
  text-transform: uppercase;
}

.donate-container p {
  color: #D5E6DB !important;
}

/* Footer: dark ink (slightly deeper than page bg in dark mode). */
.footer {
  background: var(--footer-bg) !important;
  color: var(--footer-text) !important;
}

.footer h3,
.footer .brand,
.footer a {
  color: #fff !important;
}

.footer-copyright {
  color: var(--footer-text) !important;
}

/* Modals / overlays / toast. */
.modal {
  background: var(--modal-scrim);
}

.news-panel-overlay {
  background: var(--modal-scrim);
}

.news-panel {
  background: var(--surface-3);
  color: var(--text);
}

.modal-content .modal-close {
  color: var(--text);
}

.toast {
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border);
}

.toast strong {
  color: var(--text);
}

/* Admin: same system, no function removed. */
.admin-container {
  max-width: 1120px;
}

.dashboard-header {
  border-bottom: 3px solid var(--accent);
  padding-bottom: 1rem;
}

.dashboard-title {
  font-size: clamp(34px, 5vw, 52px);
  text-transform: uppercase;
  color: var(--text);
}

.dashboard-subtitle {
  color: var(--text-3);
}

.dashboard-card .card-title {
  font-size: 26px;
  text-transform: uppercase;
  color: var(--text);
}

.card-icon {
  color: var(--brand-2);
}

.form-input,
.admin-wrap input,
.admin-wrap select,
.admin-wrap textarea {
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  background: var(--input-bg);
  color: var(--text);
}

.form-input::placeholder {
  color: var(--text-3);
}

.form-input:focus {
  border-color: var(--brand-2) !important;
}

.form-submit {
  border-radius: 8px !important;
  box-shadow: none !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.form-submit:not(.accent) {
  background: var(--brand) !important;
  color: #fff !important;
}

.dashboard-card a {
  color: var(--brand-2);
}

#admin-list>div,
#cup-match-list>div {
  background: var(--surface-2);
  border: 1px solid var(--border) !important;
  color: var(--text);
}

#admin-list label,
#cup-match-list label,
#admin-list select,
#cup-match-list select {
  color: var(--text);
}

#post-list p,
#admin-member-list p,
#admin-matches-list p,
#cup-list p,
#slider-list p,
#event-team-list p,
#event-fixture-list p {
  color: var(--text);
}

/* Blog page. */
main.section h1 {
  font-family: var(--display);
  font-size: clamp(34px, 5vw, 52px);
  text-transform: uppercase;
  color: var(--text);
}

main.section a {
  color: var(--brand-2);
}

main.section p,
main.section div,
main.section li {
  color: var(--text);
}

/* Scrollbar follows the theme. */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--scroll-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand-2);
}

/* Neutral dark extra surfaces that reference the old token (kept for
   inline styles / third-party that set colors directly). */
html[data-theme="dark"] .badge-live,
html[data-theme="dark"] .badge-upcoming,
html[data-theme="dark"] .badge-finished {
  color: #fff;
}

@media (max-width: 900px) {
  .hero-content {
    padding-top: 48px;
  }

  .hero-two>div {
    border-radius: 14px;
  }

  .donate-container {
    padding: 28px !important;
  }
}

/* ============================================
 * Mobile slide-out menu (hamburger) theming.
 * Replaces style.css's hardcoded light-only colours
 * with semantic tokens so the drawer follows the
 * active theme (light and dark) automatically.
 * ============================================ */
@media (max-width: 1024px) {
  .nav-links {
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
    border-left: 1px solid var(--border-2);
    box-shadow: -18px 0 50px var(--modal-scrim);
  }

  .nav-links a {
    background: transparent;
    border-color: var(--border);
    color: var(--text-2) !important;
  }

  .nav-links a:hover,
  .nav-links a.active {
    background: var(--surface-3);
    border-color: var(--accent);
    color: var(--text) !important;
  }

  /* Theme toggle inside the drawer renders as a menu row. */
  .nav-links .theme-toggle-btn,
  .nav-links #theme-toggle {
    width: 100%;
    min-height: 54px;
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-2) !important;
    font-weight: 700;
    border-radius: 14px;
    transition: background .25s ease, border-color .25s ease;
  }

  .nav-links .theme-toggle-btn:hover {
    background: var(--surface-3);
    border-color: var(--accent);
    color: var(--text) !important;
  }

  .admin-nav-links::before {
    color: var(--text-3);
  }

  .admin-nav-links #logout-btn {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border-color: color-mix(in srgb, var(--accent) 38%, transparent);
    color: var(--accent) !important;
  }
}