/* =========================================================
   LIORA & MILA – GESCHICHTEN
   ========================================================= */


/* =========================================================
   GLOBALE FARBEN
   ========================================================= */

:root {
    --story-bg: #f8f5ee;
    --story-text: #294638;
    --story-text-soft: #6f776c;
    --story-green: #385640;
    --story-sage: #6f7c67;
    --story-gold: #9a6d13;
    --story-line: #d9ddd2;
    --story-white: #ffffff;
    --story-cream: #faf8f2;
}


/* =========================================================
   GESCHICHTEN-BEREICH
   ========================================================= */

.stories-section {
    color: var(--story-text);
    padding: 90px 0;
}


/* =========================================================
   BREITE
   ========================================================= */

.stories-section .section-shell {
    width: min(1200px, calc(100% - 80px));
    margin-inline: auto;
}


/* =========================================================
   ÜBERSCHRIFT
   ========================================================= */

.stories-section .section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 40px;
    margin-bottom: 42px;
}

.stories-section .section-heading__title {
    flex: 1;
}

.stories-section .eyebrow {
    margin: 0 0 14px;

    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;

    letter-spacing: 2px;
    text-transform: uppercase;

    color: var(--story-gold);
}

.stories-section .section-heading h2 {
    margin: 0;

    font-size: clamp(36px, 4vw, 54px);
    line-height: 1.08;
    font-weight: 400;

    letter-spacing: -1.5px;

    color: var(--story-text);
}

.stories-section .section-heading h2 em {
    color: var(--story-sage);
    font-weight: 400;
}

.stories-section .section-heading__intro {
    width: min(360px, 100%);

    margin: 0 0 4px;

    font-size: 14px;
    line-height: 1.8;

    color: var(--story-text-soft);
}


/* =========================================================
   GRID
   ========================================================= */

.story-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}


/* =========================================================
   STORY-CARD
   ========================================================= */

.story-card {
    appearance: none;
    -webkit-appearance: none;

    display: block;

    width: 100%;

    padding: 0;

    border: 0;

    background: transparent;

    text-align: left;

    color: inherit;

    font: inherit;

    cursor: pointer;
}

.story-card:focus-visible {
    outline: 2px solid var(--story-gold);
    outline-offset: 6px;

    border-radius: 8px;
}


/* =========================================================
   BILD
   ========================================================= */

.story-image {
    position: relative;

    overflow: hidden;

    min-height: 340px;

    border-radius: 10px;

    background: #e7e7df;
}

.story-image img {
    display: block;

    width: 100%;
    height: 100%;

    min-height: 340px;

    object-fit: cover;
    object-position: center;

    transition: transform 0.5s ease;
}

.story-image::after {
    content: "";

    position: absolute;

    inset: 58% 0 0;

    background:
        linear-gradient(
            transparent,
            rgba(20, 32, 24, 0.36)
        );

    pointer-events: none;
}

.story-card:hover .story-image img {
    transform: scale(1.035);
}


/* Mittlere Karte mit Rundbogen */
.story-card:nth-child(2) .story-image {
    border-radius: 46% 46% 10px 10px;
}


/* =========================================================
   BADGE
   ========================================================= */

.story-pill {
    position: absolute;

    top: 16px;
    left: 16px;

    z-index: 2;

    padding: 9px 12px;

    border-radius: 999px;

    background: rgba(255, 255, 255, 0.92);

    color: var(--story-green);

    font-size: 9px;
    font-weight: 600;
    line-height: 1;

    letter-spacing: 1px;
    text-transform: uppercase;
}

.story-card:nth-child(2) .story-pill {
    top: auto;
    bottom: 16px;
}


/* =========================================================
   PFEIL
   ========================================================= */

.story-go {
    position: absolute;

    right: 16px;
    bottom: 16px;

    z-index: 2;

    display: grid;
    place-items: center;

    width: 38px;
    height: 38px;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.92);

    color: var(--story-green);

    font-size: 20px;
    line-height: 1;

    transition:
        transform 0.25s ease,
        background-color 0.25s ease;
}

.story-card:hover .story-go {
    transform: rotate(-35deg);

    background: #ffffff;
}


/* =========================================================
   META
   ========================================================= */

.story-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 10px;

    margin: 18px 0 11px;

    font-size: 8px;
    font-weight: 600;

    letter-spacing: 1.2px;
    text-transform: uppercase;

    color: #818878;
}

.story-book {
    font-size: 14px;
    color: var(--story-gold);
}


/* =========================================================
   TITEL / TEXT
   ========================================================= */

.story-card h3 {
    margin: 0 0 9px;

    font-size: 25px;
    line-height: 1.2;
    font-weight: 400;

    letter-spacing: -0.5px;

    color: var(--story-text);
}

.story-card > p {
    max-width: 300px;

    margin: 0;

    font-size: 13px;
    line-height: 1.7;

    color: var(--story-text-soft);
}


/* =========================================================
   HINWEIS
   ========================================================= */

.stories-note {
    display: flex;
    justify-content: center;
    align-items: center;

    gap: 8px;

    margin: 36px 0 0;

    font-size: 11px;

    color: #848b7b;
}


/* =========================================================
   POPUP / DIALOG
   ========================================================= */

dialog#reader-dialog.reader-dialog {
    width: min(980px, calc(100% - 40px));
    max-width: 980px;
    max-height: calc(100vh - 40px);

    padding: 0 !important;
    margin: auto;

    border: 0 !important;
    border-radius: 16px;

    overflow: hidden;

    background: var(--story-cream) !important;
    background-color: var(--story-cream) !important;
    background-image: none !important;

    color: var(--story-text) !important;

    opacity: 1 !important;

    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.28);
}


/* Nur wenn geöffnet */
dialog#reader-dialog.reader-dialog[open] {
    background: var(--story-cream) !important;
    background-color: var(--story-cream) !important;
    background-image: none !important;

    opacity: 1 !important;
}


/* =========================================================
   HINTERGRUND HINTER DEM POPUP
   ========================================================= */

dialog#reader-dialog::backdrop {
    background: rgba(20, 30, 24, 0.72) !important;
    background-color: rgba(20, 30, 24, 0.72) !important;

    opacity: 1 !important;

    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}


/* =========================================================
   POPUP-INHALT
   ========================================================= */

#reader-dialog .reader-dialog__inner {
    position: relative;

    min-height: 100%;

    background: var(--story-cream) !important;
    background-color: var(--story-cream) !important;
    background-image: none !important;

    opacity: 1 !important;
}

#reader-dialog .reader-layout {
    display: grid;

    grid-template-columns:
        minmax(300px, 42%) 1fr;

    min-height: 540px;

    background: var(--story-cream) !important;
    background-color: var(--story-cream) !important;
    background-image: none !important;

    opacity: 1 !important;
}


/* =========================================================
   POPUP-BILD
   ========================================================= */

#reader-dialog .reader-art {
    position: relative;

    min-height: 540px;

    overflow: hidden;

    background: #dfe5dc !important;
    background-color: #dfe5dc !important;
}

#reader-dialog .reader-art img {
    display: block;

    width: 100%;
    height: 100%;

    min-height: 540px;

    object-fit: cover;
}

#reader-dialog .reader-art::after {
    content: "";

    position: absolute;

    inset: 55% 0 0;

    background:
        linear-gradient(
            transparent,
            rgba(20, 30, 23, 0.46)
        );

    pointer-events: none;
}

#reader-dialog .reader-art-label {
    position: absolute;

    left: 24px;
    bottom: 20px;

    z-index: 2;

    color: #ffffff;

    font-size: 10px;
    font-weight: 600;

    letter-spacing: 1.5px;
    text-transform: uppercase;
}


/* =========================================================
   POPUP-TEXTBEREICH
   ========================================================= */

#reader-dialog .reader-content {
    display: flex;
    flex-direction: column;

    padding: 56px 54px 42px;

    background: var(--story-cream) !important;
    background-color: var(--story-cream) !important;
    background-image: none !important;

    opacity: 1 !important;
}

#reader-dialog .reader-content .eyebrow {
    margin: 0 0 14px;

    font-size: 10px;
    font-weight: 600;

    letter-spacing: 1.7px;
    text-transform: uppercase;

    color: var(--story-gold);
}

#reader-dialog .reader-content h2 {
    margin: 0 0 30px;

    font-size: clamp(32px, 4vw, 46px);
    line-height: 1.1;
    font-weight: 400;

    letter-spacing: -1px;

    color: var(--story-text);
}

#reader-dialog .reader-page {
    flex: 1;

    font-size: 17px;
    line-height: 1.8;

    color: #455249;
}

#reader-dialog .reader-page p {
    margin: 0 0 18px;
}

#reader-dialog .reader-page p:last-child {
    margin-bottom: 0;
}


/* =========================================================
   POPUP-NAVIGATION
   ========================================================= */

#reader-dialog .reader-navigation {
    display: grid;

    grid-template-columns:
        auto 1fr auto;

    align-items: center;

    gap: 16px;

    margin-top: 40px;
    padding-top: 22px;

    border-top: 1px solid var(--story-line);

    background: transparent;
}

#reader-dialog .reader-navigation button {
    appearance: none;
    -webkit-appearance: none;

    min-height: 44px;

    padding: 0 18px;

    border: 1px solid #d7d9cf;
    border-radius: 999px;

    background: #ffffff !important;
    background-color: #ffffff !important;

    color: var(--story-text);

    font: inherit;
    font-size: 12px;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        color 0.2s ease;
}

#reader-dialog .reader-navigation button:hover:not(:disabled) {
    border-color: var(--story-gold);

    background: #fbf7ef !important;
    background-color: #fbf7ef !important;

    color: var(--story-gold);
}

#reader-dialog .reader-navigation button:disabled {
    opacity: 0.35;

    cursor: default;
}

#reader-dialog .reader-prev {
    width: 44px;

    padding: 0 !important;

    font-size: 18px !important;
}

#reader-dialog .reader-next {
    white-space: nowrap;
}

#reader-dialog .reader-progress {
    text-align: center;

    font-size: 11px;

    letter-spacing: 1px;

    color: #808779;
}


/* =========================================================
   SCHLIESSEN
   ========================================================= */

#reader-dialog .dialog-close {
    position: absolute;

    top: 16px;
    right: 16px;

    z-index: 5;

    display: grid;
    place-items: center;

    width: 38px;
    height: 38px;

    padding: 0;

    border: 0 !important;
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.96) !important;
    background-color: rgba(255, 255, 255, 0.96) !important;

    color: var(--story-text);

    font-size: 25px;
    line-height: 1;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        background-color 0.2s ease;
}

#reader-dialog .dialog-close:hover {
    transform: rotate(5deg);

    background: #ffffff !important;
    background-color: #ffffff !important;
}


/* =========================================================
   BODY BEI GEÖFFNETEM POPUP
   ========================================================= */

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


/* =========================================================
   ASTRA / THEME OVERRIDE
   ========================================================= */

body dialog#reader-dialog,
body dialog#reader-dialog[open],
.ast-container dialog#reader-dialog,
.site-content dialog#reader-dialog,
.entry-content dialog#reader-dialog {
    background: #faf8f2 !important;
    background-color: #faf8f2 !important;
    background-image: none !important;

    opacity: 1 !important;
}

body #reader-dialog .reader-dialog__inner,
body #reader-dialog .reader-layout,
body #reader-dialog .reader-content {
    background: #faf8f2 !important;
    background-color: #faf8f2 !important;
    background-image: none !important;

    opacity: 1 !important;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    .stories-section .section-shell {
        width: min(100% - 48px, 1200px);
    }

    .story-grid {
        gap: 20px;
    }

    .story-image,
    .story-image img {
        min-height: 280px;
    }

    .story-card h3 {
        font-size: 21px;
    }

    #reader-dialog .reader-layout {
        grid-template-columns: 38% 1fr;
    }

    #reader-dialog .reader-content {
        padding: 46px 38px 34px;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    .stories-section {
        padding: 58px 0;
    }

    .stories-section .section-shell {
        width: calc(100% - 34px);
    }

    .stories-section .section-heading {
        display: block;

        margin-bottom: 30px;
    }

    .stories-section .section-heading__intro {
        width: 100%;

        margin-top: 18px;
    }

    .story-grid {
        grid-template-columns: 1fr;

        gap: 34px;
    }

    .story-image,
    .story-image img {
        min-height: 0;
    }

    .story-image {
        aspect-ratio: 4 / 3;
    }

    .story-card:nth-child(2) .story-image {
        border-radius: 10px;
    }

    .story-card:nth-child(2) .story-pill {
        top: 16px;
        bottom: auto;
    }

    .story-card h3 {
        font-size: 24px;
    }

    .story-card > p {
        max-width: none;

        font-size: 14px;
    }


    /* Dialog */
    dialog#reader-dialog.reader-dialog {
        width: calc(100% - 20px);
        max-height: calc(100vh - 20px);

        border-radius: 12px;
    }

    #reader-dialog .reader-layout {
        display: block;
    }

    #reader-dialog .reader-art {
        height: 220px;
        min-height: 220px;
    }

    #reader-dialog .reader-art img {
        height: 220px;
        min-height: 220px;
    }

    #reader-dialog .reader-content {
        padding: 34px 24px 24px;
    }

    #reader-dialog .reader-content h2 {
        margin-bottom: 22px;

        font-size: 32px;
    }

    #reader-dialog .reader-page {
        font-size: 16px;
        line-height: 1.7;
    }

    #reader-dialog .reader-navigation {
        grid-template-columns: 44px 1fr;

        gap: 10px;
    }

    #reader-dialog .reader-progress {
        text-align: left;
    }

    #reader-dialog .reader-next {
        grid-column: 1 / -1;

        width: 100%;
    }

}


/* =========================================================
   SEHR KLEIN
   ========================================================= */

@media (max-width: 430px) {

    .stories-section .section-heading h2 {
        font-size: 34px;
    }

    .story-image {
        aspect-ratio: 1 / 1;
    }

    .story-pill {
        top: 12px;
        left: 12px;
    }

    .story-go {
        right: 12px;
        bottom: 12px;
    }

    #reader-dialog .reader-content {
        padding-inline: 20px;
    }

}


/* =========================================================
   REDUZIERTE BEWEGUNG
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .story-image img,
    .story-go,
    #reader-dialog .dialog-close,
    #reader-dialog .reader-navigation button {
        transition: none !important;
    }

}


/* =========================================================
   ASTRA – STORY-CARD HOVER ZURÜCKSETZEN
   ========================================================= */

body .story-card,
body .story-card:hover,
body .story-card:focus,
body .story-card:focus-visible,
body .story-card:active {

    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;

    color: inherit !important;

    border: 0 !important;
    box-shadow: none !important;
}


/* Astra kann teilweise auch Pseudo-Elemente auf Buttons setzen */
body .story-card::before,
body .story-card::after,
body .story-card:hover::before,
body .story-card:hover::after {

    background: transparent !important;
    box-shadow: none !important;
}


/* Bildbereich soll natürlich bestehen bleiben */
body .story-card .story-image {
    background-color: #e7e7df !important;
}


/* Text darf beim Hover nicht von Astra umgefärbt werden */
body .story-card:hover h3 {
    color: var(--story-text) !important;
}

body .story-card:hover > p {
    color: var(--story-text-soft) !important;
}