/* ============================================================
   TERMINE-SEITE  (page-termine.php) – selbst gerenderter Kalender
   ------------------------------------------------------------
   Alles gescopt unter .termine, Klassen .trm-* präfixt. Nutzt die
   Theme-Tokens aus style.css :root. KEIN eigenes :root, KEIN
   Universal-Reset (würde .ctr-Padding überschreiben → Lektion 1).
   Kategorie-FARBEN kommen als Inline-Variable --cc aus categories()
   (PHP) → hier wird KEINE Kategoriefarbe hartkodiert (Single Source).
   ============================================================ */

.termine .trm{padding:var(--sp-y) 0;background:var(--cream)}
.termine [hidden]{display:none !important}

/* ── Einleitung + Legende ──────────────────────────────────── */
.termine .trm-intro{text-align:center;margin-bottom:32px}
.termine .trm-lead{color:var(--g500);max-width:640px;margin:0 auto;font-size:1.05rem;line-height:1.6}
.termine .trm-legend{list-style:none;margin:20px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:10px 24px;justify-content:center}
.termine .trm-legend li{display:flex;align-items:center;gap:8px;font-size:.88rem;color:var(--g700);line-height:1.4}
.termine .trm-dot{display:inline-block;width:12px;height:12px;border-radius:50%;flex:0 0 auto}

/* ── Umschalter (nur mit JS sichtbar) ──────────────────────── */
.termine .trm-toolbar{display:none;justify-content:center;margin-bottom:26px}
.termine.trm-js .trm-toolbar{display:flex}
.termine .trm-toggle{display:inline-flex;background:var(--white);border:1px solid var(--g200);border-radius:50px;padding:4px;box-shadow:0 2px 10px rgba(22,39,66,.05)}
.termine .trm-toggle-btn{appearance:none;border:none;background:transparent;color:var(--g600);font-family:var(--fb);font-size:.9rem;font-weight:600;padding:8px 22px;border-radius:50px;cursor:pointer;transition:background .25s,color .25s}
.termine .trm-toggle-btn.is-active{background:var(--navy);color:#fff}
.termine .trm-toggle-btn:focus-visible{outline:3px solid var(--gold);outline-offset:2px}

/* ── „leer / nicht verbunden" ──────────────────────────────── */
.termine .trm-empty{max-width:640px;margin:0 auto;text-align:center;background:var(--white);border:1px solid var(--g200);border-radius:18px;padding:40px 28px;color:var(--g600)}
.termine .trm-empty strong{color:var(--navy)}
.termine .trm-empty a{color:var(--blue);text-decoration:underline}

/* ── Karten-Rahmen um Raster & Liste ───────────────────────── */
.termine .trm-cal{max-width:100%}

/* ============================================================
   MONATSRASTER (von js/termine.js gebaut)
   ============================================================ */
.termine .trm-grid{background:var(--white);border:1px solid var(--g200);border-radius:20px;overflow:hidden;box-shadow:0 4px 24px rgba(22,39,66,.06)}
.termine .trm-gridhead{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 22px;background:linear-gradient(135deg,var(--navy),var(--blue-dark))}
.termine .trm-gridtitle{font-family:var(--fd);font-size:1.7rem;letter-spacing:2px;color:#fff;text-align:center;flex:1}
.termine .trm-nav{appearance:none;width:40px;height:40px;flex:0 0 auto;border:1px solid rgba(255,255,255,.28);background:rgba(255,255,255,.08);color:#fff;border-radius:50%;font-size:1.3rem;line-height:1;cursor:pointer;transition:background .25s,border-color .25s}
.termine .trm-nav:hover:not(:disabled){background:rgba(255,255,255,.2)}
.termine .trm-nav:disabled{opacity:.32;cursor:default}
.termine .trm-nav:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
/* minmax(0,1fr) statt 1fr → alle 7 Spalten EXAKT gleich breit, unabhängig vom
   Inhalt (langer Termin-Text weitet die Spalte sonst auf → Springen beim Wechsel). */
.termine .trm-weekdays{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));background:var(--wheat-light)}
.termine .trm-weekdays span{padding:10px 4px;text-align:center;font-family:var(--fd);letter-spacing:1px;font-size:.85rem;color:var(--navy)}
.termine .trm-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:1px;background:var(--g200)}
.termine .trm-day{background:var(--white);min-height:96px;padding:6px 7px 8px;cursor:pointer;position:relative;transition:background .2s;text-align:left;overflow:hidden}
.termine .trm-day:hover{background:var(--g50)}
.termine .trm-day--other{background:var(--cream)}
.termine .trm-day--other .trm-daynum{color:var(--g300)}
.termine .trm-day--empty{cursor:default}
.termine .trm-day--empty:hover{background:var(--white)}
.termine .trm-daynum{font-family:var(--fd);font-size:1.05rem;color:var(--navy);letter-spacing:.5px}
.termine .trm-day.is-today .trm-daynum{background:var(--gold);color:var(--navy);border-radius:50%;width:26px;height:26px;display:inline-flex;align-items:center;justify-content:center}
.termine .trm-day.is-selected{background:var(--wheat-light);box-shadow:inset 0 0 0 2px var(--gold)}
.termine .trm-chips{display:flex;flex-direction:column;gap:3px;margin-top:5px}
.termine .trm-chip{appearance:none;border:none;text-align:left;display:flex;align-items:center;gap:5px;background:color-mix(in srgb,var(--cc) 14%,#fff);border-left:3px solid var(--cc);color:var(--g800);font-family:var(--fb);font-size:.72rem;line-height:1.25;padding:2px 6px;border-radius:5px;cursor:pointer;width:100%;overflow:hidden}
.termine .trm-chip-txt{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.termine .trm-chip-time{font-weight:600;color:var(--cc);flex:0 0 auto}
.termine .trm-chip--more{justify-content:center;background:var(--g100);border-left:none;color:var(--g600);font-weight:600}

/* Detail-Panel unter dem Raster (Tages-Termine) */
.termine .trm-detail{border-top:1px solid var(--g200);padding:20px 22px 24px;background:var(--g50)}
.termine .trm-detail-head{font-family:var(--fd);font-size:1.25rem;letter-spacing:1px;color:var(--navy);margin-bottom:14px}
.termine .trm-ditem{display:flex;gap:14px;padding:12px 0;border-bottom:1px dashed var(--g200)}
.termine .trm-ditem:last-child{border-bottom:none}
.termine .trm-dtime{flex:0 0 92px;font-family:var(--fb);font-weight:600;color:var(--cc);font-size:.9rem;padding-top:2px}
.termine .trm-dbody{min-width:0}
.termine .trm-dtitle{font-family:var(--fd);font-size:1.2rem;letter-spacing:.8px;color:var(--navy);margin:4px 0 2px;line-height:1.2;overflow-wrap:anywhere}
.termine .trm-dmeta{font-size:.85rem;color:var(--g500);overflow-wrap:anywhere}
.termine .trm-ddesc{font-size:.9rem;color:var(--g600);line-height:1.55;margin-top:6px;overflow-wrap:anywhere}
.termine .trm-dempty{color:var(--g500);font-size:.95rem}

/* ============================================================
   WOCHENANSICHT (von js/termine.js gebaut) – 7 gleich breite Spalten
   ============================================================ */
.termine .trm-week{background:var(--white);border:1px solid var(--g200);border-radius:20px;overflow:hidden;box-shadow:0 4px 24px rgba(22,39,66,.06)}
.termine .trm-week-scroll{overflow-x:auto}
.termine .trm-weekgrid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:1px;background:var(--g200)}
.termine .trm-wcol{background:var(--white);min-height:220px;display:flex;flex-direction:column;min-width:0}
.termine .trm-wcol-head{padding:9px 6px;text-align:center;background:var(--wheat-light);border-bottom:1px solid var(--g200)}
.termine .trm-wcol-head .wd{display:block;font-family:var(--fd);letter-spacing:1px;color:var(--navy);font-size:.95rem}
.termine .trm-wcol-head .dt{display:block;font-size:.72rem;color:var(--g500);margin-top:1px}
.termine .trm-wcol.is-today .trm-wcol-head{background:var(--gold)}
.termine .trm-wcol.is-today .trm-wcol-head .dt{color:var(--navy)}
.termine .trm-wcol-body{flex:1;padding:6px;display:flex;flex-direction:column;gap:6px}
.termine .trm-wevent{background:color-mix(in srgb,var(--cc) 12%,#fff);border-left:3px solid var(--cc);border-radius:6px;padding:5px 7px;overflow:hidden}
.termine .trm-wev-time{font-family:var(--fb);font-weight:700;font-size:.72rem;color:var(--cc);line-height:1.2}
.termine .trm-wev-title{font-size:.8rem;color:var(--g800);line-height:1.3;margin-top:1px;overflow-wrap:anywhere}
.termine .trm-wev-loc{font-size:.7rem;color:var(--g500);margin-top:2px;overflow-wrap:anywhere}
.termine .trm-wempty{color:var(--g300);text-align:center;font-size:.9rem;padding:12px 0}

/* ============================================================
   TERMINLISTE / AGENDA (server-gerendert)
   ============================================================ */
.termine .trm-month{font-family:var(--fd);font-size:1.6rem;letter-spacing:2px;color:var(--navy);margin:34px 0 16px}
.termine .trm-list > .trm-month:first-child{margin-top:0}
.termine .trm-mgroup{display:flex;flex-direction:column;gap:12px}
.termine .trm-item{display:grid;grid-template-columns:auto 1fr;gap:18px;align-items:start;background:var(--white);border:1px solid var(--g200);border-left:4px solid var(--cc);border-radius:14px;padding:16px 20px;box-shadow:0 2px 12px rgba(22,39,66,.04);transition:transform .2s,box-shadow .2s}
.termine .trm-item:hover{transform:translateY(-2px);box-shadow:0 8px 22px rgba(22,39,66,.08)}
.termine .trm-item.is-today{border-color:var(--gold);box-shadow:0 4px 18px rgba(201,168,76,.18)}
/* Grid-Item ohne min-width:0 nimmt als Mindestbreite den längsten Inhalt (Grid-Default
   min-width:auto) → lange URL im Text sprengt die Card. */
.termine .trm-body{min-width:0}
.termine .trm-date{flex:0 0 auto;width:58px;text-align:center;background:var(--wheat-light);border-radius:12px;padding:8px 4px;line-height:1}
.termine .trm-date-d{display:block;font-family:var(--fd);font-size:1.8rem;color:var(--navy)}
.termine .trm-date-wd{display:block;font-family:var(--fb);font-size:.72rem;letter-spacing:1px;text-transform:uppercase;color:var(--g500);margin-top:2px}
.termine .trm-tag{display:inline-block;font-family:var(--fb);font-size:.7rem;font-weight:700;letter-spacing:.5px;text-transform:uppercase;color:#fff;background:var(--cc);padding:3px 9px;border-radius:50px;vertical-align:middle}
.termine .trm-nowtag{display:inline-block;font-family:var(--fb);font-size:.7rem;font-weight:700;letter-spacing:.5px;text-transform:uppercase;color:var(--navy);background:var(--gold);padding:3px 9px;border-radius:50px;margin-left:6px}
/* Termin-Titel = Bebas Neue wie alle Card-Titel im Theme (.nwtt/.ble-title/.tkc h3).
   Playfair (--fs) ist im Theme reine Zitat-/Akzentschrift (.abtx h3, .tmq) → hier falsch. */
.termine .trm-title{font-family:var(--fd);font-size:1.35rem;letter-spacing:1px;color:var(--navy);margin:8px 0 4px;line-height:1.2;overflow-wrap:anywhere}
.termine .trm-meta{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:.9rem;color:var(--g600);min-width:0}
.termine .trm-time{font-weight:600;color:var(--g700)}
.termine .trm-loc::before{content:"📍 ";}
.termine .trm-loc{overflow-wrap:anywhere}
/* Beschreibungen kommen 1:1 aus Google-Kalender und enthalten oft lange URLs ohne
   Trennstelle → auf schmalen Handys sonst Overflow über die Card hinaus.
   `anywhere` (nicht break-word) wirkt auch auf die min-content-Breite der 1fr-Spalte. */
.termine .trm-desc{font-size:.92rem;color:var(--g600);line-height:1.55;margin-top:8px;overflow-wrap:anywhere}
.termine .trm-noupcoming,.termine .trm-more-hint{text-align:center;color:var(--g500);font-size:.95rem;margin-top:8px}
.termine .trm-linklike{appearance:none;border:none;background:none;color:var(--blue);text-decoration:underline;cursor:pointer;font:inherit;padding:0}

/* ── Mobile ────────────────────────────────────────────────── */
@media(max-width:720px){
	.termine .trm-gridtitle{font-size:1.4rem}
	.termine .trm-day{min-height:74px;padding:5px 5px 6px}
	.termine .trm-weekdays span{font-size:.75rem;padding:8px 2px}
	/* Wochenraster wird sonst zu eng → horizontal scrollbar, Spalten lesbar halten */
	.termine .trm-weekgrid{min-width:680px}
}
@media(max-width:560px){
	.termine .trm-intro{margin-bottom:26px}
	/* Raster wird schmal → Chips auf farbige Punkte reduzieren */
	.termine .trm-day{min-height:60px}
	.termine .trm-chips{flex-direction:row;flex-wrap:wrap;gap:3px}
	.termine .trm-chip{width:9px;height:9px;padding:0;border-left:none;border-radius:50%;background:var(--cc);font-size:0;overflow:hidden}
	.termine .trm-chip-time{display:none}
	.termine .trm-chip--more{width:auto;height:auto;font-size:.6rem;padding:0 4px;border-radius:6px;background:var(--g100)}
	.termine .trm-item{grid-template-columns:48px 1fr;gap:12px;padding:14px 15px}
	.termine .trm-date{width:48px}
	.termine .trm-date-d{font-size:1.5rem}
	.termine .trm-dtime{flex-basis:72px}
}
