/* =========================================================================
   TSG Salach – Abteilungs-Baukasten (plg_content_tsgbaukasten)
   Wird nur auf Beiträgen mit Kacheln geladen. Alle Regeln sind auf .tk-page
   bzw. tk-Klassen begrenzt, damit das Template tsg_salach6 unberührt bleibt.
   Farben = Website (templates/tsg_salach6/css/template.css, nachtkarte-inner.css).
   ========================================================================= */

.tk-page {
  --tk-blue: #006bb4;
  --tk-blue-dark: #083f66;
  --tk-navy: #082b4c;
  --tk-ink: #172b3c;
  --tk-muted: #5a7084;
  --tk-bg: #f0f6fb;
  --tk-line: #dce7f0;
  --tk-night: #01141f;
  --tk-blue-soft: #e2f1fb;
  --tk-blue-pale: #dcebf8;
  --tk-radius: 12px;
  --tk-radius-s: 10px;
  --tk-shadow: 0 1px 2px rgba(8,43,76,.05), 0 8px 24px rgba(8,43,76,.06);
  --tk-shadow-hover: 0 2px 4px rgba(8,43,76,.07), 0 16px 40px rgba(8,43,76,.13);
  --tk-gap: clamp(1rem, 2.2vw, 1.5rem);
  --tk-space: clamp(2rem, 5vw, 3.5rem);

  color: var(--tk-ink);
  line-height: 1.6;
  margin-block: 1rem 2rem;
}
.tk-page *, .tk-page *::before, .tk-page *::after { box-sizing: border-box; }
.tk-page img { max-width: 100%; display: block; }
.tk-page :is(h1, h2, h3, h4) { line-height: 1.15; letter-spacing: -.015em; color: var(--tk-ink); margin: 0 0 .5em; }
.tk-page p { margin: 0 0 1em; }
.tk-page a { color: var(--tk-blue); }

/* ---------- Abschnitte ---------------------------------------------------- */
.tk-section { margin-block: var(--tk-space); }
.tk-section:first-child { margin-top: 0; }
.tk-section--tint { background: var(--tk-bg); border-radius: calc(var(--tk-radius) + 4px); padding: clamp(1.25rem, 4vw, 2.75rem); }
.tk-section--hero { margin-bottom: calc(var(--tk-space) * .8); }

/* ---------- Abschnittshintergründe (0.1.4) -------------------------------
   Das Plugin vergibt je Abschnitt tk-bg--weiss / --hellblau / --dunkelblau (Hero ausgenommen).
   Volle Seitenbreite ohne Überlauf: box-shadow nach links/rechts, clip-path begrenzt oben/unten exakt auf den Abschnitt. */
.tk-page .tk-section.tk-bg { margin-block: 0; padding-block: var(--tk-space); clip-path: inset(0 -100vmax); }
.tk-page .tk-section.tk-bg--weiss { background: #fff; box-shadow: 0 0 0 100vmax #fff; }
.tk-page .tk-section.tk-bg--hellblau { background: var(--tk-bg); box-shadow: 0 0 0 100vmax var(--tk-bg); }
.tk-page .tk-section.tk-bg--dunkelblau { background: var(--tk-navy); box-shadow: 0 0 0 100vmax var(--tk-navy); color: #fff; }
.tk-page .tk-section--hero + .tk-section.tk-bg { margin-top: 0; }
/* Dunkelblau: Text direkt auf der Fläche hell; Karten behalten ihre eigenen (hellen) Farben */
.tk-page .tk-bg--dunkelblau > :is(.tk-head, .tk-text, .tk-lead, .tk-richtext) :is(h2, h3, h4, p, li, .tk-title),
.tk-page .tk-bg--dunkelblau > .tk-head .tk-title,
.tk-page .tk-bg--dunkelblau > .tk-text :is(h2, h3, .tk-title),
.tk-page .tk-bg--dunkelblau .tk-cell > :is(.tk-head, .tk-text) :is(h2, h3, .tk-title) { color: #fff; }
.tk-page .tk-bg--dunkelblau .tk-kicker { color: var(--tk-blue-pale); }
.tk-page .tk-bg--dunkelblau :is(.tk-lead, .tk-text > .tk-richtext) { color: rgba(255,255,255,.88); }
.tk-page .tk-bg--dunkelblau .tk-more { color: #fff; border-color: #fff; }
.tk-page .tk-bg--dunkelblau :is(.tk-card, .tk-fupa, .tk-person, .tk-person-single, .tk-downloads a, .tk-fact) { color: var(--tk-ink); }
.tk-page .tk-bg--dunkelblau :is(.tk-card, .tk-fupa, .tk-person, .tk-person-single) :is(h2, h3, h4) { color: var(--tk-ink); }
.tk-page .tk-bg--dunkelblau .tk-highlight { box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.tk-page .tk-bg--hellblau .tk-fact { background: #fff; }

.tk-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .75rem 2rem; margin-bottom: clamp(1.25rem, 3vw, 2rem); }
.tk-kicker { display: block; font-size: .8125rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--tk-blue); margin-bottom: .5rem; }
.tk-page .tk-title { font-size: clamp(1.75rem, 3.6vw, 2.375rem); font-weight: 800; margin: 0; }
.tk-cell .tk-title { font-size: clamp(1.4rem, 2.4vw, 1.75rem); }
.tk-page .tk-more { font-weight: 700; color: var(--tk-ink); text-decoration: none; border-bottom: 2px solid var(--tk-ink); padding-bottom: 2px; white-space: nowrap; display: inline-block; }
.tk-page .tk-more:hover { color: var(--tk-blue); border-color: var(--tk-blue); }
.tk-lead { font-size: clamp(1.0625rem, 1.6vw, 1.1875rem); color: var(--tk-muted); max-width: 62ch; margin-bottom: 1.25rem; }
.tk-richtext > :last-child { margin-bottom: 0; }
.tk-meta { font-size: .875rem; color: var(--tk-muted); }

/* ---------- Raster -------------------------------------------------------- */
.tk-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--tk-gap); align-items: stretch; }
.tk-grid > * { grid-column: 1 / -1; min-width: 0; }
/* 0.1.6: equal heights per row. The grid stretches every cell to the row height (only cells that share a row –
   stacked cells keep their natural height); inside the cell only the tile's own box grows, its content never. */
.tk-cell { display: flex; flex-direction: column; }
.tk-cell > :is(.tk-card, .tk-cta, .tk-person-single):last-child { flex: 1 0 auto; }
@media (min-width: 760px) {
  .tk-cell.w-halb, .tk-cell.w-drittel { grid-column: span 6; }
}
@media (min-width: 1024px) {
  .tk-cell.w-drittel { grid-column: span 4; }
  .tk-cell.w-zwei-drittel { grid-column: span 8; }
}

/* ---------- Grundbausteine ------------------------------------------------ */
.tk-card { background: #fff; border: 1px solid var(--tk-line); border-radius: var(--tk-radius); box-shadow: var(--tk-shadow); overflow: hidden; display: flex; flex-direction: column; }
.tk-card__body { padding: clamp(1.25rem, 2.5vw, 1.75rem); display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.tk-page .tk-card h3 { font-size: clamp(1.15rem, 1.8vw, 1.3rem); font-weight: 750; margin-bottom: .35rem; }
.tk-page .tk-card--link { text-decoration: none; color: inherit; transition: transform .2s ease, box-shadow .2s ease; }
.tk-card--link:hover { transform: translateY(-3px); box-shadow: var(--tk-shadow-hover); }
.tk-page a:focus-visible { outline: 3px solid var(--tk-blue); outline-offset: 3px; }

.tk-chip { display: inline-flex; font-size: .75rem; font-weight: 700; background: var(--tk-blue-soft); color: var(--tk-navy); border-radius: 999px; padding: .2rem .6rem; }
.tk-row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }

.tk-page .tk-btn {
  display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1rem; text-decoration: none;
  padding: .8rem 1.3rem; border-radius: 999px; background: var(--tk-blue); color: #fff; border: 2px solid var(--tk-blue);
  transition: background .2s, color .2s, border-color .2s; cursor: pointer; font-family: inherit; min-height: 48px; margin-top: .75rem; width: fit-content;
}
.tk-page .tk-btn:hover { background: var(--tk-blue-dark); border-color: var(--tk-blue-dark); color: #fff; }
.tk-page .tk-btn[disabled] { opacity: .55; cursor: not-allowed; }
.tk-page .tk-btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.tk-page .tk-btn--ghost:hover { background: #fff; color: var(--tk-navy); border-color: #fff; }
.tk-arrow { display: inline-block; transition: transform .2s; }
a:hover > .tk-arrow { transform: translateX(4px); }

/* Bildfläche bzw. Platzhalter ohne Bild */
.tk-ph { position: relative; overflow: hidden; background-color: #0b4f80; background-image: linear-gradient(135deg, rgba(0,107,180,.85), rgba(8,43,76,.95)); color: rgba(255,255,255,.75); }
.tk-ph:not(.tk-ph--img)::before {
  content: ""; position: absolute; inset: 0; opacity: .2;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 17%, #fff 17% calc(17% + 2px), transparent calc(17% + 2px)),
    linear-gradient(90deg, transparent calc(50% - 1px), #fff calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px));
}
/* Bilder: füllen ihre Fläche; Proportionen bleiben erhalten (object-fit), keine festen Höhen.
   Spezifität höher als das globale "img { max-width:100%; height:auto }" des Templates. */
/* 0.2.1: Das Bild passt sich der Kachel an, nie umgekehrt (proportional, kein Zoom).
   0.2.2: Standard ist contain (ganzes Bild, Block am Dateiende). Optional überschreibbar, z. B. in der user.css:
     .tk-page { --tk-bild-fit: cover; }              Fläche füllen, Ränder abschneiden (Stand 0.2.1)
     .tk-page { --tk-bild-position: center 30%; }    Ausschnitt etwas nach oben (Köpfe bei Mannschaftsfotos)
   Hero (immer cover + center) und Text-Kachel (natürliches Seitenverhältnis) sind davon ausgenommen. */
.tk-page .tk-ph--img { background: var(--tk-bild-flaeche, var(--tk-bg)); }
.tk-page .tk-ph--img img { display: block; width: 100%; height: 100%; max-width: none; object-fit: var(--tk-bild-fit, cover); object-position: var(--tk-bild-position, center); }
.tk-page .tk-hero__bg img { object-fit: cover; object-position: center; }
/* Natürliches Seitenverhältnis (Text-Kachel): kein Beschnitt, Platz wird über width/height bzw. aspect-ratio reserviert. */
.tk-page .tk-ratio-auto { aspect-ratio: auto; }
.tk-page .tk-ratio-auto { display: flex; justify-content: center; }
.tk-page .tk-ratio-auto img { width: auto; max-width: 100%; height: auto; max-height: min(75vh, 720px); object-fit: contain; }
.tk-ph--light { background: linear-gradient(135deg, #eaf5fd, #d5e5f1); color: var(--tk-navy); }
.tk-ph-label { position: absolute; right: .75rem; bottom: .65rem; font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; background: rgba(0,0,0,.3); color: #fff; padding: .2rem .5rem; border-radius: 4px; }
.tk-ratio-16x9 { aspect-ratio: 16 / 9; } .tk-ratio-4x3 { aspect-ratio: 4 / 3; } .tk-ratio-3x2 { aspect-ratio: 3 / 2; }

/* ---------- Hero ---------------------------------------------------------- */
.tk-hero { position: relative; color: #fff; isolation: isolate; border-radius: calc(var(--tk-radius) + 4px); overflow: hidden; background: var(--tk-night); }
/* 0.1.7: every hero spans the full browser width (no option). The section breaks out of the template container
   (no ancestor of tsg_salach6 clips: checked); --tk-sbw = classic scrollbar width (hero.js), 0 otherwise.
   The text stays in a centred content area as wide as the page content. */
.tk-page > .tk-section--hero { width: calc(100vw - var(--tk-sbw, 0px)); max-width: none; margin-inline: calc(50% - 50vw + var(--tk-sbw, 0px) / 2); }
.tk-page > .tk-section--hero .tk-hero { border-radius: 0; }
.tk-page > .tk-section--hero .tk-hero__inner { width: min(100% - 2 * clamp(1.25rem, 5vw, 3.5rem), var(--tk-hero-inhalt, 1152px)); margin-inline: auto; padding-inline: 0; }
.tk-page > .tk-section--hero .tk-hero__stripe { margin-top: 0; border-radius: 0; }
body:has(.tk-page > .tk-section--hero) { overflow-x: clip; }
/* 0.1.9: hero directly below the main navigation.
   Cause (live HTML of test.tsg-salach.de, 13.11.2026): between the white navigation and the hero lie the template's
   page shell padding (tsg_salach6 .page-shell: 55px, 34px on phones; white on inner pages via nachtkarte-inner.css),
   the breadcrumb row (.breadcrumbs-wrap, margin-bottom 18px – even when no breadcrumb module is published), the content
   card padding (.main-content 34/23px) and the Baukasten's own top margin (16px). 0.1.8 only removed the last two.
   All rules depend ONLY on the plugin's own marker .tk-page--hero-start (set in PHP when the first section is a hero),
   never on the order of Joomla's article markup. Without the marker (normal articles, start page, Baukasten pages that
   do not start with a hero) nothing here applies. The navigation itself is not touched. */
.tk-page.tk-page--hero-start { margin-top: 0; }
body:has(.tk-page--hero-start) .page-shell { padding-top: 0; }
.main-content:has(.tk-page--hero-start) { padding-top: 0; }
/* Breadcrumbs: no own row above the hero – shown small inside the hero (same module output, moved only visually,
   so there is never a second breadcrumb). Without a breadcrumb module the (empty) row simply takes no space. */
body:has(.tk-page--hero-start) .page-shell > .container { position: relative; }
body:has(.tk-page--hero-start) .breadcrumbs-wrap {
  position: absolute; z-index: 3; top: .85rem; left: 50%; transform: translateX(-50%); margin: 0;
  width: min(100vw - var(--tk-sbw, 0px) - 2 * clamp(1.25rem, 5vw, 3.5rem), var(--tk-hero-inhalt, 1152px));
  color: rgba(255,255,255,.9); font-size: .8125rem; line-height: 1.4; text-shadow: 0 1px 3px rgba(1,20,31,.75);
}
body:has(.tk-page--hero-start) .breadcrumbs-wrap :is(nav, ol, ul, li, span) { color: inherit; background: none; box-shadow: none; }
body:has(.tk-page--hero-start) .breadcrumbs-wrap :is(ol, ul) { display: flex; flex-wrap: wrap; gap: .15rem .5rem; list-style: none; margin: 0; padding: 0; }
body:has(.tk-page--hero-start) .breadcrumbs-wrap li { margin: 0; padding: 0; }
body:has(.tk-page--hero-start) .breadcrumbs-wrap a { color: #fff; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(255,255,255,.45); }
body:has(.tk-page--hero-start) .breadcrumbs-wrap a:hover { text-decoration-color: #fff; }
/* room for the breadcrumbs at the top of the hero (only when a breadcrumb module is published) */
body:has(.breadcrumbs-wrap > *) .tk-page--hero-start > .tk-section--hero .tk-hero__inner { padding-top: calc(clamp(1.5rem, 5vw, 3.5rem) + 2rem); }
/* Rare: something of Joomla stands before the article text (menu page heading, edit icons for editors, output of
   other plugins). It keeps some distance from the navigation; the hero follows below it. */
.main-content:has(.tk-page--hero-start) .com-content-article > meta:first-child + :not(.com-content-article__body) { margin-top: 1.5rem; }
/* …and then the hero is no longer at the top: breadcrumbs stay in their normal row (readable on white). */
body:has(.com-content-article > :not(meta, .com-content-article__body) ~ .com-content-article__body > .tk-page--hero-start) .breadcrumbs-wrap {
  position: static; transform: none; width: auto; padding-top: .85rem; margin: 0; color: inherit; font-size: inherit; text-shadow: none;
}
body:has(.com-content-article > :not(meta, .com-content-article__body) ~ .com-content-article__body > .tk-page--hero-start) .breadcrumbs-wrap a { color: inherit; }
.tk-hero .tk-hero__bg { position: absolute; inset: 0; z-index: -2; }
.tk-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(1,20,31,.15) 0%, rgba(1,20,31,.55) 55%, rgba(1,20,31,.92) 100%); }
.tk-hero__inner { min-height: clamp(320px, 60vh, 560px); min-height: clamp(320px, 60svh, 580px); display: flex; flex-direction: column; justify-content: flex-end; padding: clamp(1.5rem, 5vw, 3.5rem); }
.tk-hero--m .tk-hero__inner { min-height: clamp(280px, 42vh, 420px); }
.tk-hero .tk-kicker { color: var(--tk-blue-pale); }
.tk-page .tk-hero__title { color: #fff; font-size: clamp(2.25rem, 6.5vw, 4.5rem); font-weight: 800; letter-spacing: -.03em; line-height: 1; margin-bottom: .8rem; max-width: 16ch; overflow-wrap: break-word; hyphens: manual; text-wrap: balance; }
.tk-hero__text { font-size: clamp(1.0625rem, 2vw, 1.25rem); max-width: 52ch; opacity: .92; }
.tk-hero__text p:last-child { margin-bottom: 0; }
.tk-hero__actions .tk-btn { margin-top: 1.25rem; }
.tk-hero__stripe { height: 6px; margin-top: 8px; border-radius: 3px; background: linear-gradient(90deg, var(--tk-blue) 0 70%, var(--tk-blue-pale) 70% 85%, var(--tk-line) 85%); }
.tk-teamfacts { display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; margin: 1.5rem 0 0; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,.2); }
.tk-teamfacts dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; opacity: .7; }
.tk-teamfacts dd { margin: 0; font-weight: 700; font-size: 1.05rem; }
/* 0.2.5: lange Werte und Bezeichnungen umbrechen statt aus dem Hero zu laufen */
.tk-page .tk-teamfacts > div { min-width: 0; max-width: 100%; }
.tk-page .tk-teamfacts :is(dt, dd) { overflow-wrap: anywhere; }

/* ---------- Text ---------------------------------------------------------- */
.tk-text--img { display: grid; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
@media (min-width: 900px) { .tk-text--img { grid-template-columns: 1.05fr 1fr; } }
.tk-text .tk-ph { border-radius: var(--tk-radius); }
.tk-text__img { margin-bottom: 1.25rem; }
.tk-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin-top: 1.5rem; }
.tk-fact { background: var(--tk-bg); border-radius: var(--tk-radius-s); padding: 1rem 1.1rem; }
.tk-fact strong { display: block; font-size: 1.6rem; font-weight: 800; color: var(--tk-navy); line-height: 1.1; }
.tk-fact span { font-size: .875rem; color: var(--tk-muted); }
.tk-highlight { background: var(--tk-blue); color: #fff; border: 0; }
.tk-page .tk-highlight :is(h2, h3), .tk-highlight .tk-kicker { color: #fff; }
.tk-highlight .tk-kicker { opacity: .8; }
.tk-highlight .tk-fact { background: rgba(255,255,255,.12); }
.tk-highlight .tk-fact strong, .tk-highlight .tk-fact span { color: #fff; }
.tk-page .tk-highlight a:not(.tk-btn) { color: #fff; }

/* ---------- Bereiche (Bento) --------------------------------------------- */
/* 0.2.3: festes Raster unabhängig von der Anzahl der Bereiche. Jede Kachel ist eine Spalte
   breit, die letzte Reihe bleibt linksbündig unvollständig (keine Kachel wird verbreitert).
   Smartphone 1 Spalte, ab 640 px 2 Spalten, ab 1024 px 3 Spalten (Breakpoints wie bisher). */
.tk-areas { display: grid; gap: var(--tk-gap); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .tk-areas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .tk-areas { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tk-page .tk-area { position: relative; border-radius: var(--tk-radius); overflow: hidden; color: #fff; text-decoration: none; min-height: 210px; display: flex; flex-direction: column; justify-content: flex-end; isolation: isolate; box-shadow: var(--tk-shadow); transition: transform .25s ease, box-shadow .25s ease; }
.tk-area .tk-area__bg { position: absolute; inset: 0; z-index: -2; }
.tk-area::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(1,20,31,0) 25%, rgba(1,20,31,.88) 100%); }
.tk-area:hover { transform: translateY(-4px); box-shadow: var(--tk-shadow-hover); }
/* 0.2.1: kein Hover-Zoom mehr auf dem Bild (vorher scale(1.05)); die Kachel hebt sich weiterhin leicht an. */
/* 0.2.3: Jede Bereiche-Kachel hat in jeder Ansicht das Seitenverhältnis 3 : 2 (Bildvorlage 1200 × 800 px).
   Das Bild füllt die Kachel (cover + center); ein 3:2-Bild wird dabei nicht beschnitten. Gilt nur für Bereiche,
   alle anderen Bilder bleiben wie in 0.2.2 (contain).
   Langer Text: Die Kachel selbst schneidet nicht ab (overflow: visible, min-height: auto). Passt der Text nicht in
   die 3:2-Fläche, wird nur diese Kachel höher; die Nachbarkacheln derselben Reihe bleiben 3 : 2 (align-self: start).
   Die runden Ecken schneiden Bildfläche (.tk-ph, overflow: hidden) und Verlauf selbst (border-radius: inherit). */
.tk-page .tk-areas > .tk-area { min-width: 0; min-height: auto; aspect-ratio: 3 / 2; overflow: visible; align-self: start; --tk-bild-fit: cover; --tk-bild-position: center; }
.tk-page .tk-areas > .tk-area > .tk-area__bg, .tk-page .tk-areas > .tk-area::after { border-radius: inherit; }
.tk-page .tk-areas > .tk-area > .tk-area__body { display: flex; flex-direction: column; justify-content: flex-end; }
/* Kennziffer und „Mehr erfahren“ sind im Flex-Block eigene Zeilen: Zeilenhöhe wie zuvor im Fließtext (kein Versatz) */
.tk-page .tk-areas > .tk-area > .tk-area__body > span { line-height: 1.6rem; } /* = 16 px × 1,6 des Textblocks */
/* 0.2.3: Schrift und Innenabstand richten sich nach der Kachelbreite (Container Query), damit Kennziffer, Überschrift,
   Kurzbeschreibung und „Mehr erfahren“ auch in schmalen 3:2-Kacheln Platz haben. Auf breiten Kacheln wie bisher. */
.tk-page .tk-areas > .tk-area { container-type: inline-size; }
.tk-page .tk-areas > .tk-area > .tk-area__body { padding: clamp(.875rem, 6cqi, 1.75rem); }
.tk-page .tk-areas > .tk-area > .tk-area__body > span { line-height: 1.4rem; }
.tk-page .tk-areas > .tk-area h3 { font-size: clamp(1.25rem, 8.5cqi, 2rem); line-height: 1.15; margin: .15rem 0 .3rem; }
.tk-page .tk-areas > .tk-area p { font-size: clamp(.875rem, 4.8cqi, .975rem); line-height: 1.45; margin: 0 0 .55rem; }
.tk-area__body { padding: clamp(1.25rem, 2.5vw, 1.75rem); }
.tk-area__num { font-size: .75rem; letter-spacing: .14em; font-weight: 700; opacity: .7; }
.tk-page .tk-area h3 { color: #fff; font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 800; margin: .2rem 0 .35rem; }
.tk-area p { margin: 0 0 .9rem; opacity: .88; font-size: .975rem; max-width: 40ch; }
.tk-area__go { font-weight: 700; font-size: .9375rem; }
.tk-area__go::after { content: " →"; }

/* ---------- Mannschaften -------------------------------------------------- */
.tk-teams { display: grid; gap: var(--tk-gap); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tk-team__body { padding: 1.25rem 1.4rem 1.4rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.tk-team__liga { font-size: .8125rem; font-weight: 700; color: var(--tk-blue); text-transform: uppercase; letter-spacing: .08em; }
.tk-page .tk-team h3 { margin: 0; font-size: 1.35rem; }
.tk-team p { margin: 0; }
.tk-team__foot { margin-top: auto; padding-top: .9rem; border-top: 1px solid var(--tk-line); font-size: .875rem; color: var(--tk-blue); }
.tk-teamlist { list-style: none; margin: 0; padding: 0; }
.tk-page .tk-teamlist a { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--tk-line); text-decoration: none; color: var(--tk-ink); font-weight: 650; }
.tk-page .tk-teamlist a:hover { color: var(--tk-blue); }
.tk-teamlist small { display: block; font-weight: 400; color: var(--tk-muted); }

/* ---------- Trainingszeiten ---------------------------------------------- */
.tk-training { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.tk-training li { display: grid; grid-template-columns: 56px 1fr; gap: 1rem; align-items: center; background: var(--tk-bg); border-radius: var(--tk-radius-s); padding: .85rem 1rem; }
.tk-day { background: var(--tk-navy); color: #fff; border-radius: 8px; text-align: center; padding: .55rem 0; font-weight: 800; }
.tk-training strong { display: block; font-size: 1.05rem; }
.tk-training span { display: block; font-size: .9rem; color: var(--tk-muted); }
.tk-training .tk-team-tag { font-size: .75rem; font-weight: 700; color: var(--tk-blue); text-transform: uppercase; letter-spacing: .06em; }
.tk-note { font-size: .9rem; color: var(--tk-muted); border-left: 3px solid var(--tk-blue); padding: .4rem 0 .4rem .9rem; margin-top: 1rem; }
.tk-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tk-table { width: 100%; border-collapse: collapse; font-size: .975rem; min-width: 520px; }
.tk-table th { text-align: left; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--tk-muted); padding: .6rem .75rem; border-bottom: 2px solid var(--tk-line); }
.tk-table td { padding: .85rem .75rem; border-bottom: 1px solid var(--tk-line); vertical-align: top; }
.tk-table tr:last-child td { border-bottom: 0; }
.tk-table td:first-child { font-weight: 700; }

/* ---------- Personen ------------------------------------------------------ */
.tk-people { display: grid; gap: var(--tk-gap); grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tk-people--list { grid-template-columns: 1fr; gap: .75rem; }
/* 0.1.7: compact card grid – columns follow the width of the tile (100% = tile), at most 4; cards ≥ 14rem, so ½ tile =
   2 cards, ⅔ = 3, full width = 4, ⅓ and phones = 1. Cards of a row are equally high (grid stretch). */
.tk-people--list { grid-template-columns: repeat(auto-fill, minmax(min(100%, max(14rem, calc((100% - 3 * .75rem) / 4))), 1fr)); }
.tk-person { display: flex; gap: .85rem; align-items: center; background: #fff; border: 1px solid var(--tk-line); border-radius: var(--tk-radius); padding: .75rem .9rem; min-width: 0; }
.tk-person__text { min-width: 0; }
.tk-person .tk-avatar { flex: none; width: 52px; height: 52px; font-size: 1rem; }
.tk-page .tk-person h4 { overflow-wrap: break-word; hyphens: manual; line-height: 1.25; }
.tk-person .fn { overflow-wrap: break-word; line-height: 1.35; }
.tk-avatar { width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--tk-blue-soft); color: var(--tk-navy); font-weight: 800; font-size: 1.15rem; }
.tk-page .tk-avatar--img { object-fit: cover; object-position: center 25%; padding: 0; max-width: none; }
.tk-page .tk-person h4 { margin: 0; font-size: 1.05rem; }
.tk-person .fn { font-size: .875rem; color: var(--tk-muted); display: block; }
.tk-person__links { display: flex; flex-direction: column; }
.tk-page .tk-person a, .tk-page .tk-contact__links a { font-size: .9rem; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.tk-contact { gap: .4rem; }
.tk-contact .tk-avatar { width: 84px; height: 84px; font-size: 1.4rem; margin-bottom: .5rem; }
.tk-page .tk-contact h4 { margin: 0; font-size: 1.1rem; }
.tk-contact__links { display: flex; flex-direction: column; gap: .2rem; margin-top: .4rem; }
.tk-person-single { display: grid; background: #fff; border: 1px solid var(--tk-line); border-radius: var(--tk-radius); overflow: hidden; box-shadow: var(--tk-shadow); }
@media (min-width: 700px) { .tk-person-single { grid-template-columns: 260px 1fr; } }
.tk-person-single__media { min-height: 200px; display: grid; place-items: center; }
.tk-person-single__media .tk-avatar { width: 110px; height: 110px; font-size: 2rem; position: relative; z-index: 1; }
.tk-page .tk-person-single__media .tk-avatar--img { width: 100%; height: 100%; border-radius: 0; position: absolute; inset: 0; }
.tk-person-single__body { padding: clamp(1.25rem, 3vw, 2rem); display: flex; flex-direction: column; justify-content: center; gap: .3rem; }
.tk-page .tk-person-single h3 { font-size: 1.4rem; margin: 0; }
.tk-person-single .tk-contact__links { flex-direction: row; flex-wrap: wrap; gap: .5rem 1.5rem; }

/* ---------- News ---------------------------------------------------------- */
.tk-news { display: grid; gap: var(--tk-gap); }
@media (min-width: 760px) { .tk-news { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) {
  .tk-news:not(.tk-news--3):not(.tk-news--list) { grid-template-columns: 1.4fr 1fr; }
  .tk-news:not(.tk-news--3):not(.tk-news--list) > :first-child { grid-row: span 3; }
  .tk-news:not(.tk-news--3):not(.tk-news--list) > :not(:first-child) { flex-direction: row; }
  .tk-news:not(.tk-news--3):not(.tk-news--list) > :not(:first-child) .tk-ph { aspect-ratio: auto; width: 38%; flex: none; }
}
.tk-news--3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important; }
.tk-news--list { grid-template-columns: 1fr !important; }
.tk-page .tk-news h3 { margin: .35rem 0 .4rem; }
.tk-news p { color: var(--tk-muted); font-size: .975rem; margin: 0 0 .75rem; }
.tk-readmore { margin-top: auto; font-weight: 700; font-size: .9375rem; color: var(--tk-blue); }

/* ---------- Veranstaltungen ---------------------------------------------- */
.tk-events { list-style: none; margin: 0 0 1rem; padding: 0; }
.tk-events li { display: grid; grid-template-columns: 4.75rem minmax(0, 1fr); gap: 1.1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--tk-line); }
.tk-events li:first-child { padding-top: 0; }
.tk-events li:last-child { border-bottom: 0; }
.tk-date { border-radius: 10px; overflow: hidden; text-align: center; border: 1px solid var(--tk-line); background: #fff; height: fit-content; }
.tk-date b { display: block; font-size: 1.5rem; line-height: 1; padding: .45rem 0 .3rem; color: var(--tk-navy); }
/* 0.1.7: month + year ("SEP 2027") always fully visible */
.tk-date span { display: block; background: var(--tk-blue); color: #fff; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: .22rem .15rem; white-space: nowrap; }
.tk-page .tk-events h4 { margin: 0 0 .2rem; font-size: 1.075rem; }
.tk-page .tk-events h4 a { color: inherit; text-decoration: none; }
.tk-events p { margin: 0; font-size: .925rem; color: var(--tk-muted); }

/* ---------- FuPa (Platzhalter, lädt nichts Externes) ---------------------- */
.tk-fupa-grid { display: grid; gap: var(--tk-gap); }
@media (min-width: 900px) { .tk-fupa-grid--2 { grid-template-columns: 1fr 1fr; } .tk-fupa-grid--3 { grid-template-columns: repeat(3, 1fr); } }
.tk-fupa { background: #fff; border: 1px solid var(--tk-line); border-radius: var(--tk-radius); overflow: hidden; box-shadow: var(--tk-shadow); display: flex; flex-direction: column; min-width: 0; }
.tk-fupa__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--tk-line); }
.tk-page .tk-fupa__head h3 { margin: 0; font-size: 1.15rem; }
.tk-fupa__src { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--tk-muted); background: var(--tk-bg); padding: .25rem .55rem; border-radius: 4px; white-space: nowrap; }
.tk-fupa__desc { padding: .9rem 1.25rem 0; margin: 0; font-size: .925rem; color: var(--tk-muted); }
.tk-fupa__stage { position: relative; margin: 1rem 1.25rem 1.25rem; border-radius: var(--tk-radius-s); min-height: 260px; overflow: hidden; background: var(--tk-bg); }
.tk-fupa__ghost { padding: 1rem; filter: blur(1.5px); opacity: .55; pointer-events: none; }
.tk-fupa__gate { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .5rem; padding: 1.5rem; background: linear-gradient(180deg, rgba(240,246,251,.55), rgba(240,246,251,.95) 45%); }
.tk-fupa__ico { width: 44px; height: 44px; border-radius: 50%; background: var(--tk-navy); color: #fff; display: grid; place-items: center; font-weight: 800; }
.tk-fupa__gate p { font-size: .85rem; color: var(--tk-muted); max-width: 42ch; margin: 0; }
.tk-fupa__gate .tk-btn { font-size: .9rem; padding: .6rem 1.1rem; min-height: 44px; margin-top: .25rem; }
.tk-fupa__foot { font-size: .875rem; padding: 0 1.25rem 1rem; margin: auto 0 0; }
/* Widget-Container: nur der äußere Rahmen wird gestaltet. Innerhalb des FuPa-Widgets gibt es keine eigenen Regeln
   (FuPa-Nutzungsbedingungen: Inhalte nur unverändert über das Widget). Breite Tabellen scrollen innerhalb der Kachel. */
.tk-fupa__widget { margin: 0 1.25rem 1rem; max-width: calc(100% - 2.5rem); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tk-fupa__widget.is-pending { min-height: 0; }
.tk-fupa__stage--info { min-height: 0; }
.tk-fupa__stage--info .tk-fupa__gate { position: static; background: none; }
.tk-fupa__status { min-height: 1.4em; margin: .25rem 0 0; font-size: .875rem; color: var(--tk-muted); }
.tk-fupa__status.is-error { color: #b42318; font-weight: 600; }
.tk-fupa__stage.is-loading .tk-btn { opacity: .7; cursor: progress; }
.tk-fupa__stage.is-loading .tk-fupa__ico { animation: tk-pulse 1s ease-in-out infinite; }
@keyframes tk-pulse { 50% { opacity: .35; } }
.tk-sk { display: block; height: 10px; border-radius: 4px; background: #d5e5f1; }
.tk-sk-row { display: grid; grid-template-columns: 24px 1fr 40px 40px; gap: .6rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--tk-line); }
.tk-sk-match { display: grid; grid-template-columns: 1fr 50px 1fr; gap: .6rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--tk-line); }
.tk-sk-score { height: 26px; border-radius: 6px; background: var(--tk-navy); opacity: .45; }
.tk-sk-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: .75rem; }
.tk-sk-player { display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.tk-sk-player i { width: 52px; height: 52px; border-radius: 50%; background: #d5e5f1; display: block; }
.tk-sk-player .tk-sk { width: 70%; }

/* ---------- Galerie ------------------------------------------------------- */
.tk-gallery { display: grid; gap: .6rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tk-gallery > :first-child { grid-column: 1 / -1; }
.tk-gallery figure { margin: 0; min-width: 0; }
.tk-gallery .tk-ph { border-radius: var(--tk-radius-s); aspect-ratio: 1; }
.tk-gallery > :first-child .tk-ph { aspect-ratio: 16 / 9; }
@media (min-width: 760px) {
  .tk-gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tk-gallery > :first-child { grid-column: span 2; grid-row: span 2; }
  .tk-gallery > :first-child .tk-ph { aspect-ratio: auto; height: 100%; }
}
.tk-gallery figcaption { font-size: .8rem; color: var(--tk-muted); padding-top: .3rem; }

/* ---------- Downloads ----------------------------------------------------- */
.tk-downloads { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.tk-page .tk-downloads a { display: flex; align-items: center; gap: 1rem; padding: .9rem 1rem; border: 1px solid var(--tk-line); border-radius: var(--tk-radius-s); text-decoration: none; color: var(--tk-ink); background: #fff; }
.tk-page .tk-downloads a:hover { border-color: var(--tk-blue); }
.tk-file { width: 42px; height: 50px; border-radius: 6px; background: var(--tk-navy); color: #fff; font-size: .7rem; font-weight: 800; display: grid; place-items: end center; padding-bottom: .4rem; flex: none; }
.tk-downloads small { display: block; color: var(--tk-muted); }
.tk-dl { margin-left: auto; font-weight: 700; color: var(--tk-blue); font-size: .875rem; white-space: nowrap; }

/* ---------- Kontakt / Mitmachen ------------------------------------------ */
.tk-cta { position: relative; border-radius: calc(var(--tk-radius) + 6px); overflow: hidden; color: #fff; background: var(--tk-navy); isolation: isolate; container: tk-cta / inline-size; display: flex; flex-direction: column; }
.tk-cta::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5; background: radial-gradient(ellipse 60% 90% at 100% 0%, var(--tk-blue), transparent 70%), radial-gradient(ellipse 40% 60% at 0% 100%, var(--tk-blue-dark), transparent 70%); }
/* 0.1.5: layout follows the width of the TILE (container query), not of the window – works for 12/12, 8/12, 6/12, 4/12 */
/* 0.1.6: height from the tile width (16:7, 9–20rem) instead of aspect-ratio + max-height, which made Firefox shrink the
   image width; always full tile width */
.tk-cta__media { width: 100%; height: 14rem; height: clamp(9rem, 43.75cqi, 20rem); overflow: hidden; background: var(--tk-blue-dark); }
.tk-cta__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tk-cta__inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; padding: clamp(1.75rem, 5vw, 3.5rem); padding: clamp(1.25rem, 6cqi, 3.5rem); align-items: center; align-content: start; flex: 1; }
.tk-cta__text { min-width: 0; container: tk-cta-text / inline-size; }
/* text and person side by side only when the text column stays wide enough (≥ ~24rem) */
@container tk-cta (min-width: 760px) { .tk-cta--mit-person .tk-cta__inner { grid-template-columns: minmax(0, 1.4fr) minmax(15rem, 1fr); } }
/* 0.1.6: break at word boundaries (no automatic hyphenation); the size follows the width of the TEXT column, so a
   normal word always fits; only a single word longer than the column may break (overflow-wrap) – never overflow */
.tk-page .tk-cta h2 { color: #fff; font-size: clamp(1.75rem, 3.6vw, 2.5rem); font-size: clamp(1.375rem, .55rem + 6.2cqi, 2.5rem); font-weight: 800; line-height: 1.15; overflow-wrap: break-word; word-break: normal; hyphens: manual; text-wrap: balance; }
.tk-cta .tk-richtext { opacity: .9; max-width: 52ch; overflow-wrap: break-word; }
/* 0.1.7: without a person the text uses the tile width (comfortable line length); no empty second column */
.tk-cta:not(.tk-cta--mit-person) .tk-richtext { max-width: 70ch; }
.tk-cta--einspaltig .tk-cta__inner { grid-template-columns: minmax(0, 1fr); }
.tk-cta .tk-kicker { color: var(--tk-blue-pale); }
.tk-page .tk-cta a:not(.tk-btn) { color: var(--tk-blue-pale); }
.tk-page .tk-cta .tk-btn { max-width: 100%; white-space: normal; text-align: center; }
.tk-cta__person { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: var(--tk-radius); padding: 1.25rem; display: flex; gap: 1rem; align-items: center; min-width: 0; }
.tk-cta__person > div { display: flex; flex-direction: column; min-width: 0; }
.tk-cta__person .tk-avatar { background: rgba(255,255,255,.15); color: #fff; flex: none; }
.tk-cta__person a { font-weight: 600; text-decoration: none; font-size: .9rem; overflow-wrap: anywhere; }
.tk-cta__person .fn { color: rgba(255,255,255,.7); font-size: .85rem; }
/* compact: narrow tiles (⅓, ½ on tablets, every width on phones) */
@container tk-cta (max-width: 459px) {
  .tk-cta__media { height: clamp(9rem, 56.25cqi, 16rem); }
  .tk-cta__inner { gap: 1.25rem; padding: 1.25rem; }
  .tk-cta__person { padding: .875rem; gap: .75rem; }
  .tk-page .tk-cta .tk-btn { display: flex; width: 100%; justify-content: center; }
}

/* ---------- Bild-Diagnose (Plugin-Option, nur Super User) --------------- */
.tk-debug { margin: 2rem 0; border: 2px dashed #ea580c; border-radius: 10px; padding: .75rem 1rem; background: #fff7ed; color: #1f2937; font: .875rem/1.45 system-ui, sans-serif; }
.tk-debug summary { cursor: pointer; font-weight: 700; }
.tk-debug table { width: 100%; border-collapse: collapse; margin-top: .75rem; }
.tk-debug th, .tk-debug td { text-align: left; padding: .35rem .5rem; border-top: 1px solid #fed7aa; vertical-align: top; overflow-wrap: anywhere; }
.tk-debug tr.is-ok td:nth-child(2) { color: #15803d; font-weight: 700; }
.tk-debug tr:not(.is-ok):not(.is-leer) td:nth-child(2) { color: #b91c1c; font-weight: 700; }

/* ---------- Entwicklungsansicht (Plugin-Option „Kachelrahmen anzeigen“) --- */
.tk-page--raster [data-kachel] { outline: 2px dashed #ea580c; outline-offset: 4px; position: relative; }
.tk-page--raster [data-kachel]::before { content: attr(data-kachel); position: absolute; left: 0; top: 0; z-index: 5; background: #ea580c; color: #fff; font: 700 .7rem/1 system-ui, sans-serif; padding: .3rem .45rem; border-radius: 0 0 4px 0; }

@media (prefers-reduced-motion: reduce) { .tk-page * { transition: none !important; } }

/* ---------- 0.1.7: Sprungmarken --------------------------------------------- */
/* targets stay below the sticky header of tsg_salach6 (80–92 px); override with --tk-anker-abstand if needed */
.tk-page :is(.tk-section, .tk-cell)[id] { scroll-margin-top: var(--tk-anker-abstand, 7.5rem); }
@media (prefers-reduced-motion: no-preference) { html:has(.tk-page) { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) { html:has(.tk-page) { scroll-behavior: auto; } }

/* =========================================================================
   0.2.2: alle Bilder des Baukastens vollständig sichtbar (contain)
   Nur Baukasten-Klassen; keine globale img-Regel. Kachelgrößen bleiben unverändert, das Bild passt sich
   der vorhandenen Fläche an (so groß wie möglich, proportional, ohne transform). Freie Flächen: dunkles TSG-Blau.
   Überschreibbar: --tk-bild-fit, --tk-bild-position, --tk-bild-flaeche
   ========================================================================= */
.tk-page { --tk-bild-fit: contain; --tk-bild-position: center; --tk-bild-flaeche: var(--tk-navy); }

/* 0.2.4: Der Hero ist hiervon ausgenommen. Sein Bild füllt wieder die ganze Hero-Fläche (cover + center, Regel oben
   bei den Grundregeln), Texte und dunkler Verlauf liegen darüber. */

/* Kontakt-Kachel: Bildstreifen mit fester Höhe */
.tk-page .tk-cta__media { background: var(--tk-bild-flaeche); }
.tk-page .tk-cta__img { object-fit: var(--tk-bild-fit, contain); object-position: var(--tk-bild-position, center); }

/* Personenfotos (rund bzw. Bildfläche der Einzelperson) */
.tk-page .tk-avatar--img { object-fit: var(--tk-bild-fit, contain); object-position: center; background: var(--tk-bild-flaeche); }
