/* ===========================================================================
   ÖFFENTLICHE WEBSITE — eigenständiges CSU-Design („Kampagne/Editorial").
   Wird NUR im layout_public.php geladen (nach custom.css + Theme-Overlay)
   und überschreibt dort den Portal-„App-Look" komplett: scharfe Geometrie
   statt runder Karten, Raute als Leitmotiv, kräftiges Farb-Blocking in
   CSU-Blau/Navy, diagonale Sektionskanten, Offset-Schatten, Groß-Typo.
   Das Mitgliederportal bleibt unangetastet (lädt diese Datei nicht).

   Motion: public-motion.js versieht Elemente mit .reveal und schaltet .in
   beim Sichtbarwerden. Ohne JS, unter prefers-reduced-motion und unter
   Playwright (navigator.webdriver) ist ALLES sofort sichtbar.
   ======================================================================== */

:root {
    --pub-blue: #008ac5;
    --pub-blue-dark: #00719f;
    --pub-blue-light: #7fb8e6;
    --pub-navy: #071e33;
    --pub-navy-2: #0d2c49;
    --pub-paper: #ffffff;
    --pub-paper-2: #eef4f9;
    --pub-ink: #10202e;
    --pub-line: #d7e3ec;
    --pub-shadow: 0.5rem 0.5rem 0 rgba(7, 30, 51, 0.12);
    --pub-shadow-blue: 0.5rem 0.5rem 0 rgba(0, 138, 197, 0.28);
}
[data-bs-theme="dark"] {
    --pub-paper: #081a2b;
    --pub-paper-2: #0d2338;
    --pub-ink: #dbe8f2;
    --pub-line: #1c3a55;
    --pub-shadow: 0.5rem 0.5rem 0 rgba(0, 0, 0, 0.45);
}

html { overflow-x: clip; }
body {
    background: var(--pub-paper);
    color: var(--pub-ink);
    overflow-x: clip; /* diagonale Deko-Rauten/Ticker ragen bewusst über den Rand */
}

/* ---- Raute als wiederverwendbares Motiv -------------------------------- */
.raute {
    display: inline-block;
    width: 0.55em;
    height: 0.8em;
    background: var(--pub-blue);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    flex: 0 0 auto;
}

/* ---- Navbar: flach, Akzentlinie oben, Versal-Links --------------------- */
.navbar-csu {
    background: var(--pub-paper);
    border-bottom: 1px solid var(--pub-line);
    border-top: 4px solid var(--pub-blue);
    border-radius: 0;
    margin: 0;
    box-shadow: none;
    transition: box-shadow 0.25s ease;
    backdrop-filter: none;
}
.navbar-csu.is-scrolled {
    box-shadow: 0 10px 30px rgba(7, 30, 51, 0.12);
}
.navbar-csu > .container { background: transparent; border: 0; box-shadow: none; padding: 0.35rem 0.75rem; }
.navbar-csu .nav-link {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--pub-ink);
    border-radius: 0;
    padding: 0.9rem 0.9rem;
    position: relative;
    background: none;
}
.navbar-csu .nav-link:hover { color: var(--pub-blue); background: none; }
.navbar-csu .nav-link.active { color: var(--pub-blue); background: none; }
.navbar-csu .nav-link.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0.2rem;
    transform: translateX(-50%);
    width: 0.45rem;
    height: 0.65rem;
    background: var(--pub-blue);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.navbar-csu .dropdown-menu {
    border: 1px solid var(--pub-line);
    border-top: 3px solid var(--pub-blue);
    border-radius: 0;
    box-shadow: 0.4rem 0.4rem 0 rgba(7, 30, 51, 0.1);
    background: var(--pub-paper);
}
.navbar-csu .dropdown-item { border-radius: 0; font-weight: 600; }
.navbar-csu .dropdown-item:hover { background: var(--pub-paper-2); color: var(--pub-blue); }

/* ---- Buttons: eckig, harter Offset-Schatten ---------------------------- */
.btn-csu,
a.btn-csu {
    background: var(--pub-blue);
    border: 2px solid var(--pub-blue);
    color: #fff;
    border-radius: 0;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    box-shadow: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.btn-csu:hover, .btn-csu:focus {
    background: var(--pub-blue-dark);
    border-color: var(--pub-blue-dark);
    color: #fff;
    transform: translate(-3px, -3px);
    box-shadow: var(--pub-shadow-blue);
}
.btn-outline-secondary, .btn-outline-light {
    border-radius: 0;
    border-width: 2px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.btn-outline-secondary:hover, .btn-outline-light:hover {
    transform: translate(-3px, -3px);
    box-shadow: var(--pub-shadow);
}

/* ---- Sektions-Überschriften: Versalien + Raute statt Farbbalken -------- */
.section-title {
    text-transform: uppercase;
    letter-spacing: -0.01em;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding-bottom: 0;
}
.section-title::before {
    content: "";
    width: 0.55em;
    height: 0.8em;
    background: var(--pub-blue);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    flex: 0 0 auto;
}
.section-title::after { display: none; }

/* ---- Hero: Navy-Farbblock mit Raute-Feld, Foto-Parallelogramm ---------- */
.hero {
    margin: 0;
    border-radius: 0;
    padding: 0;
    background: var(--pub-navy);
    color: #fff;
    overflow: hidden;
    position: relative;
    text-align: left;
    /* diagonale Unterkante */
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 3.5rem), 0 100%);
}
.hero::before, .hero::after { display: none; }
.hero .hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 2.5rem;
    align-items: center;
    padding: 5.5rem 0 7rem;
}
.hero .motto {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    padding: 0;
    color: var(--pub-blue-light);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.85rem;
}
.hero .motto::before {
    content: "";
    width: 0.6em;
    height: 0.85em;
    background: var(--pub-blue);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.hero h1 {
    font-size: clamp(2.6rem, 6.5vw, 4.6rem);
    font-weight: 900;
    text-transform: uppercase;
    line-height: 0.98;
    letter-spacing: -0.02em;
    margin: 0.9rem 0 1.2rem;
}
.hero h1 .hl {
    /* Marker-Balken hinter dem hervorgehobenen Wort */
    background: linear-gradient(0deg, var(--pub-blue) 0%, var(--pub-blue) 100%) no-repeat 0 78% / 100% 34%;
    padding: 0 0.08em;
}
.hero .lead { color: rgba(255, 255, 255, 0.82); margin-left: 0; }
/* Foto als Parallelogramm mit Raute-Rahmen */
.hero-visual { position: relative; min-height: 320px; }
.hero-visual .hero-photo {
    position: absolute;
    inset: 0;
    background: url('../img/naila-hero.jpg') center / cover no-repeat;
    clip-path: polygon(22% 0, 100% 0, 78% 100%, 0 100%);
    box-shadow: none;
}
.hero-visual::after {
    content: "";
    position: absolute;
    inset: -1rem -1rem auto auto;
    width: 38%;
    height: 46%;
    background: var(--pub-blue);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    opacity: 0.9;
    z-index: -1;
}
/* schwebende Deko-Rauten (Parallax via JS, sonst statisch) */
.hero-deco {
    position: absolute;
    background: rgba(127, 184, 230, 0.16);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    pointer-events: none;
    will-change: transform;
}
.hero-deco.d1 { width: 220px; height: 320px; right: -60px; top: -80px; background: rgba(0, 138, 197, 0.25); }
.hero-deco.d2 { width: 120px; height: 175px; left: -40px; bottom: 10%; }
.hero-deco.d3 { width: 70px; height: 100px; left: 42%; top: 12%; background: rgba(127, 184, 230, 0.1); }
@media (max-width: 991.98px) {
    .hero { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 2rem), 0 100%); }
    .hero .hero-grid { grid-template-columns: 1fr; padding: 3.5rem 0 5rem; }
    .hero-visual { display: none; }
}

/* ---- Laufband („Ticker") unter dem Hero -------------------------------- */
.csu-ticker-wrap {
    /* klemmt die gedrehte Leiste ein, damit nichts die Seite verbreitert */
    overflow: hidden;
    margin-top: -1.2rem;
    position: relative;
    z-index: 2;
}
.csu-ticker {
    background: var(--pub-blue);
    color: #fff;
    overflow: hidden;
    padding: 0.55rem 0;
    white-space: nowrap;
    transform: rotate(-0.6deg);
    width: 106%;
    margin-left: -3%;
}
.csu-ticker .ticker-track {
    display: inline-block;
    animation: pub-ticker 36s linear infinite;
}
.csu-ticker span {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    margin-right: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.82rem;
}
.csu-ticker .raute { background: #fff; opacity: 0.85; }
@keyframes pub-ticker {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
html.no-motion .csu-ticker .ticker-track { animation: none; }

/* ---- Leitlinien-Kacheln: flach, nummeriert, Offset-Schatten ------------ */
.feature-tile {
    background: var(--pub-paper);
    border: 2px solid var(--pub-ink);
    border-radius: 0;
    box-shadow: none;
    padding: 1.6rem 1.5rem 1.4rem;
    position: relative;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    height: 100%;
}
[data-bs-theme="dark"] .feature-tile { border-color: var(--pub-line); }
.feature-tile:hover {
    transform: translate(-4px, -4px);
    box-shadow: var(--pub-shadow-blue);
}
.feature-tile .icon-bubble {
    width: auto;
    height: auto;
    border-radius: 0;
    background: none !important;
    color: var(--pub-blue) !important;
    font-size: 1.5rem;
    box-shadow: none;
    margin-bottom: 0.6rem;
    display: inline-block;
}
.feature-tile h5 {
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 0.02em;
}
.feature-tile .tile-num {
    position: absolute;
    top: 0.9rem;
    right: 1.1rem;
    font-weight: 900;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    color: var(--pub-blue);
}
.feature-tile.tile-orange, .feature-tile.tile-green, .feature-tile.tile-petrol { background: var(--pub-paper); }
[data-bs-theme="dark"] .feature-tile.tile-orange,
[data-bs-theme="dark"] .feature-tile.tile-green,
[data-bs-theme="dark"] .feature-tile.tile-petrol { background: var(--pub-paper-2); }

/* ---- Karten (News, Termine, Alben, …): scharf + Bild-Zoom -------------- */
main .card {
    border: 1px solid var(--pub-line);
    border-radius: 0;
    box-shadow: none;
    background: var(--pub-paper);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    overflow: hidden;
}
main .card:hover {
    transform: translate(-3px, -3px);
    box-shadow: var(--pub-shadow);
    border-color: var(--pub-blue);
}
main .card .card-img-top, main .card .carousel-item img {
    border-radius: 0;
    transition: transform 0.5s ease;
}
main .card:hover .card-img-top { transform: scale(1.04); }
main .card .card-title { font-weight: 800; }
main .card .card-title a:hover { color: var(--pub-blue); }

/* Abwechselnde Sektions-Hintergründe (nur volle Breite, keine .container-Sektionen) */
main > section:nth-of-type(even):not(.hero):not(.container) { background: var(--pub-paper-2); }
main > section { scroll-margin-top: 5rem; }

/* ---- Footer: Navy-Block mit großer Wortmarke --------------------------- */
footer.site-footer {
    background: var(--pub-navy);
    color: rgba(255, 255, 255, 0.85);
    border-radius: 0;
    margin: 4rem 0 0 !important;
    padding: 2.8rem 0 2rem !important;
    position: relative;
    clip-path: polygon(0 1.6rem, 100% 0, 100% 100%, 0 100%);
}
footer.site-footer::before {
    content: "";
    display: block;
    position: absolute;
    top: 2.4rem;
    right: 6%;
    width: 90px;
    height: 130px;
    background: var(--pub-blue);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    opacity: 0.35;
}
footer.site-footer strong {
    display: block;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 0.04em;
    font-size: 1.15rem;
    color: #fff;
}
footer.site-footer .footer-claim {
    color: var(--pub-blue-light);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    font-weight: 800;
}
footer.site-footer a { color: rgba(255, 255, 255, 0.8); text-decoration: none; font-weight: 600; }
footer.site-footer a:hover { color: var(--pub-blue-light); }

/* ---- Scroll-Reveal (nur wenn JS .reveal setzt; .in = sichtbar) --------- */
.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--reveal-delay, 0s);
}
.reveal.in { opacity: 1; transform: none; }
html.no-motion .reveal { opacity: 1; transform: none; transition: none; }

/* Hero-Intro beim Laden (rein CSS, kein Layout-Shift) */
@media (prefers-reduced-motion: no-preference) {
    html:not(.no-motion) .hero .motto,
    html:not(.no-motion) .hero h1,
    html:not(.no-motion) .hero .lead,
    html:not(.no-motion) .hero .hero-cta { animation: pub-rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
    html:not(.no-motion) .hero h1 { animation-delay: 0.08s; }
    html:not(.no-motion) .hero .lead { animation-delay: 0.16s; }
    html:not(.no-motion) .hero .hero-cta { animation-delay: 0.24s; }
    html:not(.no-motion) .hero-visual { animation: pub-rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.15s backwards; }
}
@keyframes pub-rise {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: none; }
}

/* Chronik-Zeitleiste an die neue Optik angleichen */
.chronik-alt .chronik-card, .chronik-timeline .card {
    border-radius: 0;
    border: 1px solid var(--pub-line);
}

/* Barrierefreiheit/Sicherheit: keine Bewegung, wenn unerwünscht */
@media (prefers-reduced-motion: reduce) {
    .csu-ticker .ticker-track { animation: none; }
    .reveal { opacity: 1; transform: none; transition: none; }
    main .card, .feature-tile, .btn-csu, .btn-outline-secondary, .btn-outline-light { transition: none; }
}

/* ===========================================================================
   Dark Mode: gezielte Overrides gegen die (spezifischeren) Dark-Regeln
   aus custom.css — gleiche Optik wie Light, nur auf Navy-Flächen.
   ======================================================================== */
[data-bs-theme="dark"] .hero {
    background: var(--pub-navy);
}
[data-bs-theme="dark"] .hero::after { display: none; }
[data-bs-theme="dark"] .navbar-csu,
[data-bs-theme="dark"] .navbar-csu:has(> .container) {
    background: var(--pub-paper);
    border-bottom: 1px solid var(--pub-line);
    border-top: 4px solid var(--pub-blue);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0;
}
[data-bs-theme="dark"] .navbar-csu > .container {
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0.35rem 0.75rem;
}
[data-bs-theme="dark"] .navbar-csu .nav-link { color: var(--pub-ink); background: none; }
[data-bs-theme="dark"] .navbar-csu .nav-link.active,
[data-bs-theme="dark"] .navbar-csu .nav-link:hover {
    color: var(--pub-blue-light);
    background: none;
}
[data-bs-theme="dark"] main .card,
[data-bs-theme="dark"] .dropdown-menu {
    background: var(--pub-paper-2);
    border-color: var(--pub-line);
}
[data-bs-theme="dark"] .feature-tile,
[data-bs-theme="dark"] .feature-tile.tile-orange,
[data-bs-theme="dark"] .feature-tile.tile-green,
[data-bs-theme="dark"] .feature-tile.tile-petrol {
    background: var(--pub-paper-2);
    border-color: var(--pub-line);
}
[data-bs-theme="dark"] footer.site-footer { background: #04101d; }
