/* ================================================================
   Apocalypse Zürich — Redesign 2025
   Aesthetic: Schweizer Sport-Editorial
   Fonts: Barlow Condensed (Headings) + Source Sans 3 (Body)
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800&family=Source+Sans+3:ital,wght@0,400;0,600;1,400&display=swap');

/* ── Tokens ──────────────────────────────────────────────────── */
:root {
  /* Zürich-Blau-Palette */
  --blue-900: #002567;
  --blue-800: #003F8A;   /* Hauptfarbe */
  --blue-700: #0050AD;
  --blue-100: #E6EFF9;
  --blue-50:  #F0F5FB;

  /* Akzent — Orange aus dem Logo */
  --orange:   #E07010;
  --orange-h: #C55F00;

  /* Neutrals */
  --white:    #FFFFFF;
  --ink:      #182130;
  --muted:    #5A6880;
  --border:   #D0DCF0;
  --row-alt:  #F4F8FF;

  /* Typografie */
  --font-head: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
  --font-body: 'Source Sans 3', 'Segoe UI', Helvetica, Arial, sans-serif;

  /* Geometrie */
  --r: 4px;
  --shadow: 0 1px 6px rgba(0,40,120,.10);
  --max: 1100px;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--blue-50);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--blue-800); text-decoration: none; }
a:hover { color: var(--orange); text-decoration: underline; }

img { display: block; max-width: 100%; height: auto; }
p   { margin-bottom: .85rem; }
p:last-child { margin-bottom: 0; }

h1, h2, h3 {
  font-family: var(--font-head);
  letter-spacing: .02em;
  line-height: 1.15;
}
h2 { font-size: 1.5rem; font-weight: 700; color: var(--blue-800); margin-bottom: .6rem; }
h3 { font-size: 1.15rem; font-weight: 700; color: var(--blue-700); margin-bottom: .35rem; }

/* ── Layout ──────────────────────────────────────────────────── */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ================================================================
   HEADER
   ================================================================ */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

/* Logozeile */
.header-brand {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: .6rem 0;
}

.header-brand a { display: flex; align-items: center; line-height: 0; }

.header-brand img {
  height: 52px;
  width: auto;
  image-rendering: -webkit-optimize-contrast; /* schärfere GIFs */
}

.header-tagline {
  font-family: var(--font-head);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  border-left: 2px solid var(--border);
  padding-left: .9rem;
  line-height: 1.3;
}

/* ── Navigationsleiste ─────────────────────────────────────────── */
.site-nav {
  background: var(--blue-800);
  border-bottom: 3px solid var(--orange);
  position: sticky;
  top: 0;
  z-index: 200;
}

.nav-inner {
  display: flex;
  align-items: stretch;
}

.nav-list {
  list-style: none;
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
}

/* Top-Level Links */
.nav-list > li { position: relative; display: flex; align-items: stretch; }

.nav-list > li > a {
  display: flex;
  align-items: center;
  padding: .6rem .9rem;
  font-family: var(--font-head);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.80);
  transition: background .12s, color .12s;
  white-space: nowrap;
}

.nav-list > li > a:hover,
.nav-list > li > a.active {
  background: var(--orange);
  color: var(--white);
  text-decoration: none;
}

/* Dropdown-Pfeil */
.nav-list > li.has-drop > a::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  margin-left: 5px;
  opacity: .7;
  transition: transform .15s;
}

.nav-list > li.has-drop.open > a::after {
  transform: rotate(180deg);
}

/* Dropdown-Panel */
.nav-drop {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 2px solid var(--orange);
  border-radius: 0 0 var(--r) var(--r);
  box-shadow: 0 6px 20px rgba(0,40,120,.14);
  z-index: 300;
  list-style: none;
}

/* Öffnen via Hover (Desktop) und via .open (JS) */
.nav-list > li.has-drop:hover  .nav-drop,
.nav-list > li.has-drop.open   .nav-drop { display: block; }

.nav-drop li { border-bottom: 1px solid var(--blue-50); }
.nav-drop li:last-child { border-bottom: none; }

.nav-drop a {
  display: block;
  padding: .52rem .95rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--blue-800);
  transition: background .1s;
}

.nav-drop a:hover {
  background: var(--blue-50);
  color: var(--blue-900);
  text-decoration: none;
}

/* ================================================================
   SEITENKOPF (Hero-Streifen, kompakt)
   ================================================================ */
.page-hero {
  border-bottom: 2px solid var(--border);
  padding: .9rem 0 .75rem;
  margin-bottom: 1.25rem;
}

.page-hero h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--blue-800);
  margin-bottom: 0;
  border-left: 4px solid var(--orange);
  padding-left: .65rem;
  line-height: 1.1;
}

.page-hero p {
  font-size: .8rem;
  color: var(--muted);
  margin: .3rem 0 0 calc(.65rem + 4px);
}

.page-hero p a {
  color: var(--muted);
  text-decoration: none;
}
.page-hero p a:hover { color: var(--blue-800); }

/* ================================================================
   MAIN
   ================================================================ */
.site-main { padding-bottom: 3rem; }

/* ================================================================
   KARTEN
   ================================================================ */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.25rem;
}

/* ================================================================
   TABELLEN
   ================================================================ */
.tbl-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  background: var(--white);
}

.data-table thead th {
  background: var(--blue-800);
  color: var(--white);
  font-family: var(--font-head);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .55rem .8rem;
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: .52rem .8rem;
  border-bottom: 1px solid var(--blue-50);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

/* Zebra */
.data-table tbody tr:nth-child(even) { background: var(--row-alt); }

/* Hover */
.data-table tbody tr:hover { background: var(--blue-100); }

/* Eigene Zeile */
.own-row {
  border-left: 3px solid var(--orange) !important;
  font-weight: 600;
}
.own-row td:first-child { padding-left: .6rem; }

/* Trainingstabelle */
.training-tbl td:first-child {
  font-weight: 600;
  color: var(--muted);
  width: 100px;
  white-space: nowrap;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ================================================================
   SUB-NAV (Sektions-Tabs)
   ================================================================ */
.sub-nav {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.sub-nav a {
  font-family: var(--font-head);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: .32rem .8rem;
  border-radius: 20px;
  border: 1.5px solid var(--blue-800);
  color: var(--blue-800);
  transition: background .12s, color .12s;
  text-decoration: none;
}

.sub-nav a:hover,
.sub-nav a.active {
  background: var(--blue-800);
  color: var(--white);
  text-decoration: none;
}

/* ================================================================
   RESULTAT-BADGE
   ================================================================ */
.badge {
  font-family: var(--font-head);
  font-size: .88rem;
  font-weight: 700;
  color: var(--blue-800);
  letter-spacing: .04em;
  white-space: nowrap;
}

a.badge {
  border-bottom: 1px solid var(--border);
}

a.badge:hover {
  color: var(--orange);
  border-color: var(--orange);
  text-decoration: none;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-head);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .42rem 1rem;
  border-radius: var(--r);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s, color .12s;
  line-height: 1.3;
}

.btn-blue  { background: var(--blue-800); color: var(--white); }
.btn-blue:hover  { background: var(--blue-900); color: var(--white); text-decoration: none; }

.btn-sm { padding: .28rem .7rem; font-size: .76rem; }

/* ================================================================
   ALERTS
   ================================================================ */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--r);
  font-size: .87rem;
  border-left: 3px solid;
  margin-bottom: 1rem;
}
.alert-info { background: var(--blue-100); color: var(--blue-900); border-color: var(--blue-800); }
.alert-warn { background: #fff8e1; color: #7a5200; border-color: #f59e0b; }

/* ================================================================
   STARTSEITE
   ================================================================ */
.home-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 740px) {
  .home-grid { grid-template-columns: 2fr 1fr; }
}

/* Hero Startseite — zentriert, weiss, dezent */
.home-hero {
  text-align: center;
  padding: 1.5rem 0 1.1rem;
  margin-bottom: 1.5rem;
  border-bottom: 3px solid var(--blue-800);
  position: relative;
}

/* Orangener Akzentpunkt unter dem Logo */
.home-hero::after {
  content: '';
  display: block;
  width: 36px;
  height: 3px;
  background: var(--orange);
  margin: .75rem auto 0;
}

.home-hero img {
  max-height: 70px;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
}

.home-hero-tagline {
  margin: .5rem 0 0;
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--font-head);
  font-weight: 600;
}

/* ================================================================
   SPIELDETAIL
   ================================================================ */
.game-card {
  background: var(--blue-800);
  background-image: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-700) 100%);
  color: var(--white);
  border-radius: var(--r);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  text-align: center;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.g-team {
  flex: 1;
  min-width: 120px;
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  color: rgba(255,255,255,.9);
}

.g-score {
  font-family: var(--font-head);
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--orange);
  letter-spacing: .04em;
  min-width: 110px;
}

.g-meta { font-size: .78rem; color: rgba(255,255,255,.5); margin-top: .15rem; }

/* Ereignis-Liste */
.events { list-style: none; }

.event {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--blue-50);
  font-size: .875rem;
}
.event:last-child { border-bottom: none; }

.ev-ico { font-size: .9rem; }

.ev-min {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .85rem;
  color: var(--blue-800);
  min-width: 34px;
}
.ev-ico { font-size: 1rem; }
.ev-txt { flex: 1; }

.ev-score {
  display: inline-block;
  margin-left: .35rem;
  padding: .05rem .35rem;
  font-family: var(--font-head);
  font-size: .72rem;
  font-weight: 700;
  color: var(--blue-800);
  background: var(--blue-50);
  border: 1px solid var(--border);
  border-radius: 3px;
  vertical-align: middle;
  letter-spacing: .02em;
}

/* ================================================================
   FOOTER
   ================================================================ */
.site-footer {
  background: var(--blue-900);
  border-top: 3px solid var(--orange);
  margin-top: 2.5rem;
  padding: .55rem 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  font-size: .8rem;
  color: rgba(255,255,255,.45);
}

.footer-inner a { color: rgba(255,255,255,.45); }
.footer-inner a:hover { color: var(--white); text-decoration: none; }

.footer-nav { display: flex; gap: 1rem; }

/* ================================================================
   UTILITIES
   ================================================================ */
.text-muted  { color: var(--muted); }
.text-sm     { font-size: .82rem; }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; }

/* Minute-Spalte in Ereignistabelle */
.col-minute { width: 48px; white-space: nowrap; }

/* ================================================================
   HAMBURGER BUTTON
   ================================================================ */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .55rem .8rem;
  margin-left: auto;
  flex-shrink: 0;
  line-height: 0;
}

.nav-toggle-bar {
  display: block;
  width: 21px;
  height: 2px;
  background: rgba(255,255,255,.85);
  margin: 4px 0;
  border-radius: 1px;
  transition: transform .2s ease, opacity .15s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ================================================================
   MOBILE NAVIGATION (< 720px)
   ================================================================ */
@media (max-width: 720px) {
  /* Hamburger einblenden */
  .nav-toggle { display: block; }

  /* Nav-Leiste wird Wrapper für Button + ausklappbare Liste */
  .nav-inner { flex-wrap: wrap; }

  /* Liste standardmässig versteckt, öffnet sich per JS */
  .nav-list {
    display: none;
    flex-direction: column;
    flex-wrap: nowrap;
    width: 100%;
    border-top: 1px solid rgba(255,255,255,.1);
    padding-bottom: .3rem;
  }
  .nav-list.open { display: flex; }

  /* Einzelne Nav-Einträge als volle Zeilen */
  .nav-list > li {
    display: block;
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,.07);
  }

  .nav-list > li > a {
    padding: .72rem 1.1rem;
    font-size: .9rem;
    width: 100%;
    display: flex;
    justify-content: space-between;
  }

  /* Dropdown: Hover-Öffnen deaktivieren, nur via .open */
  .nav-list > li.has-drop:hover .nav-drop { display: none; }
  .nav-list > li.has-drop.open  .nav-drop { display: block; }

  /* Dropdown inline (nicht absolut) */
  .nav-drop {
    position: static !important;
    min-width: 0;
    border: none;
    border-top: 1px solid rgba(255,255,255,.08);
    border-radius: 0;
    box-shadow: none;
    background: rgba(0, 20, 60, .3);
  }
  .nav-drop li { border-color: rgba(255,255,255,.06); }
  .nav-drop a {
    color: rgba(255,255,255,.7);
    padding-left: 2.1rem;
    background: transparent;
    font-size: .85rem;
  }
  .nav-drop a:hover {
    background: rgba(255,255,255,.08);
    color: var(--white);
  }
}

/* ================================================================
   MOBILE ALLGEMEIN (< 600px)
   ================================================================ */
@media (max-width: 600px) {
  /* Header */
  .header-brand img  { height: 40px; }
  .header-tagline    { display: none; }

  /* Page-Hero */
  .page-hero         { padding: .85rem 0 .7rem; }
  .page-hero h1      { font-size: 1.35rem; }

  /* Startseite Hero */
  .home-hero-text h1 { font-size: 1.5rem; }

  /* Tabellen */
  .data-table td,
  .data-table thead th { padding: .42rem .55rem; font-size: .8rem; }

  /* Ereignistabelle kompakter */
  .events-tbl td,
  .events-tbl thead th { padding: .38rem .4rem; font-size: .78rem; }
  .events-tbl .col-minute { width: 38px; }

  /* Elemente/Spalten auf Mobile ausblenden */
  .col-hide-xs { display: none !important; }
  .hide-xs     { display: none !important; }

  /* Spieldetail-Karte: Grid statt Flex */
  .game-card {
    display: grid;
    grid-template-areas: "score score" "home away";
    grid-template-columns: 1fr 1fr;
    gap: .75rem 1rem;
    padding: 1.1rem 1rem;
    text-align: center;
  }
  .game-card > div:not(.g-team) { grid-area: score; }
  .game-card > .g-team:first-child { grid-area: home; }
  .game-card > .g-team:last-child  { grid-area: away; }
  .g-score  { font-size: 2.2rem; min-width: 0; }
  .g-team   { min-width: 0; font-size: .88rem; }

  /* Cards kompakter */
  .card { padding: 1rem 1.1rem; }

  /* Sub-Nav */
  .sub-nav a  { font-size: .75rem; padding: .28rem .65rem; }

  /* Footer */
  .footer-inner { flex-direction: column; align-items: flex-start; gap: .4rem; }
  .footer-nav   { gap: .75rem; }

  /* Scroll-Hinweis: relative Positionierung als Basis für Pseudo */
  .tbl-wrap { position: relative; }
}
