/* =======================================
   Grundlayout & Tabellen
   ======================================= */
table {
  width: 100%;
}

/* =======================================
   Farb- und Themenbereiche
   Button- und Linkfarben allgemein
   ======================================= */
button#stammtisch, a#stammtisch { background: lemonchiffon; }
button#meet, a#meet             { background: #99d1c8; }
button#mata, a#mata             { background: #ffcb06; }

button#fledermaus, a#fledermaus {
  background: var(--mausbg);
  color: var(--maustext);
}
button#cage, a#cage {
  background: var(--cagebg);
  color: var(--cagetext);
}
button#vogel, a#vogel {
  background: var(--vogelbg);
  color: var(--vogeltext);
}

button#fuehrung, a#fuehrung   { background: lightblue; }
button#verein, a#verein       { background: violet; }
button#theater, a#theater     { background: var(--gpthellgruen); color: #000; }
button#mut, a#mut             { background: var(--mut); color: #000; }
button#fahrt, a#fahrt         { background: lightcoral; }
button#liebestrank, a#liebestrank { background: lightcoral; }

/* =======================================
   Links im Fließtext wie normaler Text
   ======================================= */
a.termin2,
a.termin2:visited,
a.termin2:hover,
a.termin2:active {
  color: inherit !important;
  text-decoration: none !important;
  font-weight: inherit !important;
  cursor: pointer;
}

div#beschreibung a.termin2 {
  text-decoration: none !important;
}

a.termin2:focus-visible {
  outline: 2px dotted currentColor;
  outline-offset: 2px;
  text-decoration: none !important;
}

/* =======================================
   Beitrags-Tabellen
   ======================================= */
table#beitrag {
  max-width: 50em;
}
table#beitrag tr {
  background: var(--gptgelb);
  color: #000;
}
th.beitrag,
td.beitrag {
  text-align: right;
}

/* =======================================
   Terminstruktur allgemein
   ======================================= */
div#termin_titel {
  text-transform: uppercase;
  text-align: center;
  font-size: 30px;
  font-weight: bold;
}

div#termin_person,
div#termin_person a {
  text-transform: uppercase;
  text-align: center;
  font-size: 30px;
  font-weight: bold;
  color: darkgoldenrod;
  text-decoration: none;
}

div#termin_untertitel {
  text-align: center;
  font-size: 16px;
}

div#ort,
div#ort a {
  text-align: center;
  font-size: 16px;
}

/* =======================================
   Beschreibung
   ======================================= */
div#beschreibung {
  font-size: 15px;
  line-height: 1.45;
  text-align: left;
  font-weight: normal;
  padding: 0.5em 0.5em 0.5em 0;
}

div#beschreibung br {
  display: block;
  content: "";
  margin-bottom: 0.7em;
}

/* =======================================
   Zusatzelemente
   ======================================= */
figcaption,
div#foto {
  font-size: 10px;
  text-align: center;
}

div#fehler {
  color: red;
}

td > .uhrzeit {
  font-size: 12px;
  opacity: 0.85;
}

/* =======================================
   Karten-Tabellen (responsiv)
   ======================================= */
@media all {
  table#karte {
    max-width: 70em;
  }
  table#karte tr {
    color: #000;
    background: var(--gptbasis);
  }
  th#karte,
  td#karte {
    text-align: right;
  }

  table#karte2 {
    max-width: 70em;
  }
  table#karte2 tr {
    color: #000;
    background: var(--gptgelb);
  }
  th#karte2,
  td#karte2 {
    text-align: right;
  }
}

#kartenpreise th {
  text-align: left;
}

@media all and (min-width: 70em) {
  table#karte,
  table#karte2 {
    max-width: 30em;
  }
}

/* =======================================
   termin2 im Kasten: niemals unterstreichen
   ======================================= */
td a.termin2,
td a.termin2:visited,
td a.termin2:hover,
td a.termin2:active {
  text-decoration: none !important;
  color: inherit !important;
  display: block;
}

td a.termin2 * {
  text-decoration: none !important;
}

td a.termin2:focus-visible {
  outline: 2px dotted currentColor;
  outline-offset: 2px;
  text-decoration: none !important;
}

/* =======================================
   Terminliste – Datumsbox
   ======================================= */
.termin-datum-spalte {
  vertical-align: top;
  padding: 8px 10px 8px 0;
}

.termin-datum-box {
  display: inline-block;
  min-width: 92px;
  padding: 10px 8px;
  text-align: center;
  border-radius: 14px;
  background: #f6f3eb;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}

.termin-tag {
  font-size: 2rem;
  line-height: 1;
  font-weight: 700;
  margin-bottom: 4px;
  color: #222;
}

.termin-monat {
  font-size: 0.95rem;
  line-height: 1.2;
  font-weight: 600;
  color: #444;
}

.termin-jahr {
  font-size: 0.85rem;
  line-height: 1.2;
  color: #666;
  margin-top: 1px;
}

.termin-wochentag {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a6d3b;
  margin-bottom: 6px;
}

.termin-uhrzeit {
  margin-top: 8px;
  padding-top: 7px;
  font-size: 0.82rem;
  line-height: 1.25;
  color: #333;
  border-top: 1px solid rgba(0,0,0,0.08);
}

/* =======================================
   Terminbutton / Tooltip
   ======================================= */
.terminbutton-wrap {
  margin-top: 10px;
  text-align: center;
  position: relative;
  display: inline-block;
  vertical-align: middle;
}

.terminbutton {
  max-width: 88px;
  height: auto;
  display: inline-block;
}

.terminbutton-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  min-width: 180px;
  max-width: 260px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(20,20,20,0.95);
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
  z-index: 100;
}

.terminbutton-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(20,20,20,0.95);
}

.terminbutton-wrap:hover .terminbutton-tooltip,
.terminbutton-wrap:focus .terminbutton-tooltip,
.terminbutton-wrap:focus-within .terminbutton-tooltip {
  opacity: 1;
  visibility: visible;
}

/* =======================================
   TERMINLISTE (main_termine_25.php)
   Farbe auf der Inhaltszelle
   ======================================= */
#termin td.termin-inhalt-zelle {
  border-radius: 18px;
  overflow: hidden;
}

#termin td.termin-inhalt-zelle > a.termin2 {
  display: block;
  border-radius: inherit;
  overflow: hidden;
  height: 100%;
}

/* Terminfarben in der Liste */
#termin td.termin-inhalt-zelle#stammtisch { background: lemonchiffon; }
#termin td.termin-inhalt-zelle#meet       { background: #99d1c8; }
#termin td.termin-inhalt-zelle#mata       { background: #ffcb06; }

#termin td.termin-inhalt-zelle#fledermaus {
  background: var(--mausbg);
  color: var(--maustext);
}
#termin td.termin-inhalt-zelle#fledermaus a {
  color: var(--maustext);
}

#termin td.termin-inhalt-zelle#cage {
  background: var(--cagebg);
  color: var(--cagetext);
}
#termin td.termin-inhalt-zelle#cage a,
#termin td.termin-inhalt-zelle#cage h3,
#termin td.termin-inhalt-zelle#cage h4 {
  color: var(--cagetext);
}

#termin td.termin-inhalt-zelle#vogel {
  background: var(--vogelbg);
  color: var(--vogeltext);
}
#termin td.termin-inhalt-zelle#vogel a {
  color: var(--vogeltext);
}

#termin td.termin-inhalt-zelle#fuehrung   { background: lightblue; }
#termin td.termin-inhalt-zelle#verein     { background: violet; }

#termin td.termin-inhalt-zelle#theater {
  background: var(--gpthellgruen);
  color: #000;
}
#termin td.termin-inhalt-zelle#mut {
  background: var(--mut);
  color: #000;
}

#termin td.termin-inhalt-zelle#fahrt       { background: lightcoral; }
#termin td.termin-inhalt-zelle#liebestrank { background: lightcoral; }
#termin td.termin-inhalt-zelle#fremdgehen  { background: lightyellow; }

#termin td.termin-inhalt-zelle#meet h3.termin,
#termin td.termin-inhalt-zelle#meet #termin_titel {
  color: var(--gptlogofarbe);
}

/* =======================================
   TERMINDETAILSEITE (main_termin_25.php)
   Zelle neutral, Farbe auf .termin-head
   ======================================= */
#termin td {
  vertical-align: top;
}

#termin .termin-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
  border: 1px solid rgba(91,59,135,0.18);
  border-left: 4px solid var(--gptlogofarbe, #5B3B87);
  border-radius: 14px;
  padding: 14px 16px;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  overflow: hidden;
}

#termin .termin-head.has-button {
  grid-template-columns: minmax(0, 1fr) 154px;
}

#termin .termin-head__text {
  min-width: 0;
}

#termin .termin-head__button {
  justify-self: end;
  width: 154px;
  max-width: 100%;
  line-height: 0;
  align-self: start;
}

#termin .termin-head__button img {
  display: block;
  width: 100%;
  height: auto;
}

#termin #beschreibung > *:first-child {
  margin-top: 0;
}

#termin #beschreibung > *:last-child {
  margin-bottom: 0;
}

/* Meta-Boxen */
#termin .termin-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}

#termin .termin-meta__item {
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(91,59,135,0.18);
  border-left: 4px solid var(--gptlogofarbe, #5B3B87);
  border-radius: 12px;
  padding: 12px 14px;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  backdrop-filter: blur(2px);
}

#termin .termin-meta__label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.78rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5b5b66;
}

#termin .termin-meta__value {
  line-height: 1.45;
  color: #2f2f35;
}

#termin .termin-meta__item--status {
  border-left-color: #c27a00;
}

#termin .termin-meta__item--status.is-limited {
  border-left-color: #5B3B87;
}

#termin .termin-meta__item--status.is-low {
  border-left-color: #c27a00;
  background: rgba(255,248,230,0.92);
}

#termin .termin-meta__item--status.is-full,
#termin .termin-meta__item--status.is-overbooked {
  border-left-color: #b42318;
  background: rgba(255,240,240,0.95);
}

#termin .termin-platzhinweis {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  line-height: 1.45;
  box-sizing: border-box;
}

#termin .termin-platzhinweis--full {
  background: rgba(180,35,24,0.10);
  border: 1px solid rgba(180,35,24,0.24);
  color: #7a1f17;
}

#termin .termin-platzhinweis--overbooked {
  background: rgba(180,35,24,0.16);
  border: 1px solid rgba(180,35,24,0.34);
  color: #7a1f17;
  font-weight: 600;
}

/* Terminfarben auf dem inneren Block */
#termin td#stammtisch > .termin-head { background: lemonchiffon; }
#termin td#meet > .termin-head       { background: #99d1c8; }
#termin td#mata > .termin-head       { background: #ffcb06; }

#termin td#fledermaus > .termin-head {
  background: var(--mausbg);
  color: var(--maustext);
}
#termin td#fledermaus > .termin-head a {
  color: var(--maustext);
}

#termin td#cage > .termin-head {
  background: var(--cagebg);
  color: var(--cagetext);
}
#termin td#cage > .termin-head a,
#termin td#cage > .termin-head h3,
#termin td#cage > .termin-head h4 {
  color: var(--cagetext);
}

#termin td#vogel > .termin-head {
  background: var(--vogelbg);
  color: var(--vogeltext);
}
#termin td#vogel > .termin-head a {
  color: var(--vogeltext);
}

#termin td#meet > .termin-head h3.termin,
#termin td#meet > .termin-head #termin_titel {
  color: var(--gptlogofarbe);
}

#termin td#fuehrung > .termin-head   { background: lightblue; }
#termin td#verein > .termin-head     { background: violet; }

#termin td#theater > .termin-head {
  background: var(--gpthellgruen);
  color: #000;
}

#termin td#mut > .termin-head {
  background: var(--mut);
  color: #000;
}

#termin td#fahrt > .termin-head       { background: lightcoral; }
#termin td#liebestrank > .termin-head { background: lightcoral; }
#termin td#fremdgehen > .termin-head  { background: lightyellow; }

/* Detail-Tooltip rechts unten am Button */
#termin .termin-head .terminbutton-tooltip {
  left: auto;
  right: 0;
  bottom: auto;
  top: calc(100% + 8px);
  transform: none;
}

#termin .termin-head .terminbutton-tooltip::after {
  top: auto;
  bottom: 100%;
  left: auto;
  right: 18px;
  transform: none;
  border: 6px solid transparent;
  border-bottom-color: rgba(20,20,20,0.95);
  border-top-color: transparent;
}

/* =======================================
   Responsive
   ======================================= */
@media (min-width: 768px) {
  #termin .termin-head.has-button {
    grid-template-columns: minmax(0, 1fr) 110px;
    gap: 18px;
  }

  #termin .termin-head__button {
    width: 110px;
  }

  #termin .termin-meta {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}