/* Turnierkalender (mod_tsg_kalender) – Farben und Schriften aus user.css (--tsg-*), mit Rückfallwerten */

.tsg-kal { --kal-navy: var(--tsg-navy, #0B2545); --kal-grau: var(--tsg-grau, #5B6B80); --kal-linie: var(--tsg-linie, #E3DCCF); }

/* [hidden] gilt auch für Kacheln und Leiste mit display:flex */
.tsg-kal [hidden] { display: none !important; }

/* Filter */
.tsg-kal__filter { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 0 0 28px 0; }
.tsg-kal__wahl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tsg-kal__wahlname { margin-right: 2px; font-size: 14px; font-weight: 600; color: var(--kal-grau); }
.tsg-kal__knopf {
  padding: 7px 14px;
  border: 1.5px solid var(--tsg-rand, #D6CDBD);
  border-radius: 999px;
  background: #ffffff;
  color: var(--kal-navy);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}
.tsg-kal__knopf:hover { border-color: var(--kal-navy); }
.tsg-kal__knopf[aria-pressed="true"] { border-color: var(--kal-navy); background: var(--kal-navy); color: #ffffff; }
.tsg-kal__knopf:focus-visible { outline: 3px solid var(--tsg-akzent, #E1263A); outline-offset: 2px; }
.tsg-kal__monatswahl { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 600; color: var(--kal-grau); }
.tsg-kal__monatswahl select {
  padding: 7px 12px;
  border: 1.5px solid var(--tsg-rand, #D6CDBD);
  border-radius: 10px;
  background: #ffffff;
  color: var(--kal-navy);
  font: inherit;
  font-weight: 600;
}

/* Monate */
.tsg-kal__monat + .tsg-kal__monat { margin-top: 40px; }
.tsg-kal .tsg-kal__monatskopf { margin: 0 0 16px 0; font-family: var(--tsg-display, inherit); font-size: 24px; color: var(--kal-navy); }
.tsg-kal__raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 20px; }
.tsg-kal__leer, .tsg-kal__keine { color: var(--kal-grau); }

/* Kachel */
.tsg-kal__kachel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 22px 24px;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: var(--tsg-schatten, 0 1px 2px rgba(14, 27, 46, .06), 0 8px 24px rgba(14, 27, 46, .06));
  scroll-margin-top: 100px;
}
.tsg-kal__kachel:target { outline: 3px solid var(--tsg-akzent, #E1263A); outline-offset: 3px; }
.tsg-kal .tsg-kal__termin { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: .02em; color: var(--tsg-akzent-dunkel, #B0122A); }
.tsg-kal__uhr { margin-left: 8px; padding-left: 8px; border-left: 1px solid var(--kal-linie); font-weight: 600; color: var(--kal-grau); white-space: nowrap; }
.tsg-kal .tsg-kal__spieltage { margin: 2px 0 0 0; font-size: 13px; color: var(--kal-grau); }
.tsg-kal .tsg-kal__chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0 0; }
.tsg-kal__chip--anfaenger { background: #E3F1E5; color: #1F5A2E; }
.tsg-kal__chip--fortgeschrittene { background: #ECE6F6; color: #45306E; }
.tsg-kal .tsg-kal__name { margin: 12px 0 0 0; font-family: var(--tsg-display, inherit); font-size: 20px; font-weight: 700; line-height: 1.2; color: var(--kal-navy); }
.tsg-kal .tsg-kal__ort { margin: 6px 0 0 0; font-size: 15px; line-height: 1.45; color: var(--tsg-text-2, #34445A); }
.tsg-kal .tsg-kal__text { margin: 12px 0 0 0; font-size: 15px; line-height: 1.55; }
.tsg-kal__tipp { align-self: stretch; margin: 14px 0 0 0; padding: 12px 14px; border-left: 4px solid var(--tsg-akzent, #E1263A); border-radius: 0 12px 12px 0; background: var(--tsg-rosa, #FCE8EA); }
.tsg-kal .tsg-kal__tipp p { margin: 0; font-size: 15px; line-height: 1.5; }
.tsg-kal .tsg-kal__tipp .tsg-kal__tippkopf { margin-bottom: 2px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tsg-akzent-dunkel, #B0122A); }

.tsg-kal__angaben { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-self: stretch; margin: 16px 0 0 0; padding-top: 14px; border-top: 1px solid var(--kal-linie); font-size: 14px; }
.tsg-kal__angaben dt { font-size: 12px; font-weight: 700; letter-spacing: .08em; line-height: 1.9; text-transform: uppercase; color: var(--kal-grau); }
.tsg-kal__angaben dd { margin: 0; line-height: 1.6; color: var(--tsg-tinte, #0E1B2E); overflow-wrap: anywhere; }

.tsg-kal__knoepfe { margin-top: auto; padding-top: 18px; gap: 10px; }
.tsg-kal .tsg-kal__knoepfe .tsg-knopf { height: 44px; padding: 0 18px; font-size: 14px; text-decoration: none; }
.tsg-kal .tsg-kal__hinweis { margin: auto 0 0 0; padding-top: 16px; font-size: 14px; color: var(--kal-grau); }

/* einzelne Kachel außerhalb des Kalenders */
.tsg-kal--einzeln { max-width: 480px; }

/* Umschalter Kacheln/Liste: rechts in der Leiste */
.tsg-kal__ansicht { margin-left: auto; }
.tsg-kal__mehr { display: none; }

/* ===== Listenansicht: eine Zeile je Turnier, Details zum Aufklappen ===== */
.tsg-kal--liste .tsg-kal__raster {
  display: block;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: var(--tsg-schatten, 0 1px 2px rgba(14, 27, 46, .06), 0 8px 24px rgba(14, 27, 46, .06));
  overflow: hidden;
}
.tsg-kal--liste .tsg-kal__kachel {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr) auto;
  column-gap: 24px;
  align-items: start;
  padding: 16px 24px;
  border-radius: 0;
  box-shadow: none;
}
.tsg-kal--liste .tsg-kal__kachel + .tsg-kal__kachel { border-top: 1px solid var(--kal-linie); }
.tsg-kal--liste .tsg-kal__kachel:target { outline-offset: -3px; }
/* Termin (mit Uhrzeit darunter) neben Name und Ort, damit der Ort nicht nach unten rutscht */
.tsg-kal--liste .tsg-kal__termin { grid-column: 1; grid-row: 1 / span 2; padding-top: 3px; }
.tsg-kal--liste .tsg-kal__uhr { display: block; margin: 2px 0 0 0; padding: 0; border: 0; }
.tsg-kal--liste .tsg-kal__spieltage { grid-column: 1; grid-row: 3; }
.tsg-kal--liste .tsg-kal__name { grid-column: 2; grid-row: 1; margin: 0; font-size: 18px; cursor: pointer; }
.tsg-kal--liste .tsg-kal__name:hover { text-decoration: underline; text-underline-offset: 3px; }
.tsg-kal--liste .tsg-kal__ort { grid-column: 2; grid-row: 2; margin-top: 2px; font-size: 14px; }
.tsg-kal--liste .tsg-kal__chips { grid-column: 2; grid-row: 3; margin-top: 8px; }
.tsg-kal--liste .tsg-kal__mehr {
  display: inline-flex;
  grid-column: 3;
  grid-row: 1 / span 3;
  align-self: center;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1.5px solid var(--tsg-rand, #D6CDBD);
  border-radius: 999px;
  background: #ffffff;
  color: var(--kal-navy);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}
.tsg-kal--liste .tsg-kal__mehr::after { content: "▾"; font-size: 12px; transition: transform .15s; }
.tsg-kal--liste .tsg-kal__mehr[aria-expanded="true"]::after { transform: rotate(180deg); }
.tsg-kal--liste .tsg-kal__mehr:hover { border-color: var(--kal-navy); }
.tsg-kal--liste .tsg-kal__mehr:focus-visible { outline: 3px solid var(--tsg-akzent, #E1263A); outline-offset: 2px; }

/* zugeklappt: nur Termin, Name, Ort, Kennzeichen */
.tsg-kal--liste .tsg-kal__kachel:not(.tsg-kal__kachel--offen) :is(.tsg-kal__adresse, .tsg-kal__text, .tsg-kal__tipp, .tsg-kal__angaben, .tsg-kal__knoepfe, .tsg-kal__hinweis) { display: none; }
/* aufgeklappt: Details unter Name und Ort */
.tsg-kal--liste .tsg-kal__text { grid-column: 2 / span 2; grid-row: 4; }
.tsg-kal--liste .tsg-kal__tipp { grid-column: 2 / span 2; grid-row: 5; }
.tsg-kal--liste .tsg-kal__angaben { grid-column: 2 / span 2; grid-row: 6; }
.tsg-kal--liste .tsg-kal__knoepfe, .tsg-kal--liste .tsg-kal__hinweis { grid-column: 2 / span 2; grid-row: 7; padding-top: 14px; }
.tsg-kal--liste .tsg-kal__kachel--offen { background: var(--tsg-creme, #FBF8F3); }

@media (max-width: 600px) {
  .tsg-kal__kachel { padding: 18px 18px; border-radius: 16px; }
  .tsg-kal .tsg-kal__name { font-size: 18px; }
  .tsg-kal__monat + .tsg-kal__monat { margin-top: 32px; }
  .tsg-kal__filter { gap: 10px; }
  .tsg-kal__ansicht { margin-left: 0; }

  /* Liste auf dem Handy: alles untereinander, Knopf rechts neben dem Termin */
  .tsg-kal--liste .tsg-kal__raster { border-radius: 16px; }
  .tsg-kal--liste .tsg-kal__kachel { grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 14px 16px; border-radius: 0; }
  .tsg-kal--liste .tsg-kal__termin { grid-column: 1; grid-row: 1; padding-top: 0; }
  .tsg-kal--liste .tsg-kal__uhr { display: inline; margin-left: 8px; padding-left: 8px; border-left: 1px solid var(--kal-linie); }
  .tsg-kal--liste .tsg-kal__spieltage { grid-column: 1 / span 2; grid-row: 2; }
  .tsg-kal--liste .tsg-kal__name { grid-column: 1 / span 2; grid-row: 3; margin-top: 6px; font-size: 17px; }
  .tsg-kal--liste .tsg-kal__ort { grid-column: 1 / span 2; grid-row: 4; }
  .tsg-kal--liste .tsg-kal__chips { grid-column: 1 / span 2; grid-row: 5; }
  .tsg-kal--liste .tsg-kal__mehr { grid-column: 2; grid-row: 1; align-self: start; padding: 5px 12px; }
  .tsg-kal--liste .tsg-kal__text { grid-column: 1 / span 2; grid-row: 6; }
  .tsg-kal--liste .tsg-kal__tipp { grid-column: 1 / span 2; grid-row: 7; }
  .tsg-kal--liste .tsg-kal__angaben { grid-column: 1 / span 2; grid-row: 8; }
  .tsg-kal--liste .tsg-kal__knoepfe, .tsg-kal--liste .tsg-kal__hinweis { grid-column: 1 / span 2; grid-row: 9; }
}

@media print {
  .tsg-kal__filter, .tsg-kal__knoepfe, .tsg-kal__mehr { display: none !important; }
  .tsg-kal__kachel { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}
