/* ===== Lokale Fonts (kein Google-API-Aufruf) ===== */
@font-face {
    font-family: 'WindSong';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/WindSong-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Crimson Text';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/CrimsonText-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Crimson Text';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/CrimsonText-Italic.ttf') format('truetype');
}

@font-face {
    font-family: 'Crimson Text';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/CrimsonText-SemiBold.ttf') format('truetype');
}

@font-face {
    font-family: 'Crimson Text';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/CrimsonText-Bold.ttf') format('truetype');
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Farben aus 00 Kontext/Branding.md, festgelegt 2026-09-02 (ersetzt alte Findungsphase-Palette) */
    --parchment: #FFFFFF;        /* war #FBF4E6, jetzt reines Weiß laut Branding */
    --parchment-deep: #F6F4FA;   /* war #F0E6D2, jetzt sehr helles Violett-Weiß */
    --prussian-blue: #1B1F3D;    /* war #003153, jetzt Nachtblau */
    --mystic-teal: #35D9A6;      /* war #1A5F59, jetzt Limettengrün/Teal */
    --faded-ink: #4A4570;        /* war #595040, jetzt gedämpftes Indigo */
    --accent-gold: #FF6B1F;      /* war #B8860B (Gold), jetzt Orange */
    --header-h: 60px;
    --footer-h: 92px;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--parchment);
    /* 2026-09-02: background-parchment.png (gealtertes Papier) entfernt, passte nicht mehr
       zur Branding-Vorgabe "rein weißer Hintergrund, aufgelockert durch sehr weiche,
       fast unsichtbare Aquarell-Waschungen an den Rändern". Ersetzt durch reine CSS-Gradients
       unten (body::before), keine neue Bilddatei nötig. */
    background-attachment: fixed;

    color: var(--prussian-blue);
    font-family: 'Crimson Text', Georgia, serif;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ===== Aquarell-Waschungen an den Rändern (ersetzt background-parchment.png, 2026-09-02) ===== */
/* Sehr weiche, fast unsichtbare Farbflächen aus der Branding-Palette, oben/unten in die
   weißen Ränder auslaufend – kein Bild, nur Gradients, damit es bei jeder Auflösung sauber bleibt. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background:
        radial-gradient(ellipse 60% 40% at 8% 0%, rgba(75, 42, 133, 0.05), transparent 70%),
        radial-gradient(ellipse 60% 40% at 92% 100%, rgba(255, 107, 31, 0.05), transparent 70%),
        radial-gradient(ellipse 50% 35% at 100% 0%, rgba(53, 217, 166, 0.04), transparent 70%);
}

/* Leichte Randabdunklung in Nachtblau statt der alten sepiafarbenen Vignette */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    background: radial-gradient(ellipse at center, transparent 55%, rgba(27, 31, 61, 0.12) 100%);
}

/* ===== Stage: alles in einer Viewport-Höhe ===== */
.stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1.2rem;
    position: relative;
    padding: calc(var(--header-h) + 0.8rem) 1.5rem calc(var(--footer-h) + 1rem);
}

@media (max-width: 860px), (max-height: 700px) {
    .stage {
        padding: calc(var(--header-h) + 0.6rem) 1.2rem calc(var(--footer-h) + 0.8rem);
        gap: 1rem;
    }
}

@media (max-width: 600px) {
    :root {
        --footer-h: 108px;
    }
}

/* Atmender Glow hinter dem Inhalt – Teal auf Pergament, sehr zart */
.stage::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 550px;
    height: 550px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(53, 217, 166, 0.06) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    animation: breathe 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes breathe {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.15); }
}

/* ===== Fixierter Header (Social & Kontakt) ===== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 500;
    display: flex;
    justify-content: center;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(74, 69, 112, 0.2);
}

/* ===== Social & Kontakt Icons ===== */
.social-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.1rem;
}

.social-row a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: var(--faded-ink);
    opacity: 0.75;
    border-radius: 50%;
    transition: color 0.3s ease, opacity 0.3s ease, background 0.3s ease;
}

.social-row a:hover,
.social-row a:focus-visible {
    color: var(--accent-gold);
    opacity: 1;
    background: rgba(255, 107, 31, 0.1);
    outline: none;
}

/* ===== Logo ===== */
.logo-wrapper {
    position: relative;
    display: inline-block;
}

.logo {
    max-width: 250px;
    width: 28vw;
    display: block;
    opacity: 1; /* war 0.7, wirkte zu transparent/verwaschen – 2026-09-04 auf voll deckend gestellt */
    filter: contrast(90%); /* Sepia entfernt 2026-09-02, passte nicht mehr zur neuen Palette */
    animation: logo-breathe 8s ease-in-out infinite;
}

@keyframes logo-breathe {
    0%, 100% { filter: contrast(90%) drop-shadow(0 0 3px rgba(255, 107, 31, 0.15)); }
    50%      { filter: drop-shadow(0 0 12px rgba(255, 107, 31, 0.35)); }
}

.logo-wrapper:hover .logo {
    animation-play-state: paused;
    filter: drop-shadow(0 0 10px rgba(255, 107, 31, 0.35))
            drop-shadow(0 0 22px rgba(255, 107, 31, 0.15));
}

/* ===== Titel ===== */
.hero-title {
    font-family: 'WindSong', cursive;
    font-size: clamp(2.2rem, 6vw, 4rem);
    color: var(--prussian-blue);
    letter-spacing: 0.05em;
    text-align: center;
    opacity: 0.9;
}

/* ===== Fragen-Slider ===== */
.slider-container {
    position: relative;
    height: 110px;
    width: 100%;
    max-width: 650px;
}

.slide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 2s ease-in-out;
    text-align: center;
    font-size: clamp(1.2rem, 3.2vw, 1.9rem);
    font-style: italic;
    color: var(--prussian-blue);
    line-height: 1.4;
    width: 100%;
    padding: 0 0.5rem;
}

.slide.active {
    opacity: 1;
}

/* ===== Kodex-Überblick: 5 Säulen ===== */
/* 2026-09-04: von <table> auf Flex-Container aus Header+Inhalt-Paaren umgestellt.
   Grund: Die alte <table>-Struktur hatte Header und Inhalte in zwei getrennten <tr>
   (eine Kopfzeile mit 5 <th>, eine Datenzeile mit 5 <td>). Beim mobilen Stapeln
   (display: block auf allen Tabellen-Elementen) folgte die Reihenfolge dem DOM,
   also erst alle 5 Header hintereinander, danach alle 5 Inhalte – statt Header/Inhalt
   in Paaren. Jetzt ist jede Säule ein eigenes .kodex-item mit Header+Inhalt direkt
   darin, das Stapeln passiert automatisch richtig. */
.kodex-table {
    width: 100%;
    max-width: 1200px;
    margin-top: 1rem;
    display: flex;
    border: 1px solid #DAD5EC;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); /* liegt 'auf' dem Papier */
    background: rgba(255, 255, 255, 0.4);
}

.kodex-item {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.9rem 1rem;
    border-right: 1px solid rgba(74, 69, 112, 0.3);
    display: flex;
    flex-direction: column;
}

.kodex-item:last-child {
    border-right: none;
}

.kodex-item-header {
    font-family: 'Crimson Text', Georgia, serif;
    font-weight: 400;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    text-align: center;
    color: var(--accent-gold);
    padding-bottom: 0.4rem;
    margin-bottom: 0.4rem;
    border-bottom: 1px solid rgba(74, 69, 112, 0.3);
}

.kodex-item-content {
    font-size: 0.95rem;
    font-style: italic;
    text-align: left;
    color: var(--faded-ink);
    line-height: 1.4;
    background: linear-gradient(to bottom, rgba(53, 217, 166, 0.10), rgba(255, 107, 31, 0.06) 60%, transparent);
    /* 2026-09-07: flex: 1 1 auto füllt die Box bis zur Höhe der längsten Nachbarspalte
       (.kodex-item ist jetzt display:flex/column), damit der Farbverlauf bei kurzen
       Texten (z. B. "Die Welt") nicht viel früher in Transparenz abbricht als bei
       längeren Spalten und dadurch blass wirkt. */
    flex: 1 1 auto;
}

.kodex-item:nth-child(2n) .kodex-item-content {
    background: linear-gradient(to bottom, rgba(255, 107, 31, 0.10), rgba(53, 217, 166, 0.06) 60%, transparent);
}

/* ===== FAQ ===== */
.faq {
    width: 100%;
    max-width: 1000px;
    margin-top: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.faq details {
    border: 1px solid #DAD5EC;
    background: rgba(255, 255, 255, 0.4);
    padding: 0.7rem 1rem;
}

.faq summary {
    cursor: pointer;
    font-family: 'Crimson Text', Georgia, serif;
    font-weight: 600;
    color: var(--prussian-blue);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--accent-gold);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.faq details[open] summary::after {
    transform: rotate(45deg);
}

.faq summary:hover {
    color: var(--accent-gold);
}

.faq details p {
    margin-top: 0.6rem;
    font-size: 0.92rem;
    font-style: italic;
    color: var(--faded-ink);
    line-height: 1.5;
}

/* ===== CTA ===== */
.cta-link {
    margin-top: 1.2rem;
    font-size: 1.05rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--prussian-blue);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.6s ease, text-shadow 0.6s ease, color 0.6s ease;
}

.cta-link:hover {
    border-bottom-color: var(--accent-gold);
    color: var(--accent-gold);
    text-shadow: 0 0 10px rgba(255, 107, 31, 0.35);
}

/* ===== Fixierter Footer ===== */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 500;
    padding: 0.7rem 1.5rem;
    text-align: center;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    color: var(--faded-ink);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-top: 1px solid rgba(74, 69, 112, 0.25);
}

.site-footer p {
    opacity: 0.7;
}

/* ===== Begriffs-Tooltips ===== */
.tooltip-term {
    position: relative;
    display: inline-block;
    cursor: help;
    border-bottom: 1px dotted var(--accent-gold);
    font-style: normal;
}

.tooltip-bubble {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    width: max-content;
    max-width: min(220px, 60vw);
    background: var(--prussian-blue);
    color: var(--parchment);
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 0.8rem;
    font-style: normal;
    line-height: 1.4;
    text-align: left;
    padding: 0.55rem 0.75rem;
    border-radius: 4px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 20;
}

.tooltip-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--prussian-blue);
}

.tooltip-term:hover .tooltip-bubble,
.tooltip-term:focus .tooltip-bubble,
.tooltip-term.is-open .tooltip-bubble {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

@media (hover: none) {
    .tooltip-term {
        border-bottom-style: solid;
    }
}

/* ===== Footer Legal-Button ===== */
.legal-link {
    display: inline-block;
    margin-top: 0.5rem;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--faded-ink);
    cursor: pointer;
    border-bottom: 1px solid transparent;
    transition: border-color 0.4s ease, color 0.4s ease;
}

.legal-link:hover {
    color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
}

/* ===== Fundstücke-Regal ===== */
.shelf {
    width: 100%;
    max-width: 1000px;
    margin-top: 1.6rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(74, 69, 112, 0.2);
}

.shelf-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 0.8rem;
    margin-bottom: 0.7rem;
    padding: 0 0.2rem;
}

.shelf-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent-gold);
}

.shelf-intro {
    font-size: 0.9rem;
    font-style: italic;
    color: var(--faded-ink);
}

.shelf-items {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.3rem 0.2rem 0.6rem;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: rgba(74, 69, 112, 0.35) transparent;
}

.shelf-items::-webkit-scrollbar {
    height: 6px;
}

.shelf-items::-webkit-scrollbar-thumb {
    background: rgba(74, 69, 112, 0.3);
    border-radius: 3px;
}

.shelf-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
    width: 118px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 6px;
    transition: background 0.3s ease, transform 0.3s ease;
}

.shelf-item:hover,
.shelf-item:focus-visible {
    background: rgba(255, 107, 31, 0.08);
    transform: translateY(-2px);
    outline: none;
}

.shelf-item-cover {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: var(--parchment-deep);
    border: 1px solid rgba(74, 69, 112, 0.25);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.shelf-item-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.shelf-item-tag {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent-gold);
}

.shelf-item-title {
    font-size: 0.82rem;
    font-style: italic;
    color: var(--faded-ink);
    text-align: center;
    line-height: 1.3;
}

.panel-tag {
    display: block;
    text-align: center;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--accent-gold);
    margin-top: 0.8rem;
}

.panel-tag + h2 {
    margin-top: 0.2rem;
}

/* ===== Slide-in Panels ===== */
.panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(27, 31, 61, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 10000;
}

.panel-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

body.panel-lock {
    overflow: hidden;
}

.panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: min(420px, 100%);
    background: var(--parchment);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.25);
    transform: translateX(100%);
    transition: transform 0.5s ease;
    z-index: 10001;
    overflow-y: auto;
    padding: 3rem 2rem 2.5rem;
}

.panel.is-open {
    transform: translateX(0);
}

.panel-close {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--faded-ink);
    cursor: pointer;
    transition: color 0.3s ease;
}

.panel-close:hover {
    color: var(--accent-gold);
}

.panel-content h2 {
    font-family: 'Crimson Text', Georgia, serif;
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--prussian-blue);
    margin-top: 1.5rem;
    margin-bottom: 0.6rem;
}

.panel-content h2:first-child {
    margin-top: 0;
}

.panel-content p {
    font-size: 0.95rem;
    color: var(--faded-ink);
    line-height: 1.6;
    margin-bottom: 0.9rem;
}

.panel-note {
    font-size: 0.78rem;
    font-style: italic;
    opacity: 0.75;
}

.panel-book .panel-cover {
    display: block;
    width: 100%;
    max-width: 220px;
    margin: 0 auto 1.2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.panel-book h2 {
    text-align: center;
}

.panel-meta {
    text-align: center;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-gold);
    margin-bottom: 1.2rem;
}

@media (max-width: 860px) {
    .panel {
        width: 100%;
        padding: 2.5rem 1.3rem 2rem;
    }
}

/* ===== Responsive ===== */

/* Tablet (Hochformat) & Handy: Säulen werden gestapelt statt nebeneinander.
   Ein Regelsatz für beide Breakpoints, da .kodex-item Header+Inhalt schon zusammen
   enthält – kein Duplikat mit unterschiedlichen Selektoren mehr nötig. */
@media (max-width: 860px) {
    .kodex-table {
        flex-direction: column;
    }

    .kodex-item {
        border-right: none;
        border-bottom: 1px solid rgba(74, 69, 112, 0.25);
    }

    .kodex-item:last-child {
        border-bottom: none;
    }
}

@media (max-width: 600px) {
    .slider-container {
        height: 150px;
    }

    .social-row a {
        width: 40px;
        height: 40px;
    }

    .logo {
        width: 42vw;
    }
}

@media (min-width: 601px) and (max-width: 860px) {
    .social-row a {
        width: 38px;
        height: 38px;
    }

    .logo {
        width: 32vw;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stage::before,
    .logo {
        animation: none;
    }
    .slide {
        transition: opacity 0.5s ease;
    }
}