/*
 * pixel-dreieck.de – Basis-Design
 *
 * Aufbau:
 *   1. Schriften          5. Navigation           9. Karten, Chips, Tabellen
 *   2. Design-Tokens      6. Seitenkopf/Inhalt   10. Bildraster & Medien
 *   3. Bootstrap-Bindung  7. Footer              11. Hilfsklassen
 *   4. Grundlayout        8. Formulare & Buttons 12. Druck
 *
 * Vereinsfarben setzt das Layout als --club-* (siehe templates/layout/base.twig).
 * Seitenspezifische Styles liegen in eigenen Dateien (cms.css, gallery.css …).
 */

/* 1. Schriften ------------------------------------------------------------ */
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/roboto-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/roboto-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("../fonts/montserrat-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("../fonts/montserrat-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Merriweather Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/merriweather-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Merriweather Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/merriweather-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* 2. Design-Tokens --------------------------------------------------------- */
:root {
  /* Fallbacks, falls das Layout keine Vereinsfarben setzt */
  --club-primary: #178893;
  --club-primary-rgb: 23, 136, 147;
  --club-primary-hover: #136f78;
  --club-primary-text: #12707a;
  --club-on-primary: #ffffff;
  --club-secondary: #4ea2ab;
  --club-secondary-rgb: 78, 162, 171;
  /* Linkfarbe (RGB) und Akzentlinien; im Dunkelmodus hell, siehe unten */
  --club-link-rgb: var(--club-primary-rgb);
  --club-link-hover: var(--club-primary-hover);
  --club-accent-line: var(--club-primary);

  --font-sans: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Merriweather Sans", var(--font-sans);
  --font-editorial: "Montserrat", var(--font-sans);

  --nav-height: 5.5rem;
  /* Hell: Papierton wie --hp-paper der Startseite statt reinem Weiß */
  --surface: #f2f0eb;
  --surface-muted: #e9e6df;
  --surface-hover: #e9e6df;
  --line: #cac4d0;
  --ink: #1c1b1f;
  --ink-muted: #49454f;
  --paper: #f2f0eb;
  /* Bootstrap-Flächen (Seite, Karten, Felder, Dialoge) ebenfalls im Papierton */
  --bs-body-bg: #f2f0eb;
  --bs-body-bg-rgb: 242, 240, 235;
  --bs-secondary-bg: #e9e6df;
  --bs-secondary-bg-rgb: 233, 230, 223;
  --bs-tertiary-bg: #ebe8e1;
  --bs-tertiary-bg-rgb: 235, 232, 225;
  --danger-led: #e02020;
  /* Abgeleitete Flächen/Texte – folgen dem Modus (Werte für dunkel siehe unten) */
  --line-soft: rgba(28, 27, 31, .12);
  --inverse-bg: var(--ink);          /* umgekehrte Fläche: dunkel im Hellen, hell im Dunkeln */
  --inverse-fg: var(--surface);
  --placeholder-bg: #ececec;         /* Silhouetten / Bild-Platzhalter */
  --placeholder-fg: #b3b3b3;
  --text-warn: #8a5300;
  --text-ok: #1e7b34;
  --text-error: #b3261e;
  --elevation-1: 0 1px 2px rgba(0, 0, 0, .18), 0 1px 3px 1px rgba(0, 0, 0, .08);
  --elevation-2: 0 8px 24px rgba(0, 0, 0, .10);
  --nav-gradient:
    radial-gradient(circle at top right, rgba(255, 255, 255, .28), transparent 38%),
    linear-gradient(145deg, rgba(var(--club-primary-rgb), .98), rgba(var(--club-primary-rgb), .80));
}

[data-bs-theme="dark"] {
  --surface: #1e1e22;
  --surface-muted: #26262b;
  --surface-hover: #2c2c33;
  --line: #3d3d46;
  --ink: #ececf1;
  --ink-muted: #b4b4bf;
  --paper: #18181b;
  --line-soft: rgba(255, 255, 255, .12);
  --inverse-bg: var(--ink);
  --inverse-fg: var(--surface);
  --placeholder-bg: #34343c;
  --placeholder-fg: #4f4f5a;
  --text-warn: #ffb15c;
  --text-ok: #7bd88f;
  --text-error: #ff9b94;
  /* Bootstrap-Flächen an die neutralen Grautöne angleichen (statt bläulich #212529) */
  --bs-body-bg: #18181b;
  --bs-body-bg-rgb: 24, 24, 27;
  --bs-secondary-bg: #26262b;
  --bs-secondary-bg-rgb: 38, 38, 43;
  --bs-tertiary-bg: #1e1e22;
  --bs-tertiary-bg-rgb: 30, 30, 34;
  --bs-body-color: var(--ink);
}

/*
 * Dunkelmodus: nie Vereinsfarbe als Schrift auf Dunkelgrau (zu wenig Kontrast).
 * Links, Akzent-Texte, Outline-Buttons, aktive Tabs, .text-primary und Chips
 * werden hell (#f1f1f5 auf #18181b ≈ 16:1); die Vereinsfarbe bleibt für Flächen
 * (gefüllte Buttons, Navigation) und als aufgehellte Akzentlinie/Unterstreichung.
 * :root[…] ist nötig, weil theme_css() die Vereinsfarben später als :root setzt.
 */
:root[data-bs-theme="dark"],
[data-bs-theme="dark"] {
  --club-primary-text: #f1f1f5;
  --club-link-rgb: 241, 241, 245;
  --club-link-hover: #ffffff;
  --club-accent-line: color-mix(in srgb, var(--club-primary) 55%, white);
}

/* 3. Bootstrap an Vereinsfarben binden ------------------------------------ */
:root,
[data-bs-theme="light"],
[data-bs-theme="dark"] {
  --bs-primary: var(--club-primary);
  --bs-primary-rgb: var(--club-primary-rgb);
  --bs-link-color: var(--club-primary-text);
  --bs-link-color-rgb: var(--club-link-rgb);
  --bs-link-hover-color: var(--club-link-hover);
  --bs-link-hover-color-rgb: var(--club-link-rgb);
  --bs-primary-text-emphasis: var(--club-primary-text);
  --bs-primary-bg-subtle: rgba(var(--club-primary-rgb), .10);
  --bs-primary-border-subtle: rgba(var(--club-primary-rgb), .35);
  --bs-focus-ring-color: rgba(var(--club-primary-rgb), .35);
  --bs-body-font-family: var(--font-sans);
  --bs-border-radius: 0;
  --bs-border-radius-sm: 0;
  --bs-border-radius-lg: 0;
  --bs-border-radius-xl: 0;
  --bs-border-radius-xxl: 0;
  --bs-border-color: var(--line);
}

.btn { --bs-btn-border-radius: 0; font-weight: 500; letter-spacing: .02em; }
.btn-primary {
  --bs-btn-color: var(--club-on-primary);
  --bs-btn-bg: var(--club-primary);
  --bs-btn-border-color: var(--club-primary);
  --bs-btn-hover-color: var(--club-on-primary);
  --bs-btn-hover-bg: var(--club-primary-hover);
  --bs-btn-hover-border-color: var(--club-primary-hover);
  --bs-btn-active-color: var(--club-on-primary);
  --bs-btn-active-bg: var(--club-primary-hover);
  --bs-btn-active-border-color: var(--club-primary-hover);
  --bs-btn-disabled-bg: var(--club-primary);
  --bs-btn-disabled-border-color: var(--club-primary);
  --bs-btn-focus-shadow-rgb: var(--club-primary-rgb);
}
.btn-outline-primary {
  --bs-btn-color: var(--club-primary-text);
  --bs-btn-border-color: var(--club-primary);
  --bs-btn-hover-color: var(--club-on-primary);
  --bs-btn-hover-bg: var(--club-primary);
  --bs-btn-hover-border-color: var(--club-primary);
  --bs-btn-active-color: var(--club-on-primary);
  --bs-btn-active-bg: var(--club-primary-hover);
  --bs-btn-active-border-color: var(--club-primary-hover);
  --bs-btn-focus-shadow-rgb: var(--club-primary-rgb);
}
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: var(--club-primary);
  box-shadow: 0 0 0 .2rem rgba(var(--club-primary-rgb), .25);
}
.form-check-input:checked {
  background-color: var(--club-primary);
  border-color: var(--club-primary);
}
.nav-pills { --bs-nav-pills-link-active-bg: var(--club-primary); }
.pagination {
  --bs-pagination-active-bg: var(--club-primary);
  --bs-pagination-active-border-color: var(--club-primary);
  --bs-pagination-color: var(--club-primary-text);
}
.progress, .progress-stacked { --bs-progress-bar-bg: var(--club-primary); }
.dropdown-menu {
  --bs-dropdown-link-active-bg: var(--club-primary);
  --bs-dropdown-border-radius: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}
.text-primary { color: var(--club-primary-text) !important; }
.bg-primary { background-color: var(--club-primary) !important; color: var(--club-on-primary); }

/* Dunkelmodus: helle Schrift, Vereinsfarbe als Linie bzw. gefüllte Fläche */
[data-bs-theme="dark"] a:not(.btn) { text-decoration-color: var(--club-accent-line); text-underline-offset: .18em; }
[data-bs-theme="dark"] a:not(.btn):hover,
[data-bs-theme="dark"] .site-footer a { text-decoration-color: currentColor; }
[data-bs-theme="dark"] .btn-outline-primary {
  --bs-btn-color: var(--club-primary-text);
  --bs-btn-border-color: var(--club-accent-line);
  --bs-btn-hover-border-color: var(--club-primary);
}
[data-bs-theme="dark"] .btn-primary { box-shadow: 0 0 0 1px rgba(255, 255, 255, .14); }
/* Bootstrap-Grautöne/Rot im Dunkelmodus kontrastreicher (≥ 4,5:1) */
[data-bs-theme="dark"] .btn-outline-secondary { --bs-btn-color: #d2d2da; --bs-btn-border-color: #6b6b76; }
[data-bs-theme="dark"] .btn-outline-danger { --bs-btn-color: var(--ink); --bs-btn-border-color: #e35d6a; }
[data-bs-theme="dark"] { --bs-code-color: #d6d6de; }
[data-bs-theme="dark"] .pagination { --bs-pagination-active-color: var(--club-on-primary); }
[data-bs-theme="dark"] .nav-pills { --bs-nav-pills-link-active-color: var(--club-on-primary); }

/* Einheitlicher, gut sichtbarer Tastaturfokus */
:focus-visible {
  outline: 2px solid var(--club-primary);
  outline-offset: 2px;
}
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible {
  outline: 2px solid var(--club-primary);
  outline-offset: 1px;
}
[data-bs-theme="dark"] :focus-visible { outline-color: var(--club-accent-line); }

/* 4. Grundlayout ------------------------------------------------------------ */
/*
 * Der Bereich, den der Browser beim Über-Scrollen (Herunterziehen auf dem
 * Handy) oberhalb/unterhalb der Seite zeigt, hat die Vereinsfarbe – so wirkt
 * der Header beim Herunterziehen nahtlos und „löst sich nicht ab“.
 */
html {
  scroll-padding-top: calc(var(--nav-height) + 1rem);
  background-color: var(--club-primary);
}
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--bs-body-bg);
  overflow-x: clip;
}
main { flex: 1 0 auto; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 2000;
  padding: .75rem 1rem;
  background: var(--club-primary);
  color: var(--club-on-primary);
  font-weight: 600;
}
.skip-link:focus { top: 1rem; }

h1, h2, h3, h4, h5, h6 { font-weight: 500; }
.display-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
}

/* 5. Navigation ------------------------------------------------------------ */
/* Normale Leiste, die beim Scrollen oben „kleben“ bleibt (kein eigener Scroll-Container). */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1030;
  min-height: var(--nav-height);
  background-color: var(--club-primary);
  background-image: var(--nav-gradient);
  box-shadow: 0 8px 8px -8px rgba(0, 0, 0, .22);
  --bs-navbar-color: color-mix(in srgb, var(--club-on-primary) 90%, transparent);
  --bs-navbar-hover-color: var(--club-on-primary);
  --bs-navbar-active-color: var(--club-on-primary);
  --bs-navbar-brand-color: var(--club-on-primary);
  --bs-navbar-brand-hover-color: var(--club-on-primary);
  --bs-navbar-toggler-border-color: color-mix(in srgb, var(--club-on-primary) 40%, transparent);
  transition: background-color .25s ease, backdrop-filter .25s ease;
}
.site-nav .navbar-toggler-icon { filter: invert(var(--club-on-primary-invert, 1)); }
.site-nav .nav-link {
  position: relative;
  font-weight: 600;
  font-size: .92rem;
  letter-spacing: .02em;
  padding-inline: .8rem !important;
}
.site-nav .nav-link:not(.dropdown-toggle)::after {
  content: "";
  position: absolute;
  left: .8rem;
  right: .8rem;
  bottom: .25rem;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s cubic-bezier(.76, 0, .24, 1);
}
.site-nav .nav-link:not(.dropdown-toggle):hover::after,
.site-nav .nav-link.active:not(.dropdown-toggle)::after { transform: scaleX(1); }
/* Kleines Dreieck an Ausklapp-Menüs (Intern, Sprache) */
.site-nav .dropdown-toggle::after { vertical-align: .15em; margin-left: .3em; }
.site-nav .dropdown-item.indent { padding-left: 2rem; font-size: .875rem; }
.site-nav .dropdown-item.active,
.site-nav .dropdown-item:active { color: var(--club-on-primary); }
.site-nav .dropdown-header { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }

.brand-logo {
  height: 64px;
  max-width: 280px;
  width: auto;
  object-fit: contain;
  margin-block: -.45rem;
}
.brand-logo.is-inverted { filter: brightness(0) invert(1); }
.brand-text { font-weight: 700; font-size: 1.25rem; }

/* Navigation transparent über einem Hero-Bild am Seitenanfang */
body.nav-over-hero .site-nav {
  position: fixed;
  left: 0;
  right: 0;
}
body.nav-over-hero .site-nav:not(.is-scrolled):not(.is-open) {
  background-color: rgba(45, 45, 53, .55);
  background-image: none;
  backdrop-filter: blur(12px);
  box-shadow: none;
  border-bottom: 1px solid rgba(255, 255, 255, .18);
}

/*
 * Hinweise auf offene Punkte (wie in der Vorlage):
 * - .nav-dot  blinkender weißer Punkt am Menü „Intern“
 * - .nav-badge rote, pulsierende LED am jeweiligen Eintrag (Zahl nur für Screenreader)
 */
.nav-badge {
  display: inline-block;
  flex: 0 0 auto;
  width: .55rem;
  height: .55rem;
  margin-left: .6rem;
  border-radius: 50%;
  background: var(--danger-led);
  font-size: 0;
  color: transparent;
  overflow: hidden;
  animation: nav-led-glow 1.6s ease-in-out infinite;
}
.nav-badge[hidden] { display: none; }
.nav-dot {
  display: inline-block;
  width: .45rem;
  height: .45rem;
  margin-left: .35rem;
  border-radius: 50%;
  background: #fff;
  vertical-align: .2em;
  animation: nav-dot-blink 1.1s steps(2, jump-none) infinite;
}
@keyframes nav-led-glow {
  0%, 100% { box-shadow: 0 0 2px 1px rgba(224, 32, 32, .55); }
  50% { box-shadow: 0 0 8px 3px rgba(224, 32, 32, .95); }
}
@keyframes nav-dot-blink {
  0% { opacity: 1; }
  100% { opacity: .15; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-badge, .nav-dot { animation: none; }
}

.impersonation-banner {
  position: sticky;
  top: var(--nav-height);
  z-index: 1020;
  background: #fff3cd;
  color: #664d03;
}

@media (max-width: 991.98px) {
  .site-nav .navbar-collapse {
    max-height: calc(100svh - var(--nav-height));
    overflow-y: auto;
    /* Scrollen im offenen Menü löst kein Neuladen der Seite aus */
    overscroll-behavior: contain;
    padding-bottom: 1rem;
  }
  .site-nav .dropdown-menu {
    --bs-dropdown-bg: transparent;
    --bs-dropdown-link-color: var(--bs-navbar-color);
    --bs-dropdown-link-hover-color: var(--club-on-primary);
    --bs-dropdown-link-hover-bg: rgba(255, 255, 255, .1);
    --bs-dropdown-header-color: color-mix(in srgb, var(--club-on-primary) 70%, transparent);
    --bs-dropdown-divider-bg: rgba(255, 255, 255, .25);
    box-shadow: none;
    border: 0;
  }
  .site-nav .nav-link:not(.dropdown-toggle)::after { display: none; }
  /* Logo und Menü-Button bleiben in einer Zeile: das Logo schrumpft notfalls */
  .site-nav > .container { flex-wrap: wrap; }
  .site-nav .navbar-brand { flex: 1 1 0; min-width: 0; margin-right: .75rem; }
  .site-nav .navbar-toggler { flex: 0 0 auto; }
  .site-nav .navbar-collapse { flex-basis: 100%; }
  .brand-logo { height: 48px; max-width: 100%; }
}

/* 6. Seitenkopf und Inhalt --------------------------------------------------- */
.page-header {
  padding: 2.5rem 0 1.5rem;
}
.page-header .display-title { font-size: clamp(1.9rem, 4.5vw, 3.2rem); margin: 0; }
.page-header .lead { color: var(--ink-muted); margin-top: .5rem; }
.page-section { padding: clamp(2.5rem, 6vw, 5rem) 0; }
.page-section.is-muted { background: var(--surface-muted); }
.content-narrow { max-width: 46rem; }
.prose { line-height: 1.7; }
.prose img { max-width: 100%; height: auto; }
.prose h2, .prose h3 { margin-top: 1.75rem; }

/* 7. Footer -------------------------------------------------------------- */
.site-footer { margin-top: auto; color: var(--club-on-primary); }
.site-footer a { color: inherit; }
.site-footer-club {
  background-color: var(--club-primary);
  background-image: var(--nav-gradient);
  padding: 2.5rem 0;
}
.site-footer-club address { font-style: normal; line-height: 1.65; margin: 0; }
.footer-logo { max-height: 128px; max-width: min(100%, 420px); width: auto; }
.footer-logo.is-inverted { filter: brightness(0) invert(1); }
.site-footer-legal {
  background: color-mix(in srgb, var(--club-primary) 75%, black);
  padding: 1rem 0;
  font-size: .85rem;
}
.site-footer-legal a { text-decoration: none; }
.site-footer-legal a:hover { text-decoration: underline; }

/* 8. Formulare & Buttons --------------------------------------------------- */
.form-label { font-weight: 500; }
.form-text { color: var(--ink-muted); }
.required::after { content: " *"; color: var(--bs-danger); }
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
}
.form-section + .form-section { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.auth-card { max-width: 28rem; margin-inline: auto; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* Unterstrichene, eckige Felder wie in der Vorlage (Material „md-field“) ------ */
.md-line > .form-control,
.md-line-input.form-control {
  border: 0;
  border-bottom: 1px solid var(--md-line-color, var(--line));
  border-radius: 0;
  background: var(--md-line-bg, transparent);
  color: var(--ink);
  box-shadow: none;
  padding-left: .35rem;
  padding-right: .35rem;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.md-line > .form-control:focus,
.md-line-input.form-control:focus {
  border-bottom-color: var(--club-accent-line);
  box-shadow: 0 1px 0 0 var(--club-accent-line);
  background: var(--md-line-bg-focus, transparent);
  outline: none; /* Fokus zeigt die kräftige Unterlinie */
}
.form-floating.md-line > label { padding-left: .35rem; padding-right: .35rem; color: var(--ink-muted); }
.form-floating.md-line > label::after { background: transparent !important; }
.form-floating.md-line > .form-control:focus ~ label,
.form-floating.md-line > .form-control:not(:placeholder-shown) ~ label { color: var(--club-primary-text); opacity: 1; }
.form-floating.md-line > .form-control:-webkit-autofill { -webkit-text-fill-color: var(--ink); box-shadow: 0 0 0 1000px var(--md-line-autofill, var(--surface)) inset; }


/* 9. Karten, Chips, Tabellen ------------------------------------------------ */
.card { --bs-card-border-color: var(--line); --bs-card-border-radius: 0; --bs-card-inner-border-radius: 0; }
.card-hover { transition: transform .2s ease, box-shadow .2s ease; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--elevation-2); }
.card-cover { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; background: var(--surface-muted); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .55rem;
  font-size: .75rem;
  font-weight: 500;
  background: var(--surface-muted);
  color: var(--ink-muted);
}
.chip-primary { background: rgba(var(--club-primary-rgb), .12); color: var(--club-primary-text); }
[data-bs-theme="dark"] .chip-primary { background: rgba(var(--club-primary-rgb), .38); box-shadow: inset 2px 0 0 var(--club-accent-line); }
.table-modern { --bs-table-hover-bg: var(--surface-hover); }
.table-modern > thead th {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-muted);
  border-bottom-width: 2px;
}
.table-modern td, .table-modern th { vertical-align: middle; }
.empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--ink-muted);
  border: 1px dashed var(--line);
}
.empty-state .bi { font-size: 2rem; display: block; margin-bottom: .5rem; }

.avatar {
  width: var(--avatar-size, 3rem);
  height: var(--avatar-size, 3rem);
  object-fit: cover;
  background: #d9d9d9;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Admin-Bereich: Seitenleiste mit Unterseiten */
.admin-tabs { border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }
.admin-tabs .nav-link { color: var(--ink-muted); border-radius: 0; }
.admin-tabs .nav-link.active { color: var(--club-primary-text); border-bottom: 2px solid var(--club-accent-line); font-weight: 600; }

/* 10. Bildraster & Medien --------------------------------------------------- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 4px;
}
.photo-tile {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: var(--tile-ratio, 4 / 3);
  background: linear-gradient(90deg, #ececec, #f5f5f5, #ececec);
  background-size: 200% 100%;
}
.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}
.photo-tile:hover img { transform: scale(1.06); }
.photo-tile-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.5rem .75rem .5rem;
  color: #fff;
  font-size: .85rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, .65));
  opacity: 0;
  transition: opacity .25s ease;
}
.photo-tile:hover .photo-tile-caption,
.photo-tile:focus-visible .photo-tile-caption { opacity: 1; }
@media (hover: none) { .photo-tile-caption { opacity: 1; } }

.pswp__custom-caption {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  max-width: min(90vw, 50rem);
  padding: .5rem 1rem;
  background: rgba(0, 0, 0, .65);
  color: #fff;
  text-align: center;
}

/* 11. Hilfsklassen --------------------------------------------------------- */
.text-muted-2 { color: var(--ink-muted) !important; }
.min-w-0 { min-width: 0; }
.ratio-cover { object-fit: cover; width: 100%; height: 100%; }
/*
 * Dezentes Einfahren beim Hereinscrollen (app.js setzt .is-visible, einmalig).
 * Richtung: data-reveal="left" | "right" (seitlich), sonst leicht von unten.
 * Mehrere gleichzeitig sichtbare Elemente werden gestaffelt (--reveal-delay).
 */
.fade-in-up {
  --reveal-dist: 32px;
  --reveal-x: 0px;
  --reveal-y: 1.25rem;
  opacity: 0;
  transform: translate3d(var(--reveal-x), var(--reveal-y), 0);
  filter: blur(6px);
  transition:
    opacity .6s ease-out var(--reveal-delay, 0s),
    transform .6s cubic-bezier(.22, .61, .36, 1) var(--reveal-delay, 0s),
    filter .6s ease-out var(--reveal-delay, 0s);
}
.fade-in-up[data-reveal="left"] { --reveal-x: calc(var(--reveal-dist) * -1); --reveal-y: 0px; }
.fade-in-up[data-reveal="right"] { --reveal-x: var(--reveal-dist); --reveal-y: 0px; }
.fade-in-up.is-visible { opacity: 1; transform: none; filter: none; }
@media (max-width: 767.98px) { .fade-in-up { --reveal-dist: 20px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .fade-in-up { opacity: 1; transform: none; filter: none; transition: none; }
}

/* 12. Druck ---------------------------------------------------------------- */
@media print {
  body { padding-top: 0; }
  .site-nav, .site-footer, .skip-link, .btn, .impersonation-banner, .toast-container, form { display: none !important; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; }
  img { break-inside: avoid; }
}

/* Code-Schnipsel (z. B. Pfade) neutral statt Bootstrap-Pink, in beiden Modi */
:root, [data-bs-theme="light"], [data-bs-theme="dark"] { --bs-code-color: var(--ink-muted); }

/* Klickbare Tabellenzeilen (tr[data-href], siehe app.js) */
tr[data-href] { cursor: pointer; }
tr[data-href] > td { transition: background-color .15s ease; }
tr[data-href]:hover > td { background-color: var(--surface-hover); }
tr[data-href]:hover > td:first-child { box-shadow: inset 3px 0 0 var(--club-primary); }

/* Sortierbare Spaltenüberschriften (lib/table-sort.js) */
th.th-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.th-sortable::after {
  content: "";
  display: inline-block;
  width: .55em;
  height: .55em;
  margin-left: .4em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: .25;
  transform: translateY(-.15em) rotate(45deg);
  transition: transform .15s ease, opacity .15s ease;
}
th.th-sortable:hover::after, th.th-sortable:focus-visible::after { opacity: .6; }
th.th-sortable[aria-sort="ascending"]::after { opacity: 1; transform: translateY(.1em) rotate(-135deg); }
th.th-sortable[aria-sort="descending"]::after { opacity: 1; transform: translateY(-.15em) rotate(45deg); }

/*
 * „Neuer Eintrag“ als letzte Tabellenzeile (einheitlich in allen Listen):
 *   <tr class="row-new" data-row-fixed>
 *     <td class="row-new-icon"><i class="bi bi-plus-lg"></i></td>
 *     <td colspan="…"><input class="row-new-input" placeholder="Neue Zusatzseite …"></td> …
 * Wirkt wie ein Eingabefeld: gestrichelte Linie, Platzhaltertext, Plus vorne.
 */
tr.row-new > td { background: transparent; border-top: 1px dashed var(--line); border-bottom: 0; }
tr.row-new:hover > td, tr.row-new:focus-within > td { background: rgba(var(--club-primary-rgb), .05); }
tr.row-new .row-new-icon { width: 1%; color: var(--club-primary-text); font-size: 1.15rem; text-align: center; }
.row-new-input {
  width: 100%;
  padding: .35rem .25rem;
  border: 0;
  border-bottom: 1px dashed var(--line);
  background: transparent;
  color: var(--ink);
}
.row-new-input::placeholder { color: var(--ink-muted); font-style: italic; }
.row-new-input:focus { outline: none; border-bottom: 2px solid var(--club-primary); }
a.row-new-link { display: flex; align-items: center; gap: .5rem; color: var(--ink-muted); font-style: italic; text-decoration: none; }
a.row-new-link:hover { color: var(--club-primary-text); }
a.row-new-link > .bi { color: var(--club-primary-text); font-size: 1.15rem; font-style: normal; }
/* Plus und Eingabe in derselben Zelle (Tabellen ohne eigene Symbolspalte) */
.row-new-field { display: flex; align-items: center; gap: .5rem; }
.row-new-field > .bi { color: var(--club-primary-text); font-size: 1.15rem; }
.row-new-field > .row-new-input { flex: 1 1 auto; min-width: 6rem; width: auto; }
.row-new-field > .row-new-submit { display: none; }
.row-new-field:focus-within > .row-new-submit { display: inline-block; }

/* Sammlungs-Auswahl mit Titelbild-Miniaturen: templates/partials/collection_picker.twig und
   <select data-collection-select> (@app/collection-select) – überall auf der Seite gleich */
.live-collection-picker { min-width: 0; }
.live-collection-menu { max-height: 22rem; overflow-y: auto; }
.live-collection-thumb { width: 48px; height: 32px; object-fit: cover; border-radius: 3px; display: block; flex: none; }
.live-collection-thumb.is-empty { display: grid; place-items: center; background: rgba(128, 128, 128, .18); color: inherit; opacity: .7; }
/* kleine Felder (Filterleisten): Miniatur passend zur Feldhöhe */
.live-collection-picker .form-select-sm { padding-top: .125rem; padding-bottom: .125rem; min-height: calc(1.5em + .5rem + 2px); }
.live-collection-picker .form-select-sm .live-collection-thumb { width: 36px; height: 24px; }
.live-collection-menu .live-collection-thumb-wrap { flex: none; }
.live-collection-menu--floating { max-width: min(30rem, calc(100vw - 2rem)); }

/* Superadmin: Vereinsauswahl (kleines Dreieck) direkt neben dem Logo */
.nav-club-switch { margin-left: -.35rem; }
.nav-club-toggle { padding: .3rem .45rem; font-size: .8rem; line-height: 1; color: var(--bs-navbar-color); text-decoration: none; border: 0; }
.nav-club-toggle:hover, .nav-club-toggle:focus-visible, .nav-club-toggle[aria-expanded="true"] { color: var(--bs-navbar-hover-color); }
.nav-club-toggle .bi { display: inline-block; transition: transform .2s ease; }
.nav-club-toggle[aria-expanded="true"] .bi { transform: rotate(180deg); }
.nav-club-switch .dropdown-menu { max-height: min(70vh, 32rem); overflow-y: auto; }
@media (min-width: 992px) { .nav-club-switch.me-auto { margin-right: 0 !important; } }
/* Mobil: Logo ist breit, das Dreieck sitzt weit rechts – Menü nach links aufklappen */
@media (max-width: 991.98px) { .nav-club-switch .dropdown-menu { left: auto; right: 0; } }
/* Die mobile Navigation macht Dropdowns transparent (fürs aufgeklappte Menü) – die Vereinsauswahl
   schwebt dagegen über der Seite und braucht ihren normalen Hintergrund */
@media (max-width: 991.98px) {
  .site-nav .nav-club-switch .dropdown-menu {
    --bs-dropdown-bg: var(--bs-body-bg);
    --bs-dropdown-link-color: var(--bs-body-color);
    --bs-dropdown-link-hover-color: var(--bs-body-color);
    --bs-dropdown-link-hover-bg: var(--bs-tertiary-bg);
    --bs-dropdown-header-color: var(--bs-secondary-color);
    --bs-dropdown-divider-bg: var(--bs-border-color-translucent);
    border: 1px solid var(--bs-border-color-translucent);
    box-shadow: 0 .6rem 1.6rem rgba(0, 0, 0, .3);
  }
}

/* Mobil: Beim Aufklappen des Burgermenüs wandert das Menü in eine zweite Zeile – die erste Zeile
   (Logo, Vereinsauswahl, Burger) behält dabei die volle Navigationshöhe, sonst rücken Logo und
   Burger nach oben. Höhe = Navigation minus Innenabstand oben/unten der Navbar. */
@media (max-width: 991.98px) {
  .site-nav > .container > .navbar-brand {
    display: flex; align-items: center;
    min-height: calc(var(--nav-height) - 2 * var(--bs-navbar-padding-y, .5rem));
  }
}

/* Direktanlage für Verwaltende auf öffentlichen Seiten (partials/admin_quick_create.twig): Termine, Sammlungen */
.admin-quick { margin: 0 0 1.5rem; }
.admin-quick-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.admin-quick-chevron { margin-left: .35rem; font-size: .8em; transition: transform .2s; display: inline-block; }
.admin-quick-toggle:not(.collapsed) .admin-quick-chevron { transform: rotate(180deg); }
.admin-quick-manage { padding-left: 0; padding-right: 0; }
.admin-quick-panel { margin-top: 1rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-muted, rgba(128, 128, 128, .06)); }
@media (prefers-reduced-motion: reduce) { .admin-quick-chevron { transition: none; } }

/* Ausstellungen: Name in der Liste umbenennen (exhibition-index.js) */
.ex-name-cell { white-space: nowrap; }
.ex-rename-btn { padding: 0 .35rem; color: var(--ink-muted); vertical-align: baseline; }
.ex-rename-btn:hover, .ex-rename-btn:focus-visible { color: var(--club-primary-text); }
.ex-rename-input { display: inline-block; width: min(24rem, 100%); }
/* Personen-Auswahl (@app/collection-select mit data-avatar): rundes Profilbild statt Miniatur */
.live-collection-thumb.is-avatar { width: 32px; height: 32px; border-radius: 50%; }
.live-collection-picker .form-select-sm .live-collection-thumb.is-avatar { width: 24px; height: 24px; }
.live-collection-thumb.is-empty.is-person { width: 32px; border-radius: 50%; }
.live-collection-picker .form-select-sm .live-collection-thumb.is-empty.is-person { width: 24px; height: 24px; }
