/* WHITEGOAT BASE
   Wiederverwendbare Grundstruktur: Design-Tokens, Reset, Body/Hintergrund, Logo,
   Header, Footer, Navigation, Burger-Menü. Seiteninhalte liegen in eigenen Dateien
   (z. B. whitegoat-main.css). */

/**************************************************************/
/* TOKENS */
/**************************************************************/
:root {
    /* Schrift */
    --font-family: "Bebas Neue", sans-serif;
    --font-family-body: Inter, "Helvetica Neue", Arial, sans-serif;

    /* Farben */
    --text-color: #eee;
    --text-color-dim: #8d8d93;
    --text-color-grey: #484844;
    --text-color-ghost: #1a1a18;
    --text-color-active: #ab1d18;
    --text-color-inactive: #5e100b;

    --dead-red: #632220;
      
    --surface-dark: rgb(0, 0, 0);
    --fluorescent-border: rgb(120, 137, 132);
    --fluorescent-start: rgb(221, 232, 209);
    --fluorescent-end: rgb(154, 171, 149);
    --button-text-active-rgb: var(--text-color-active);
    --button-text-active: var(--text-color-active);
    --button-text-inactive: var(--text-color-inactive);
    /* actionButton Styles */
    --button-background: rgb(52, 17, 25);
    --button-border: rgb(189, 207, 167);
    --button-border-2: rgb(46, 45, 41);
    
    /* Bewegung, Form, Blend */
    --transition-fast: 0.3s ease;
    --border-radius-sm: 2px;
    --blend-screen: screen;

    /* Navigation */
    --nav-link-spacing: 0.12em;
    --nav-header-link-size: 26px;
    --nav-footer-link-size: 20px;
    --nav-gap: clamp(10px, 1.2vw, 18px);

    /* Layout */
    --bar-height: clamp(58px, 6.6489vh, 75px);
    --footer-safe-area: env(safe-area-inset-bottom, 0px);
    --footer-reserved-height: calc(var(--bar-height) + var(--footer-safe-area));
    --stage-padding-inline: clamp(16px, 2.5vw, 40px);
    --footer-mudd-height: min(18vh, 280px);
    --footer-shroud-height: min(34vh, 480px);
    --footer-shroud-short-height: min(22vh, 280px);

    /* Bilder (Pfade relativ zu dieser CSS-Datei) */
    --homepage-background-current: url("../media/webkit/BG-Band1.png");
    --subpage-background-default: url("../media/webkit/BG-Main.png");
    --page-background-image: var(--homepage-background-current);
    --page-background-book1: url("../media/webkit/BG-Band1.png");
    --page-background-book2: url("../media/webkit/BG-Band2.png");
    --page-background-book3: url("../media/webkit/BG-Band3.png");
    --page-background-gallery: url("../media/webkit/BG-Fanart.png");
    --page-background-fanart-gallery: url("../media/gallery_bg.png");
    --page-background-blog: url("../media/webkit/platzhalter.png");
    --page-background-bio: url("../media/webkit/BG-ythril.png");
    --page-background-blog-index: url("../media/webkit/platzhalter.png");
    --page-background-blog-article: url("../media/webkit/platzhalter.png");
    --page-background-book1-overview: url("../media/webkit/BG-Band1.png");
    --page-background-leseprobe: url("../media/webkit/platzhalter.png");
    --page-background-fanart-info: url("../media/webkit/platzhalter.png");
    --page-background-newsletter: url("../media/webkit/platzhalter.png");
    --page-background-links: url("../media/webkit/platzhalter.png");
    --page-background-impressum: url("../media/webkit/platzhalter.png");
    --page-background-datenschutz: url("../media/webkit/platzhalter.png");
    --page-background-error: url("../media/webkit/platzhalter.png");
    --mudd-image: url("../media/webkit/mudd.png");
    --shroud-image: url("../media/webkit/shroud.png");

    /******************************************************/
    /* === ROTBURG FARBSCHEMA === */
    /******************************************************/
    /* === FARB-BASEN (für rgba) === */
    --color-glow-rgb: rgba(179, 0, 0, 1);
    --color-dark-rgb: rgba(12, 12, 13, 1);
    --color-card-rgb: rgba(28, 12, 12, 1);
    --color-glow-rgb: rgba(179, 0, 0, 1);
    --color-glow: rgb(221, 232, 209);
   
    /* === HEADER === */
    --header-height-mobile: 140px;
    --header-height-desktop: 150px;

    /* === SPACING === */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.8rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 1.6rem;
    --spacing-3xl: 2rem;
    /******************************************************/
    /* === TYPOGRAPHY – Rotburg Edition === */
    /******************************************************/


    /* Größen deiner Wahl */
    --font-size-sm: 0.9rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.15rem;
    --font-size-xl: 1.35rem;

    --letter-spacing-sm: 0.5px;
    --letter-spacing-md: 1px;
    --letter-spacing-lg: 2px;

    
    --opacity-low: 0.45;
    --opacity-medium: 0.8;
    --blend-soft-light: soft-light;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}
@media (prefers-reduced-motion: reduce) {
    .bg-layer,
    .leuchtstoffroehre,
    .datenschutz-page .noise,
    .impressum-page .noise,
    .datenschutz-page::before,
    .datenschutz-page::after,
    .impressum-page::before,
    .impressum-page::after,
    .datenschutz-page h1,
    .impressum-page h1 {
        animation: none;
        transition: none;
    }

    .card.current {
        animation: none;
    }

    .leuchtstoffroehre {
        opacity: 1;
        filter: brightness(1);
    }
}
/**************************************************************/
/* BODY, HINTERGRUND, DUST */
/**************************************************************/
@keyframes dustDrift {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 600px 1000px;
    }
}

html,
body {
    min-height: 100%;
    margin: 0;
    font-family: var(--font-family);
}

/* Standard: Homepage-Fallback. Unterseiten überschreiben --page-background-image per body-Klasse. */
body {
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background-color: #000;
    background-image: var(--page-background-image);
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
}

body.book-modal-open {
    overflow: hidden;
}

body.Homepage {
    --page-background-image: var(--homepage-background-current);
}

body.subpage {
    --page-background-image: var(--subpage-background-default);
}

body.subpage--flow {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

body.book1 {
    --page-background-image: var(--page-background-book1);
}

body.book2 {
    --page-background-image: var(--page-background-book2);
}

body.book3 {
    --page-background-image: var(--page-background-book3);
}

body.gallery-page {
    --page-background-image: var(--page-background-gallery);
}

body.fanart-gallery-page {
    --page-background-image: var(--page-background-fanart-gallery);
}

body.blog-page {
    --page-background-image: var(--page-background-blog);
}

body.blog-page.blog-index-page {
    --page-background-image: var(--page-background-blog-index);
}

body.blog-page.blog-article-page {
    --page-background-image: var(--page-background-blog-article);
}

body.bio-page {
    --page-background-image: var(--page-background-bio);
}

body.book1.book1-page {
    --page-background-image: var(--page-background-book1-overview);
}

body.book1.leseprobe-page {
    --page-background-image: var(--page-background-leseprobe);
}

body.fanart-info-page {
    --page-background-image: var(--page-background-fanart-info);
}

body.newsletter {
    --page-background-image: var(--page-background-newsletter);
}

body.links-page {
    --page-background-image: var(--page-background-links);
}

body.impressum {
    --page-background-image: var(--page-background-impressum);
}

body.datenschutz {
    --page-background-image: var(--page-background-datenschutz);
}

body.errorsite {
    --page-background-image: var(--page-background-error);
}

.viewport,
.stage {
    width: 100%;
    min-height: 100vh;
}

/* Seitenkarten ragen mobil über den Rand: abschneiden statt Dokument zu verbreitern,
   sonst verrutschen fixierte Elemente (Footer) optisch aus der Mitte */
.viewport {
    overflow-x: clip;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: url("../media/webkit//noise.png");
    background-size: 600px 600px;
    mix-blend-mode: var(--blend-screen);
    opacity: .08;
    animation: dustDrift 60s linear infinite;
    z-index: 2;
}

/* Weich überblendender Hintergrund (---> js/Homepage-BG-Rotation.js) */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    opacity: 0;
    transition: opacity 3s ease-in-out;
}

.bg-layer.is-visible {
    opacity: 1;
}

body.has-bg-layers {
    background-image: none;
}

/**************************************************************/
/* LOGO */
/**************************************************************/
.logo {
    display: block;
    width: 52px;
    height: 55px;
    margin-right: 18px;
    object-fit: contain;
    flex: 0 0 auto;
    filter: drop-shadow(0 0 6px rgba(169, 30, 24, 0.7)) drop-shadow(0 0 16px rgba(169, 30, 24, 0.45));
}

/**************************************************************/
/* HEADER & FOOTER */
/**************************************************************/
header,
footer {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--bar-height);
    min-height: var(--bar-height);
    padding: 0 var(--stage-padding-inline);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--surface-dark);
    z-index: 20;
}

header {
    top: 0;
    z-index: 90; /* über main (80), damit Cover/Kicker den Header nicht überdecken */
    gap: 12px 28px;
    flex-wrap: wrap;
}

footer {
    bottom: 0;
    flex-direction: column;
    justify-content: flex-end; /* Inhalt unten im schwarzen Feld */
    height: var(--footer-reserved-height);
    min-height: var(--footer-reserved-height);
    padding-bottom: calc(2px + var(--footer-safe-area));
    gap: 4px;
    text-align: center;
    z-index: 77;
}

footer .copyright {
    margin: 0; /* sonst addiert der Standard-p-Abstand (1em) Höhe und der Inhalt ragt aus dem Feld */
    color: var(--text-color-dim);
    letter-spacing: 0.08em;
    font-size: 11px;
    font-family: var(--font-family);
    line-height: 1.1;
}

/* Deko-Ebene über dem Footer (z-index 12, unter main) */
.footer-mudd-layer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--footer-reserved-height);
    height: var(--footer-mudd-height);
    z-index: 12;
    pointer-events: none;
    background-image: var(--mudd-image);
    background-position: center bottom;
    background-repeat: repeat-x;
    background-size: auto 100%;
    opacity: 0.92;
}
.footer-shroud-layer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--footer-reserved-height);
    height: var(--footer-shroud-height);
    z-index: 12;
    pointer-events: none;
    background-image:
        linear-gradient(to top,
            rgba(0, 0, 0, 0.98) 0%,
            rgba(0, 0, 0, 0.94) 22%,
            rgba(0, 0, 0, 0.72) 54%,
            rgba(0, 0, 0, 0) 100%),
        var(--shroud-image);
    background-position: center bottom, center bottom;
    background-repeat: no-repeat, repeat-x;
    background-size: 100% 100%, auto 100%;
    opacity: 0.7;
}
.footer-shroud-layer-short {
    height: var(--footer-shroud-short-height);
}
/* Links in Fließtexten (einheitlich: Blog-Artikel, Info-Seiten, Impressum, Datenschutz) */
.link a,
.text-link,
.artikel-einzeln-wrapper p a,
.artikel-einzeln-wrapper li a,
.article-card p a,
.article-card li a,
.datenschutz-page a,
.impressum-page a {
    color: var(--wg-glow);
    font-weight: 700;
    text-underline-offset: 0.18em;
}

.link a:hover,
.link a:focus-visible,
.text-link:hover,
.text-link:focus-visible,
.artikel-einzeln-wrapper p a:hover,
.artikel-einzeln-wrapper p a:focus-visible,
.artikel-einzeln-wrapper li a:hover,
.artikel-einzeln-wrapper li a:focus-visible,
.article-card p a:hover,
.article-card p a:focus-visible,
.article-card li a:hover,
.article-card li a:focus-visible,
.datenschutz-page a:hover,
.datenschutz-page a:focus-visible,
.impressum-page a:hover,
.impressum-page a:focus-visible {
    text-shadow: 0 0 12px rgba(238, 238, 238, 0.28);
}
/**************************************************************/
/* AMBIENT LEUCHTEN */
/**************************************************************/
.buehne {
    position: absolute;
    inset: 0;
    overflow: hidden; /* Schere, nicht Aus-Schalter */
    pointer-events: none;
    z-index: 0;
}

.buehne-book {
    position: absolute;
    inset: 0;
    overflow: hidden; /* Schere, nicht Aus-Schalter */
    pointer-events: none;
    z-index: 0;
}
.ambientLeuchten {
    position: absolute;
    left: 50%;
    top: 42%;
    width: min(1500px, 100%);
    height: clamp(280px, 46vw, 640px);
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none;
    /* reiner Glow: vom Mittelpunkt aus, am Rand (closest-side) vollständig transparent */
    background-image: radial-gradient(ellipse closest-side at 50% 50%,
            rgba(222, 236, 221, 0.90) 0%,
            rgba(189, 207, 167, 0.70) 25%,
            rgba(171, 187, 177, 0.48) 50%,
            rgba(120, 137, 132, 0.22) 75%,
            transparent 100%);
    filter: blur(18px);
    animation: ambient-puls 9.6s ease-in-out infinite;
}

@keyframes ambient-puls {
    0%,
    100% {
        opacity: 0.45;
        transform: translate(-50%, -50%) scale(0.88);
        filter: blur(18px) brightness(0.75);
    }

    18% { /* altes Flackern */
        opacity: 0.28;
        transform: translate(-50%, -50%) scale(0.84);
        filter: blur(18px) brightness(0.55);
        animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
    }

    46%,
    87.667% { /* Peak, hält ca. 4s */
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.08);
        filter: blur(18px) brightness(1.2);
        animation-timing-function: cubic-bezier(0.4, 0, 1, 1);
    }
}

@keyframes current-shadow-puls {
    0%,
    100% {
        box-shadow:
            0 0 0 2px rgba(211, 19, 27, 0.35),
            0 30px 60px rgba(0, 0, 0, 0.6),
            0 0 50px 12px rgba(0, 0, 0, 0.55),
            0 0 20px 4px rgba(0, 0, 0, 0.4);
    }

    18% {
        box-shadow:
            0 0 0 2px rgba(211, 19, 27, 0.35),
            0 30px 60px rgba(0, 0, 0, 0.6),
            0 0 36px 6px rgba(0, 0, 0, 0.35),
            0 0 14px 2px rgba(0, 0, 0, 0.25);
        animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
    }

    46%,
    87.667% {
        box-shadow:
            0 0 0 2px rgba(211, 19, 27, 0.35),
            0 30px 60px rgba(0, 0, 0, 0.6),
            0 0 100px 40px rgba(0, 0, 0, 0.85),
            0 0 36px 12px rgba(0, 0, 0, 0.7);
        animation-timing-function: cubic-bezier(0.4, 0, 1, 1);
    }
}

@keyframes current-flicker {
    0%,
    5%,
    8%,
    32%,
    36%,
    57%,
    60%,
    80%,
    83%,
    100% {
        opacity: 1;
        filter: brightness(1);
    }

    6% {
        opacity: 0.9;
        filter: brightness(0.9);
    }

    7% {
        opacity: 1;
        filter: brightness(1.06);
    }

    33% {
        opacity: 0.88;
        filter: brightness(0.88);
    }

    34% {
        opacity: 0.96;
        filter: brightness(1.08);
    }

    58% {
        opacity: 0.93;
        filter: brightness(0.93);
    }

    81% {
        opacity: 0.9;
        filter: brightness(0.9);
    }

    82% {
        opacity: 1;
        filter: brightness(1.05);
    }
}
