/* ==========================================================================
   RTV Fit-Life Erfurt e.V. – Tischtennis
   Farbwelt: Tischplatten-Blau, weiße Linien, Schläger-Rot aus dem Vereinslogo.
   Keine externen Schriften oder Dienste (Datenschutz).
   ========================================================================== */

:root {
  --tinte: #0c1d36;
  --blau: #14457f;
  --blau-tief: #0c2f5a;
  --blau-hell: #eaf1fa;
  --akzent: #d8232a;
  --akzent-dunkel: #a81b21;
  --text: #2c3645;
  --text-hell: #5d6878;
  --grund: #ffffff;
  --flaeche: #f4f6f9;
  --rand: #dfe5ec;
  --radius: 14px;
  --schatten: 0 10px 28px rgba(12, 29, 54, .10);
  --max-breite: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--grund);
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; }

.wrap { max-width: var(--max-breite); margin: 0 auto; padding: 0 1.25rem; }
.wrap.schmal { max-width: 800px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--tinte); color: #fff;
  padding: .5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 { color: var(--tinte); line-height: 1.2; letter-spacing: -.015em; }
h1 { font-size: clamp(1.8rem, 4.2vw, 2.5rem); margin: .3em 0 .4em; font-weight: 800; }
h2 { font-size: clamp(1.35rem, 3vw, 1.7rem); margin-top: 1.8em; }
h3 { font-size: 1.2rem; margin-top: 1.5em; }

a { color: var(--blau); text-underline-offset: .18em; }
a:hover { color: var(--akzent-dunkel); }

/* ---------- Header & Navigation ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--rand);
  backdrop-filter: blur(6px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }

.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; flex-shrink: 0; }
.brand-icon { width: 38px; height: 38px; }
.brand-logo { height: 56px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; color: var(--tinte); white-space: nowrap; }
.brand-zusatz { font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-hell); white-space: nowrap; }

.nav-toggle { display: none; }

.nav-liste { list-style: none; display: flex; align-items: center; gap: .1rem; margin: 0; padding: 0; }
.nav-liste a {
  display: block; padding: .5rem .62rem; text-decoration: none; color: var(--tinte);
  font-weight: 600; font-size: .92rem; border-radius: 8px; white-space: nowrap;
}
.nav-liste a:hover { color: var(--blau); background: var(--blau-hell); }
.nav-liste a.aktiv { color: var(--blau); box-shadow: inset 0 -3px 0 var(--akzent); border-radius: 8px 8px 0 0; }

@media (min-width: 1001px) {
  .suche-label { display: none; }
  .nav-suche svg { display: block; }
}
@media (min-width: 1001px) and (max-width: 1130px) {
  .nav-liste a { padding: .5rem .42rem; font-size: .85rem; }
  .brand-zusatz { display: none; }
}

/* Mobile Navigation */
@media (max-width: 1000px) {
  .nav-toggle {
    display: inline-flex; flex-direction: column; gap: 5px;
    background: none; border: 0; padding: .6rem; cursor: pointer;
  }
  .nav-toggle-bar { width: 24px; height: 2.5px; background: var(--tinte); border-radius: 2px; transition: transform .2s, opacity .2s; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

  .main-nav { display: flex; justify-content: flex-end; }
  .nav-liste {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--rand);
    max-height: calc(100vh - 68px); overflow-y: auto;
    box-shadow: 0 14px 30px rgba(12, 29, 54, .15);
    padding: .4rem 1.25rem 1rem;
  }
  .nav-liste.offen { display: flex; }
  .nav-liste > li { border-bottom: 1px solid var(--rand); }
  .nav-liste > li:last-child { border-bottom: 0; }
  .nav-liste a { padding: .85rem .3rem; font-size: 1rem; border-radius: 0; }
  .nav-liste a.aktiv { box-shadow: inset 3px 0 0 var(--akzent); padding-left: .8rem; border-radius: 0; }
  .nav-suche a { display: flex; align-items: center; gap: .5rem; }
}

/* ---------- Startseite: Hero (Tischplatte von oben) ---------- */

.hero {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(120deg, var(--blau-tief), var(--blau) 55%, #1c5aa3);
}
.hero::before { /* weiße Tischlinien */
  content: ""; position: absolute; inset: 14px; pointer-events: none;
  border: 2px solid rgba(255, 255, 255, .26); border-radius: 3px;
}
.hero-inner { position: relative; z-index: 2; padding-top: 4.2rem; padding-bottom: 4.4rem; }
.hero-inner > * { max-width: 620px; }
.hero-dach {
  margin: 0 0 .5rem; font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: #ffd3d0;
}
.hero h1 { color: #fff; margin: 0 0 .5rem; font-size: clamp(2rem, 5.4vw, 3.3rem); }
.hero-text { margin: 0 0 1.6rem; font-size: 1.15rem; color: rgba(255, 255, 255, .88); }
.hero-links { display: flex; flex-wrap: wrap; gap: .7rem; margin: 0; }

.hero-netz { /* Netz */
  position: absolute; top: 14px; bottom: 14px; left: 66%; width: 0;
  border-left: 3px dashed rgba(255, 255, 255, .34);
}
.hero-emblem { /* Vereinslogo als "Ball" auf der Platte */
  position: absolute; left: calc(66% + 5%); top: 50%; transform: translateY(-50%);
  width: 218px; height: 218px; border-radius: 50%; background: #fff;
  display: grid; place-items: center; overflow: hidden;
  box-shadow: 22px 30px 34px rgba(6, 20, 42, .4);
}
.hero-emblem img { display: block; height: 168px; width: auto; }
@media (max-width: 1080px) {
  .hero-emblem { left: auto; right: 5%; width: 180px; height: 180px; }
  .hero-emblem img { height: 138px; }
  .hero-netz { left: auto; right: calc(5% + 215px); }
  .hero-inner > * { max-width: 520px; }
}
@media (max-width: 820px) {
  .hero-netz, .hero-emblem { display: none; }
  .hero-inner { padding-top: 3rem; padding-bottom: 3.2rem; }
  .hero-inner > * { max-width: none; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block; font: inherit; font-weight: 700; font-size: .98rem; padding: .62rem 1.35rem;
  border-radius: 999px; border: 2px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .15s, background-color .15s, color .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-hell { background: #fff; color: var(--blau-tief); }
.btn-hell:hover { background: #ffe7e5; color: var(--blau-tief); }
.btn-rahmen { border-color: rgba(255, 255, 255, .7); color: #fff; }
.btn-rahmen:hover { border-color: #fff; background: rgba(255, 255, 255, .12); color: #fff; }

/* ---------- Bereiche der Startseite ---------- */

.bereich { padding-top: 2.8rem; padding-bottom: 3rem; }
.bereich--flaeche { background: var(--flaeche); border-top: 1px solid var(--rand); }
.bereich-titel {
  margin: 0 0 1.4rem; font-size: clamp(1.4rem, 3vw, 1.75rem); font-weight: 800;
  display: flex; align-items: center; gap: .65rem;
}
.bereich-titel::before { /* kleiner Ball als Markenzeichen */
  content: ""; width: .62em; height: .62em; border-radius: 50%; background: var(--akzent); flex-shrink: 0;
}

/* News-Karten */
.news-liste { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.news-karte {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--rand);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.news-karte:hover { border-color: #b9c8dc; box-shadow: var(--schatten); transform: translateY(-2px); }
.news-karte--gross { grid-column: 1 / -1; border-top: 4px solid var(--blau); }
.news-karte--gross.mit-bild { flex-direction: row; }
.news-karte--gross.mit-bild .news-bild { flex: 0 0 40%; }
.news-bild { display: block; background: var(--flaeche); }
.news-bild img { display: block; width: 100%; height: 100%; max-height: 260px; object-fit: cover; }
.news-karte--gross .news-bild img { max-height: none; min-height: 240px; }
.news-text { padding: 1.3rem 1.5rem 1.4rem; display: flex; flex-direction: column; flex: 1; min-width: 0; }
.news-datum { margin: 0 0 .3rem; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--akzent-dunkel); }
.news-karte h3 { margin: 0 0 .5rem; font-size: 1.22rem; }
.news-karte--gross h3 { font-size: clamp(1.4rem, 3vw, 1.75rem); }
.news-karte h3 a { color: var(--tinte); text-decoration: none; }
.news-karte h3 a:hover { color: var(--blau); }
.news-auszug { margin: 0 0 1rem; color: var(--text); }
.mehr { margin-top: auto; align-self: flex-start; font-weight: 700; text-decoration: none; color: var(--blau); }
.mehr:hover { color: var(--akzent-dunkel); }
.mehr span { display: inline-block; transition: transform .15s; }
.mehr:hover span { transform: translateX(3px); }

@media (max-width: 760px) {
  .news-liste { grid-template-columns: 1fr; }
  .news-karte--gross.mit-bild { flex-direction: column; }
  .news-karte--gross .news-bild img { min-height: 0; max-height: 260px; }
}

/* Kompakte Linklisten (ältere Meldungen, neueste Spielberichte) */
.aeltere-titel { margin: 2.2rem 0 .6rem; font-size: 1.05rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-hell); }
.aeltere { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rand); }
.aeltere li { display: flex; justify-content: space-between; align-items: baseline; gap: .3rem 1.5rem; flex-wrap: wrap; padding: .7rem .2rem; border-bottom: 1px solid var(--rand); }
.aeltere a { font-weight: 600; text-decoration: none; color: var(--tinte); }
.aeltere a:hover { color: var(--blau); text-decoration: underline; }
.aeltere time { font-size: .85rem; color: var(--text-hell); white-space: nowrap; }

/* Mannschafts-Kacheln */
.team-kacheln { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.team-kacheln a {
  display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.3rem;
  background: #fff; border: 1px solid var(--rand); border-radius: var(--radius);
  text-decoration: none; color: var(--tinte); font-weight: 700;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.team-kacheln a:hover { border-color: var(--blau); box-shadow: var(--schatten); transform: translateY(-2px); }
.team-nr {
  width: 2.6rem; height: 2.6rem; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; background: var(--blau); color: #fff; font-size: 1.25rem; font-weight: 800;
}
.team-pfeil { margin-left: auto; color: var(--akzent); font-size: 1.2rem; }
@media (max-width: 760px) { .team-kacheln { grid-template-columns: 1fr; } }

/* ---------- Unterseiten ---------- */

.seitenkopf { background: var(--flaeche); border-bottom: 1px solid var(--rand); padding: 1.6rem 0 1.5rem; }
.seitenkopf h1 { margin: .35rem 0 0; }
.seitenkopf-datum { margin: .5rem 0 0; font-size: .85rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--akzent-dunkel); }

.breadcrumbs { font-size: .85rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: "›"; margin-right: .35rem; color: var(--text-hell); }
.breadcrumbs a { color: var(--text-hell); text-decoration: none; }
.breadcrumbs a:hover { color: var(--blau); text-decoration: underline; }
.breadcrumbs [aria-current] { color: var(--tinte); font-weight: 600; }

.artikel { padding-top: 2rem; padding-bottom: 3.5rem; }
.artikel-inhalt > :first-child { margin-top: 0; }
.artikel-inhalt img { display: block; max-width: 100%; width: auto; height: auto; max-height: 560px; border-radius: 10px; }
.artikel-inhalt table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; font-size: .97rem; }
.artikel-inhalt th, .artikel-inhalt td { border: 1px solid var(--rand); padding: .5rem .75rem; text-align: left; vertical-align: top; }
.artikel-inhalt th { background: var(--blau-hell); color: var(--tinte); }
.artikel-inhalt tr:nth-child(even) td { background: #fafbfd; }
.artikel-inhalt hr { border: 0; border-top: 1px solid var(--rand); margin: 2rem 0; }
.artikel-inhalt iframe { max-width: 100%; }

.hinweis-box {
  border-left: 4px solid var(--akzent); background: var(--flaeche);
  padding: .9rem 1.2rem; border-radius: 0 10px 10px 0; margin: 0 0 1.6rem;
}
.hinweis-box p { margin: 0; }

/* Eingebettete Fremdinhalte (laden erst nach Klick) */
.extern { margin: 0 0 1.6rem; }
.extern-karte {
  border: 1px solid var(--rand); border-radius: var(--radius); background: var(--flaeche);
  padding: 1.6rem 1.5rem; text-align: center;
}
.extern-karte p { margin: 0 auto .9rem; max-width: 34em; }
.extern-karte .extern-klein { font-size: .88rem; color: var(--text-hell); margin-bottom: 0; }
.extern iframe { display: block; width: 100%; border: 1px solid var(--rand); border-radius: 10px; background: #fff; }
.extern-quelle { margin: .5rem 0 0; font-size: .88rem; }
.widerruf { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.widerruf-status { font-size: .92rem; color: var(--text-hell); }
.btn-blau { background: var(--blau); color: #fff; }
.btn-blau:hover { background: var(--blau-tief); color: #fff; }

/* Mannschaftsseiten: Liste der Spielberichte */
.team-einleitung { font-size: 1.12rem; margin: 0 0 1.5rem; }
.berichte { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.bericht {
  border: 1px solid var(--rand); border-left: 4px solid var(--blau); border-radius: 10px;
  padding: 1.05rem 1.3rem 1.1rem; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.bericht:hover { box-shadow: var(--schatten); border-left-color: var(--akzent); }
.bericht h3 { margin: 0 0 .35rem; font-size: 1.14rem; line-height: 1.3; }
.bericht h3 a { color: var(--tinte); text-decoration: none; }
.bericht h3 a:hover { color: var(--blau); }
.bericht p { margin: 0 0 .5rem; }

.artikel-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2.8rem; padding-top: 1.6rem; border-top: 1px solid var(--rand); }
.artikel-nav-link {
  display: flex; flex-direction: column; gap: .15rem; padding: .85rem 1rem; border: 1px solid var(--rand);
  border-radius: 10px; text-decoration: none; color: var(--tinte); font-weight: 600; line-height: 1.35;
}
.artikel-nav-link:hover { border-color: var(--blau); color: var(--blau); background: var(--blau-hell); }
.artikel-nav-link.rechts { text-align: right; grid-column: 2; }
.artikel-nav-richtung { font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-hell); }
@media (max-width: 560px) {
  .artikel-nav { grid-template-columns: 1fr; }
  .artikel-nav-link.rechts { grid-column: 1; text-align: left; }
  .artikel-nav > span:empty { display: none; }
}
.zurueck { margin: 1.6rem 0 0; font-weight: 700; }
.zurueck a::before { content: "← "; }

/* ---------- Bildergalerie ---------- */

.alben { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.2rem; }
.album-karte {
  display: block; border: 1px solid var(--rand); border-radius: var(--radius); overflow: hidden;
  text-decoration: none; color: var(--tinte); background: #fff;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.album-karte:hover { border-color: var(--blau); box-shadow: var(--schatten); transform: translateY(-2px); }
.album-karte img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; height: auto; }
.album-info { display: flex; flex-direction: column; padding: .85rem 1.1rem 1rem; }
.album-titel { font-weight: 800; font-size: 1.1rem; line-height: 1.3; }
.album-meta { font-size: .85rem; color: var(--text-hell); }
.album-beschreibung { margin-top: 0; }

.galerie { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem; align-items: start; }
.galerie-titel { display: block; font-size: .85rem; line-height: 1.35; color: var(--text-hell); padding: .35rem .15rem 0; }
.lk-titel { position: absolute; bottom: 2.4rem; left: 1rem; right: 1rem; text-align: center; margin: 0; font-weight: 600; }
.galerie a { display: block; border-radius: 8px; overflow: hidden; background: var(--flaeche); }
.galerie img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; height: auto; transition: transform .2s; }
.galerie a:hover img { transform: scale(1.04); }
@media (max-width: 480px) { .galerie { grid-template-columns: repeat(2, 1fr); } }

.lichtkasten {
  border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: none; max-height: none;
  background: rgba(6, 14, 28, .94); color: #fff;
}
.lichtkasten::backdrop { background: rgba(6, 14, 28, .94); }
.lichtkasten[open] { display: flex; align-items: center; justify-content: center; }
.lichtkasten img { max-width: calc(100vw - 2rem); max-height: calc(100vh - 5.5rem); object-fit: contain; border-radius: 6px; }
.lichtkasten button {
  position: absolute; border: 0; cursor: pointer; color: #fff; background: rgba(255, 255, 255, .14);
  width: 46px; height: 46px; border-radius: 50%; font-size: 1.5rem; line-height: 1; display: grid; place-items: center;
}
.lichtkasten button:hover { background: var(--akzent); }
.lk-zu { top: .8rem; right: .8rem; }
.lk-zurueck { left: .8rem; top: 50%; transform: translateY(-50%); }
.lk-weiter { right: .8rem; top: 50%; transform: translateY(-50%); }
.lk-zaehler { position: absolute; bottom: .9rem; left: 0; right: 0; text-align: center; margin: 0; font-size: .9rem; color: rgba(255, 255, 255, .8); }

/* ---------- Suche ---------- */

.suche-seite #pagefind-ui { margin-top: 1.2rem; --pagefind-ui-primary: #14457f; --pagefind-ui-font: inherit; }

/* ---------- Footer ---------- */

.site-footer { background: var(--tinte); color: rgba(255, 255, 255, .72); font-size: .93rem; border-top: 4px solid var(--akzent); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem 2rem; padding-top: 1.7rem; padding-bottom: 1.3rem; }
.footer-inner p { margin: 0; }
.footer-name { color: #fff; font-weight: 800; font-size: 1.05rem; }
.footer-nav { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: 0; padding: 0; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: #ffb6b1; text-decoration: underline; }
.footer-copy { border-top: 1px solid rgba(255, 255, 255, .12); padding-top: .9rem; padding-bottom: 1.1rem; font-size: .82rem; color: rgba(255, 255, 255, .55); }
.footer-copy p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

@media print {
  .site-header, .site-footer, .artikel-nav, .zurueck, .hero-ball, .hero-netz { display: none; }
  .hero { background: none; color: #000; }
  .hero h1 { color: #000; }
}
