/* ============================================================
   public.css – Wintergolf Unified Responsive Stylesheet
   Mobile-first: default = mobile, 768px = tablet, 1024px = desktop
   ============================================================ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --bg:          rgba(11, 15, 26, 0.3);
  --surface:     rgba(19, 25, 40, 0.4);
  --card:        rgba(26, 32, 53, 0.55);
  --card-alt:    rgba(31, 40, 64, 0.65);
  --table-cell:  #1f2937;
  --table-head:  #111827;
  --table-highlight: #047857;
  --table-text-hi: #d1fae5;
  --sticky-bg:   #1f2937;
  --border-table: #374151;
  --border:      rgba(255, 255, 255, 0.08);
  --border-hi:   rgba(255, 255, 255, 0.15);
  --text:        #e8edf5;
  --muted:       #8896b3;
  --dim:         #5a6882;
  --accent:      #22c55e;
  --accent-dim:  #16a34a;
  --accent-glow: rgba(34,197,94,0.18);
  --damen:       #f59e0b;
  --damen-bg:    rgba(245,158,11,0.5);
  --herren:      #60a5fa;
  --herren-bg:   rgba(96,165,250,0.5);
  --gold:        #f59e0b;
  --silver:      #94a3b8;
  --bronze:      #cd7f32;
  --nav-h:       60px;
  --max-w:       1200px;
  --r:           16px;
  --r-sm:        10px;
}

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; scroll-padding-top: calc(var(--nav-h) + 20px); }

body {
  background-color: var(--bg);
  background-image: url('../img/background.jpg');
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  padding-top: var(--nav-h);
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }

/* ── Navbar ──────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(11,15,26,0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 16px;
}

.nav-brand {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* hamburger – visible on mobile */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
}
.nav-toggle .bar {
  width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-toggle.open .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open .bar:nth-child(2) { opacity: 0; }
.nav-toggle.open .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* nav links – dropdown on mobile */
.nav-links {
  display: none;
  flex-direction: column;
  position: absolute;
  top: var(--nav-h);
  left: 0; right: 0;
  background: rgba(11,15,26,0.98);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.nav-links.open { display: flex; }
.nav-links li a {
  display: block;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
}
.nav-links li a:hover { color: var(--accent); background: var(--accent-glow); }

/* Theme Toggle Button */
.theme-toggle-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  padding: 12px 24px;
  cursor: pointer;
  transition: transform 0.2s, color 0.2s;
  display: block;
  width: 100%;
  text-align: left;
}
.theme-toggle-btn:hover { color: var(--accent); }
.theme-toggle-btn:active { transform: scale(0.9); }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, var(--surface) 0%, var(--bg) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 32px 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  max-width: var(--max-w);
  margin: 20px auto 0;
}
.hero-content {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
}
.hero-logo {
  position: absolute;
  left: 0;
  width: clamp(80px, 15vw, 130px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.4));
}
.hero-text {
  text-align: center;
}
@media (max-width: 600px) {
  .hero-content {
    gap: 16px;
    flex-direction: column;
  }
  .hero-logo {
    position: static;
  }
  .hero-text {
    text-align: center;
  }
}
.hero h1 {
  font-size: clamp(2rem, 8vw, 4rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-shadow: 0 0 40px var(--accent-glow);
}
.hero p {
  margin-top: 8px;
  color: var(--muted);
  font-size: clamp(0.85rem, 2.5vw, 1.1rem);
  font-weight: 400;
}

/* ── Layout helpers ──────────────────────────────────────── */
.page-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 12px 48px;
}

.section {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px;
  margin-top: 40px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Card ────────────────────────────────────────────────── */
.card {
  background: var(--card-alt);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.card-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Top info row (next round + news side by side) ──────── */
.info-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

/* Next round card */
.next-round-card .nr-date {
  font-size: clamp(1.4rem, 5vw, 2rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 8px;
}
.next-round-card .nr-time {
  font-size: 1rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.next-round-card .nr-time .nr-time-val {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
}

/* News card */
.news-card .news-body {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.news-card .news-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: var(--r-sm);
}
.news-card .news-text {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-line;
}
.news-card .news-empty {
  font-size: 0.9rem;
  color: var(--dim);
  font-style: italic;
}

/* ── Score Tables ────────────────────────────────────────── */
.score-card { padding: 0; overflow: hidden; }
.card.card-damen {
  background: var(--damen-bg);
  border-color: rgba(245,158,11,0.3);
}
.card.card-herren {
  background: var(--herren-bg);
  border-color: rgba(96,165,250,0.3);
}
.score-card-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.score-card-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

/* Table scroll wrapper */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  padding: 0 20px 20px 20px;
}
.table-wrap:active { cursor: grabbing; }

/* Clickable names in tables */
.clickable-name {
  color: var(--accent);
  text-decoration: underline dotted;
  transition: color 0.15s;
}
.clickable-name:hover {
  color: var(--accent-dim);
}

/* ── Siegerliste ─────────────────────────────────────────── */
.siegerliste-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.season-card {
  background: var(--card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.season-card:hover { 
  border-color: var(--accent); 
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.season-year {
  background: var(--card-alt);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.04em;
}

.season-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.season-group {
  padding: 16px 18px;
}
.season-group:first-child {
  border-right: 1px solid var(--border);
}

.season-group-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  opacity: 0.7;
}
.season-group.damen { color: var(--damen); }
.season-group.herren { color: var(--herren); }

.season-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 6px;
}
.season-entry .place { font-size: 0.85rem; opacity: 0.6; min-width: 18px; }

/* ── Kontakt ─────────────────────────────────────────────── */
.kontakt-card {
  text-align: center;
  padding: 40px 20px;
}
.kontakt-icon { font-size: 52px; margin-bottom: 16px; }
.kontakt-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.kontakt-sub {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 320px;
  margin: 0 auto 28px;
  line-height: 1.65;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  padding: 15px 32px;
  border-radius: 12px;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:hover { background: var(--accent-dim); transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.97); }

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--r) var(--r) 0 0;
  padding: 24px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  color: var(--text);
  font-size: 0.9rem;
  max-width: var(--max-w);
  margin: 40px auto 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
}
.footer a { color: var(--muted); transition: color 0.15s; }
.footer a:hover { color: var(--accent); }

/* ── Tablet (768px+) ─────────────────────────────────────── */
@media (min-width: 768px) {
  :root { --nav-h: 64px; }

  .page-content { padding: 0 24px 60px; }

  .info-row {
    grid-template-columns: minmax(260px, 340px) 1fr;
  }

  .siegerliste-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-title { font-size: 1.4rem; }
}

/* ── Desktop (1024px+) ───────────────────────────────────── */
@media (min-width: 1024px) {
  .nav-toggle { display: none; }

  .nav-links {
    display: flex !important;
    flex-direction: row;
    position: static;
    background: none;
    border: none;
    padding: 0;
    gap: 4px;
  }
  .nav-links li a {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--muted);
  }
  .nav-links li a:hover { color: var(--accent); background: var(--accent-glow); }

  .theme-toggle-btn {
    padding: 8px 14px;
    width: auto;
    text-align: center;
  }

  .page-content { padding: 0 32px 80px; }

  .hero { padding: 64px 32px 56px; }

  .section { margin-top: 52px; }

  .siegerliste-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Light theme (data-theme="light") ───────────────────── */
@media (min-width: 0px) {
  :root[data-theme="light"] {
    --bg:          rgba(240, 244, 248, 0.25);
    --surface:     rgba(232, 237, 245, 0.4);
    --card:        rgba(255, 255, 255, 0.65);
    --card-alt:    rgba(245, 248, 252, 0.8);
    --table-cell:  #f9fafb;
    --table-head:  #f3f4f6;
    --table-highlight: #dcfce7;
    --table-text-hi: #166534;
    --sticky-bg:   #f9fafb;
    --border-table: #e5e7eb;
    --border:      rgba(255, 255, 255, 0.6);
    --border-hi:   rgba(255, 255, 255, 0.9);
    --text:        #1e2533;
    --muted:       #334155;
    --dim:         #475569;
    --accent:      #16a34a;
    --accent-dim:  #15803d;
    --accent-glow: rgba(22,163,74,0.18);
    --damen:       #b45309;
    --herren:      #1d4ed8;
  }
  :root[data-theme="light"] .navbar {
    background: rgba(240,244,248,0.7);
  }
  @media (max-width: 1023px) {
    :root[data-theme="light"] .nav-links {
      background: rgba(240,244,248,0.85);
    }
  }
}
