/* Tischtennis SV Allensbach – statische Webseiten */
:root {
  --blue: #1f4fa3;
  --blue-dark: #163a7a;
  --blue-deep: #0f2a5a;
  --blue-light: #e9f0fb;
  --yellow: #f8dc3b;
  --yellow-soft: #fff7cc;
  --text: #1d2433;
  --muted: #5b6474;
  --line: #dde3ec;
  --bg: #f4f6fa;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 42, 90, .06), 0 6px 20px rgba(15, 42, 90, .07);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--blue); text-underline-offset: 2px; }
a:hover { color: var(--blue-dark); }

h1, h2, h3 { line-height: 1.25; color: var(--blue-deep); }
h1 { font-size: 2rem; margin: 0 0 .25em; }
h2 { font-size: 1.4rem; margin: 0 0 .6em; }
h3 { font-size: 1.1rem; margin: 1.2em 0 .4em; }
p { margin: 0 0 1em; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Kopfbereich ---------- */
.site-header {
  background:
    linear-gradient(90deg, rgba(15, 42, 90, .92) 0%,
      rgba(31, 79, 163, .78) 55%, rgba(31, 79, 163, .35) 100%),
    url("../img/head_netz.png") center / cover no-repeat;
  color: #fff;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-top: 26px;
  padding-bottom: 26px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #fff;
  text-decoration: none;
}
.brand:hover { color: #fff; }
.brand img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}
.brand-text strong {
  display: block;
  font-size: 1.55rem;
  letter-spacing: .01em;
}
.brand-text span {
  display: block;
  opacity: .88;
  font-size: .95rem;
}

/* ---------- Navigation ---------- */
.nav {
  background: var(--blue-deep);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}
.nav .wrap { position: relative; }
.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}
.nav a {
  display: block;
  padding: 13px 16px;
  color: #dfe7f5;
  text-decoration: none;
  font-weight: 500;
  font-size: .97rem;
  border-bottom: 3px solid transparent;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav a[aria-current="page"] {
  color: #fff;
  border-bottom-color: var(--yellow);
}
.nav-toggle { display: none; }
.nav-toggle-label {
  display: none;
  cursor: pointer;
  color: #fff;
  padding: 12px 0;
  font-weight: 600;
  user-select: none;
}
.nav-toggle-label .bars,
.nav-toggle-label .bars::before,
.nav-toggle-label .bars::after {
  display: inline-block;
  width: 20px;
  height: 2px;
  background: #fff;
  position: relative;
  vertical-align: middle;
  content: "";
}
.nav-toggle-label .bars { margin-right: 10px; }
.nav-toggle-label .bars::before { position: absolute; top: -6px; left: 0; }
.nav-toggle-label .bars::after { position: absolute; top: 6px; left: 0; }

/* ---------- Unternavigation ---------- */
.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}
.subnav a {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  text-decoration: none;
  font-size: .92rem;
  color: var(--blue-dark);
}
.subnav a:hover { border-color: var(--blue); }
.subnav a[aria-current="page"] {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* ---------- Inhalt ---------- */
main { padding: 34px 0 56px; }

.page-head { margin-bottom: 18px; }
.page-head p.lead { color: var(--muted); font-size: 1.08rem; margin: 0; }
.eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: .3em;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
}
.stack > * + * { margin-top: 24px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 28px;
}
.card > :last-child { margin-bottom: 0; }
.card.accent { border-top: 4px solid var(--yellow); }
.card.blue {
  background: linear-gradient(160deg, var(--blue) 0%, var(--blue-deep) 100%);
  color: #fff;
}
.card.blue h2, .card.blue h3 { color: #fff; }
.card.blue a { color: var(--yellow); }

.callout {
  background: var(--yellow-soft);
  border-left: 4px solid var(--yellow);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 0 0 1em;
}
.callout > :last-child { margin-bottom: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
}
.btn:hover { background: var(--blue-dark); color: #fff; }
.btn.yellow,
.card.blue .btn.yellow { background: var(--yellow); color: var(--blue-deep); }
.btn.yellow:hover { background: #ecd02a; color: var(--blue-deep); }

/* ---------- Startseite ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 0;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 28px;
}
.hero-text { padding: 34px 34px 30px; }
.hero-text h1 { font-size: 2.1rem; }
.hero-img { min-height: 260px; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}
.tile {
  display: block;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 22px 20px;
  text-decoration: none;
  color: var(--text);
  border-top: 4px solid var(--blue);
  transition: transform .15s ease, box-shadow .15s ease;
}
.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(15, 42, 90, .08),
    0 12px 28px rgba(15, 42, 90, .12);
  color: var(--text);
}
.tile h3 { margin: 0 0 .35em; color: var(--blue-deep); }
.tile p { margin: 0; color: var(--muted); font-size: .95rem; }
.tile .more {
  display: inline-block;
  margin-top: .8em;
  color: var(--blue);
  font-weight: 600;
  font-size: .92rem;
}

/* ---------- Zeiten ---------- */
.times { display: grid; gap: 12px; margin: 0 0 1em; }
.time {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--blue-light);
}
.time .who { font-weight: 700; color: var(--blue-deep); }
.time .when strong { color: var(--blue-deep); }
.time .where { color: var(--muted); font-size: .94rem; }

/* ---------- Personen ---------- */
.people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
  align-items: start;
}
.person {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.person .photo {
  aspect-ratio: 4 / 4.4;
  background: var(--blue-light);
  overflow: hidden;
}
.person .photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}
.person .photo.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  font-size: 2.6rem;
  font-weight: 700;
  aspect-ratio: auto;
  height: 120px;
}
.person .info { padding: 18px 20px 20px; font-size: .95rem; }
.person .role {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--blue);
}
.person .name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--blue-deep);
  margin: .15em 0 .5em;
}
.person p { margin: 0; }
.person a { word-break: break-word; }

/* ---------- Spielstätten ---------- */
.venue {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.venue img { border-radius: 10px; width: 100%; }
.venue h2 { margin-bottom: .3em; }
.venue .addr { color: var(--muted); }

table.plain {
  border-collapse: collapse;
  width: 100%;
  font-size: .96rem;
}
table.plain th, table.plain td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.plain th { color: var(--blue-deep); white-space: nowrap; }

/* ---------- Termine ---------- */
.events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
  max-width: 820px;
}
.event {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.event-date {
  background: var(--blue);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px 8px;
  border-right: 4px solid var(--yellow);
}
.event-date .day { font-size: 1.45rem; font-weight: 700; line-height: 1.15; }
.event-date .month { font-size: .85rem; opacity: .9; }
.event-text { padding: 18px 22px; }
.event-text h2 { font-size: 1.2rem; margin: 0 0 .2em; }
.event-text p { margin: 0; }
.event-text .event-when { color: var(--muted); font-size: .95rem; }
.event-text .event-when + p { margin-top: .4em; }

/* ---------- Mannschaften ---------- */
.team-gruppe { margin: 8px 0 14px; }
.team-gruppe ~ .team-gruppe { margin-top: 32px; }
.teams {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.team-card {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  text-decoration: none;
  color: var(--text);
  border-top: 4px solid var(--blue);
  transition: transform .15s ease, box-shadow .15s ease;
}
.team-card:hover {
  transform: translateY(-2px);
  color: var(--text);
  box-shadow: 0 2px 4px rgba(15, 42, 90, .08),
    0 12px 28px rgba(15, 42, 90, .12);
}
.team-card .rang {
  flex: none;
  width: 64px;
  border-radius: 10px;
  background: var(--yellow);
  color: var(--blue-deep);
  text-align: center;
  font-size: .75rem;
  font-weight: 600;
  padding: 8px 4px 6px;
}
.team-card .rang span {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
}
.team-info { min-width: 0; }
.team-info h3 { margin: 0 0 .1em; color: var(--blue-deep); }
.team-info p { margin: 0 0 .3em; font-size: .93rem; }
.team-info .liga-name { color: var(--blue); font-weight: 600; }
.team-info .next { color: var(--muted); margin-top: .5em; }

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding: 0 4px;
}
table.liga, table.spiele {
  border-collapse: collapse;
  width: 100%;
  font-size: .95rem;
}
table.liga th, table.liga td,
table.spiele th, table.spiele td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.liga th, table.spiele th {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  white-space: nowrap;
}
table.liga .num, table.spiele .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
table.liga td.pkt { font-weight: 700; color: var(--blue-deep); }
table.liga td:nth-child(2) { min-width: 180px; }
table.liga tr.eigen td { background: var(--yellow-soft); }
table.liga tr.aufstieg td:first-child { box-shadow: inset 4px 0 #2e9d5b; }
table.liga tr.relegation-auf td:first-child {
  box-shadow: inset 4px 0 #9fd3b2;
}
table.liga tr.relegation-ab td:first-child {
  box-shadow: inset 4px 0 #f0b8b0;
}
table.liga tr.abstieg td:first-child { box-shadow: inset 4px 0 #d2483c; }
.legende {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: .85rem;
  color: var(--muted);
  margin: 12px 0 0;
}
.legende span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
}
.legende-aufstieg::before { background: #2e9d5b; }
.legende-relegation-auf::before { background: #9fd3b2; }
.legende-relegation-ab::before { background: #f0b8b0; }
.legende-abstieg::before { background: #d2483c; }
.hinweis { font-size: .85rem; color: var(--muted); margin: 8px 0 0; }

table.spiele td.datum { white-space: nowrap; }
table.spiele .uhrzeit, table.spiele td.halle {
  color: var(--muted);
  font-size: .9rem;
}
.ergebnis {
  display: inline-block;
  min-width: 3.4em;
  text-align: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
}
a.ergebnis { text-decoration: none; }
a.ergebnis:hover { text-decoration: underline; filter: brightness(.95); }
a.ergebnis::after { content: " \2197"; font-size: .75em; font-weight: 400; }
.ergebnis.sieg { background: #dff3e6; color: #1d6b3d; }
.ergebnis.niederlage { background: #fbe3e0; color: #9b2c22; }
.ergebnis.remis { background: #eceff4; color: #3c4658; }
.stand { font-size: .88rem; color: var(--muted); margin: 18px 0 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--blue-deep);
  color: #c9d4ea;
  font-size: .92rem;
  padding: 26px 0;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
}
.site-footer a { color: #fff; }

/* ---------- Berichte ---------- */
.aktuell {
  display: block;
  background: var(--yellow-soft);
  border-left: 4px solid var(--yellow);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 22px;
  margin-bottom: 28px;
  color: var(--text);
  text-decoration: none;
}
.aktuell:hover { color: var(--text); filter: brightness(.98); }
.aktuell .eyebrow { display: block; }
.aktuell strong { color: var(--blue-deep); }
.aktuell .more { color: var(--blue); font-weight: 600; white-space: nowrap; }
.bericht-datum { color: var(--muted); font-size: .95rem; margin: 0 0 .2em; }
.tile .bericht-datum { margin: 0 0 .4em; font-size: .88rem; }
.tiles.berichte {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.tile.mit-bild { padding: 0; overflow: hidden; }
.tile.mit-bild img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.tile.mit-bild .tile-text { padding: 18px 22px 20px; }
figure { margin: 0; }
figure img { border-radius: 10px; width: 100%; }
figcaption {
  color: var(--muted);
  font-size: .9rem;
  margin-top: 8px;
}
.figure-wide { margin: 0 0 1.4em; }
.sieger {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 1.4em 0;
}
.sieger img { aspect-ratio: 3 / 4; object-fit: cover; }
.podest {
  list-style: none;
  margin: 0 0 1em;
  padding: 0;
  display: grid;
  gap: 8px;
}
.podest li {
  display: grid;
  grid-template-columns: 2.4em minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.podest .platz {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2em;
  height: 2.2em;
  border-radius: 50%;
  font-weight: 700;
  background: var(--blue-light);
  color: var(--blue-deep);
}
.podest li:first-child .platz { background: var(--yellow); }
.card.blue .podest .platz { background: rgba(255, 255, 255, .16); color: #fff; }
.card.blue .podest li:first-child .platz {
  background: var(--yellow);
  color: var(--blue-deep);
}
details.einzel { margin-top: 14px; }
details.einzel summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 600;
}
details.einzel[open] summary { margin-bottom: 8px; }
table.liga td .satz { color: var(--muted); font-size: .88rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-img { min-height: 0; max-height: 260px; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  h1, .hero-text h1 { font-size: 1.6rem; }
  .card { padding: 20px 18px; }
  .hero-text { padding: 24px 20px; }
  .site-header .wrap { padding-top: 18px; padding-bottom: 18px; }
  .brand img { width: 56px; height: 56px; }
  .brand-text strong { font-size: 1.2rem; }
  .brand-text span { font-size: .85rem; }

  .nav-toggle-label { display: block; }
  .nav ul { display: none; flex-direction: column; padding-bottom: 8px; }
  .nav-toggle:checked ~ ul { display: flex; }
  .nav a { padding: 10px 4px; border-bottom: 0; border-left: 3px solid
    transparent; padding-left: 12px; }
  .nav a[aria-current="page"] { border-left-color: var(--yellow); }

  .time { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .venue { grid-template-columns: minmax(0, 1fr); }
  .event { grid-template-columns: 92px minmax(0, 1fr); }
  .teams { grid-template-columns: minmax(0, 1fr); }
  .sieger { gap: 10px; }
  table.liga { font-size: .9rem; }
  table.liga th, table.liga td { padding: 7px 5px; }
  table.liga td:nth-child(2) { min-width: 0; }
  table.liga th:nth-child(3), table.liga td:nth-child(3),
  table.liga th:nth-child(7), table.liga td:nth-child(7),
  table.liga th:nth-child(8), table.liga td:nth-child(8) { display: none; }

  table.spiele, table.spiele tbody { display: block; }
  table.spiele thead { display: none; }
  table.spiele tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }
  table.spiele td { border: 0; padding: 1px 0; }
  table.spiele td.datum {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: .86rem;
  }
  table.spiele td.datum br { display: none; }
  table.spiele td.datum .uhrzeit::before { content: " · "; }
  table.spiele td:nth-child(2), table.spiele td:nth-child(3) {
    grid-column: 1;
  }
  table.spiele td.num { grid-column: 2; grid-row: 2 / 4; align-self: center; }
  table.spiele td.halle { grid-column: 1 / -1; font-size: .86rem; }
  .event-date .day { font-size: 1.15rem; }
}

@media print {
  .nav, .subnav { display: none; }
  .card, .person, .tile { box-shadow: none; border: 1px solid #ccc; }
}
