/*
Theme Name: BVB Spielplan
Theme URI: https://example.com/bvb-spielplan
Author: Claude
Description: Borussia Dortmund Spielplan-Theme mit Stadionbild-Header, Countdown und Wettbewerbs-Filter für Bundesliga, Champions League und DFB-Pokal.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bvb-spielplan
Tags: dark, sports, bvb, dortmund, events, countdown, custom-post-types
*/

/* ===========================
   CSS VARIABLES
=========================== */
:root {
  --bvb-yellow:   #FDE100;
  --bvb-black:    #0a0a0f;
  --bg-secondary: #0d0d18;
  --bg-card:      #14141e;
  --border:       #2a2a3a;
  --text-main:    #f0f0f8;
  --text-muted:   #8888aa;
  --green:        #00c864;
  --red:          #ff4444;
  --gold:         #ffc800;
  --radius:       12px;
  --font:         'Inter', 'Segoe UI', system-ui, sans-serif;
  --max-width:    1100px;
  --transition:   0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bvb-black);
  color: var(--text-main);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

.custom-logo img { max-width: 80px; height: auto; display: block; }
a   { color: var(--bvb-yellow); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: .8; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===========================
   SITE WRAPPER
=========================== */
.site-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.site-content  { flex: 1; }

/* ===========================
   GLOBAL HEADER / NAV
=========================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(13,13,24,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-branding { display: flex; align-items: center; gap: 10px; }
.site-branding .bvb-emblem { font-size: 26px; }

.site-branding .site-title {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -.03em;
  text-transform: uppercase;
  color: var(--text-main);
  line-height: 1.2;
}
.site-branding .site-title span { color: var(--bvb-yellow); }
.site-branding .site-tagline {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.main-navigation ul { list-style: none; display: flex; gap: 4px; flex-wrap: wrap; }
.main-navigation ul li a {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  display: block;
  transition: all var(--transition);
}
.main-navigation ul li a:hover,
.main-navigation ul li.current-menu-item > a {
  color: var(--text-main);
  background: var(--bg-card);
  opacity: 1;
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
}

/* ===========================
   STADIUM HERO HEADER
=========================== */
.stadium-hero {
  position: relative;
  height: 320px;
  overflow: hidden;
  background: var(--bg-secondary);
}

.stadium-hero .stadium-img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .6s ease, transform 8s ease;
  transform: scale(1.04);
  z-index: 0;
}

.stadium-hero.loaded .stadium-img {
  opacity: 1;
  transform: scale(1);
}

.stadium-hero .stadium-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  background: linear-gradient(135deg, #111122, #1a1208);
}

.stadium-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10,10,15,.2) 0%,
    rgba(10,10,15,.5) 50%,
    rgba(10,10,15,.92) 100%
  );
  z-index: 1;
}

.stadium-hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 32px;
  z-index: 2;
}

.hero-comp-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--bvb-yellow);
  background: rgba(253,225,0,.1);
  border: 1px solid rgba(253,225,0,.25);
  padding: 4px 14px;
  border-radius: 100px;
  margin-bottom: 10px;
}

.hero-stadium-name {
  font-size: clamp(20px, 4vw, 32px);
  font-weight: 900;
  letter-spacing: -.03em;
  line-height: 1.1;
  text-shadow: 0 2px 16px rgba(0,0,0,.6);
}

.hero-stadium-city {
  font-size: 14px;
  color: rgba(240,240,248,.65);
  margin-top: 4px;
}

.hero-next-match {
  margin-top: 10px;
  font-size: 13px;
  color: rgba(240,240,248,.8);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-next-match .matchup-badge {
  background: rgba(253,225,0,.15);
  border: 1px solid rgba(253,225,0,.3);
  color: var(--bvb-yellow);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 6px;
}

/* ===========================
   COUNTDOWN BAR
=========================== */
.countdown-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.countdown-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.countdown-meta { flex: 1; min-width: 200px; }

.countdown-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.countdown-match-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text-main);
  line-height: 1.3;
}

.countdown-comp-info {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.countdown-timer {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

.cd-unit { text-align: center; }

.cd-num {
  font-size: 26px;
  font-weight: 900;
  color: var(--bvb-yellow);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  min-width: 40px;
  display: block;
}

.cd-txt {
  font-size: 8px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-top: 2px;
}

.cd-sep {
  font-size: 22px;
  font-weight: 900;
  color: var(--border);
  margin-bottom: 12px;
}

/* ===========================
   FILTER BAR
=========================== */
.filter-bar {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  row-gap: 8px;
}

.filter-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: 4px;
}

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 7px 16px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font);
}

.filter-btn:hover { color: var(--text-main); border-color: #4a4a5a; }
.filter-btn.active { background: var(--bvb-yellow); border-color: var(--bvb-yellow); color: #000; }

/* ===========================
   GAMES LIST
=========================== */
.spielplan-section { padding: 24px 0 60px; }

.spielplan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.spielplan-title {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -.02em;
}

.games-count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 100px;
}

.games-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ===========================
   GAME CARD
=========================== */
.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}

.game-card:hover { border-color: #4a4a6a; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.game-card.is-active { border-color: var(--bvb-yellow); box-shadow: 0 0 20px rgba(253,225,0,.1); }
.game-card.is-next   { border-color: rgba(253,225,0,.35); }

.game-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.02);
  flex-wrap: wrap;
  gap: 6px;
}

.game-comp-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.game-tags { display: flex; align-items: center; gap: 8px; }

.next-badge {
  font-size: 9px;
  font-weight: 700;
  background: var(--bvb-yellow);
  color: #000;
  padding: 2px 8px;
  border-radius: 100px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.game-date-tag { font-size: 10px; color: var(--text-muted); }

/* Card body */
.game-card-body {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.game-time-col {
  min-width: 52px;
  text-align: center;
  flex-shrink: 0;
}
.game-time-col .g-date { font-size: 10px; color: var(--text-muted); }
.game-time-col .g-time { font-size: 14px; font-weight: 700; }

.v-divider { width: 1px; background: var(--border); align-self: stretch; flex-shrink: 0; }

.game-matchup {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-name { flex: 1; font-size: 14px; font-weight: 700; }
.team-name.home { text-align: right; }
.team-name.bvb  { color: var(--bvb-yellow); }

.score-display { text-align: center; min-width: 56px; flex-shrink: 0; }
.score-nums    { font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.score-lbl     { font-size: 9px; color: var(--text-muted); text-transform: uppercase; margin-top: 1px; }
.vs-text       { font-size: 14px; font-weight: 700; color: var(--text-muted); }

/* Card footer */
.game-card-footer {
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255,255,255,.01);
}

.result-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 100px;
}
.result-badge.sieg         { background: rgba(0,200,100,.15); color: var(--green); }
.result-badge.unentschieden{ background: rgba(255,200,0,.1);  color: var(--gold); }
.result-badge.niederlage   { background: rgba(255,60,60,.12); color: var(--red); }

/* ===========================
   FOOTER
=========================== */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 40px 0 20px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-brand-title {
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -.02em;
  margin-bottom: 6px;
}
.footer-brand-title span { color: var(--bvb-yellow); }

.footer-brand p   { font-size: 12px; color: var(--text-muted); line-height: 1.6; margin-top: 6px; }
.footer-col-title { font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px; }
.footer-links     { list-style: none; }
.footer-links li  { margin-bottom: 8px; }
.footer-links a   { font-size: 12px; color: var(--text-muted); transition: color var(--transition); }
.footer-links a:hover { color: var(--bvb-yellow); opacity: 1; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ===========================
   UTILITIES
=========================== */
.sr-only { position: absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .main-navigation { display: none; width: 100%; order: 3; }
  .main-navigation.toggled { display: block; }
  .main-navigation ul { flex-direction: column; padding: 8px 0; }
  .header-inner { flex-wrap: wrap; }

  .stadium-hero { height: 220px; }
  .stadium-hero-content { padding: 18px 20px; }

  .countdown-inner { flex-direction: column; align-items: flex-start; }

  .footer-inner { grid-template-columns: 1fr; gap: 24px; }

  .game-matchup { gap: 4px; }
  .team-name { font-size: 12px; }
  .score-nums { font-size: 16px; }
}

@media (max-width: 480px) {
  .filter-bar { gap: 5px; }
  .filter-btn { font-size: 11px; padding: 6px 12px; }
  .game-card-body { gap: 8px; padding: 12px; }
}
