/*
 * Netzmal Designsystem: Storytelling
 * ----------------------------------
 * Seiteneinstieg, wechselnde Bild-/Text-Kapitel und Feature-Flächen.
 */

/* Ruhiger, zentrierter Seiteneinstieg */
.nm-page-intro {
    max-width: 1050px;
    margin-top: clamp(155px, 14vw, 210px);
    margin-bottom: clamp(100px, 13vw, 170px);
    text-align: center;
}

.nm-page-intro .nm-text {
    max-width: 880px;
    margin-inline: auto;
}

.nm-page-intro-mark {
    display: block;
    width: clamp(210px, 22vw, 300px);
    height: auto;
    margin-inline: auto;
}

.nm-page-intro-marks {
    display: flex;
    flex-wrap: wrap;
    gap: var(--nm-space-lg);
    align-items: center;
    justify-content: center;
}

.nm-stack > .nm-page-intro-marks {
    margin-top: var(--nm-space-xl);
}

.nm-page-intro-marks .nm-page-intro-mark {
    width: min(220px, 100%);
    margin: 0;
}

.nm-page-intro-marks .nm-page-intro-mark-wide {
    width: auto;
    height: 13px;
    transform: translateY(-8px);
}

[data-theme='dark'] .nm-page-intro-mark-monochrome {
    filter: invert(1);
}

/* Vollbreiter Auftakt vor einer Folge normaler Story-Kapitel */
.nm-story-opening {
    margin-top: clamp(80px, 11vw, 150px);
    margin-bottom: var(--nm-story-chapter-gap);
    padding-block: var(--nm-space-lg);
}

/* Zweispaltiges Story-Kapitel; reverse tauscht Bild und Text */
.nm-story {
    display: grid;
    grid-template-columns: minmax(270px, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(var(--nm-space-lg), 7vw, 110px);
    align-items: center;
    margin-bottom: var(--nm-story-chapter-gap);
    padding-block: var(--nm-space-lg);
}

.nm-story:last-child {
    margin-bottom: 0;
}

.nm-story-reverse {
    grid-template-columns: minmax(0, 1.1fr) minmax(270px, 0.9fr);
}

.nm-story-reverse .nm-story-visual { grid-column: 2; }
.nm-story-reverse .nm-story-copy { grid-row: 1; grid-column: 1; }

.nm-story-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 360px;
    margin: 0;
    padding: clamp(28px, 5vw, 60px);
    overflow: hidden;
    border-radius: var(--nm-radius);
    background: linear-gradient(145deg, var(--nm-color-primary-soft), var(--nm-color-surface-strong));
}

.nm-story-visual img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 290px;
    object-fit: contain;
}

.nm-story-visual picture {
    display: block;
}

/* Vollflächige Fotos stehen ohne zusätzliche Hintergrundbox im Story-Raster. */
.nm-story-visual-plain {
    min-height: 0;
    padding: 0;
    overflow: visible;
    border-radius: 0;
    background: transparent;
}

.nm-story-visual-plain img {
    max-height: none;
}

/* Portraitpaar mit seriöser und spielerischer Variante */
.nm-story-portrait {
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 3 / 2;
    padding: 0;
    border-radius: var(--nm-radius);
    background: var(--nm-color-surface);
    box-shadow: var(--nm-shadow-soft);
    outline: none;
}

.nm-story-portrait-switch-icon {
    position: absolute;
    z-index: 2;
    right: 18px;
    bottom: 18px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--nm-color-page) 90%, transparent);
    color: var(--nm-color-text);
    font-size: 16px;
    line-height: 42px;
    text-align: center;
    box-shadow: var(--nm-shadow-control);
    transition: transform 300ms ease;
}

.nm-story-portrait img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
    transition: opacity 450ms ease, transform 700ms ease;
}

.nm-story-portrait .nm-story-portrait-alt {
    opacity: 0;
}

.nm-story-portrait[tabindex]:hover img,
.nm-story-portrait[tabindex]:focus-visible img {
    transform: scale(1.025);
}

.nm-story-portrait[tabindex]:hover .nm-story-portrait-main,
.nm-story-portrait[tabindex]:focus-visible .nm-story-portrait-main {
    opacity: 0;
}

.nm-story-portrait[tabindex]:hover .nm-story-portrait-alt,
.nm-story-portrait[tabindex]:focus-visible .nm-story-portrait-alt {
    opacity: 1;
}

.nm-story-portrait[tabindex]:hover .nm-story-portrait-switch-icon,
.nm-story-portrait[tabindex]:focus-visible .nm-story-portrait-switch-icon {
    transform: rotate(-8deg) scale(1.08);
}

.nm-story-portrait:focus-visible {
    outline: 3px solid var(--nm-color-primary);
    outline-offset: 4px;
}

.nm-story-copy .nm-heading { margin-bottom: 24px; }
.nm-story-copy .nm-text { margin-bottom: 20px; }
.nm-story-copy .nm-story-link-secondary { margin-top: var(--nm-space-lg); }

/* Titelzeile über dem Inhalt; Bild und Sub-Überschrift beginnen bündig. */
.nm-story-staged {
    grid-template-areas:
        '. title'
        'visual copy';
    grid-template-rows: auto 1fr;
    row-gap: 24px;
    align-items: start;
}

.nm-story-staged.nm-story-reverse {
    grid-template-areas:
        'title .'
        'copy visual';
}

.nm-story-staged .nm-story-title {
    grid-area: title;
}

.nm-story-staged .nm-story-copy {
    grid-area: copy;
}

.nm-story-staged .nm-story-visual {
    grid-area: visual;
}

/* Farbige Hervorhebung innerhalb einer Inhaltsgruppe */
.nm-feature {
    min-height: 360px;
    padding: clamp(32px, 5vw, 58px);
    border-radius: var(--nm-radius);
    background: var(--nm-color-primary);
    color: var(--nm-color-on-dark);
}

.nm-feature .nm-subheading,
.nm-feature .nm-heading,
.nm-feature .nm-text,
.nm-feature .nm-eyebrow {
    color: var(--nm-color-on-primary);
}

.nm-feature .nm-eyebrow-line {
    --nm-eyebrow-accent: var(--nm-color-on-primary);
}

.nm-feature-action {
    text-align: right;
}

.nm-feature-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--nm-space-xs);
    align-items: center;
    justify-content: flex-end;
}

.nm-feature-action-separator {
    color: color-mix(in srgb, var(--nm-color-on-primary) 65%, var(--nm-color-transparent));
}

.nm-feature-link,
.nm-feature-link:visited {
    color: var(--nm-color-on-primary);
    font-family: inherit;
    font-size: var(--nm-font-size-text);
    font-weight: 700;
    line-height: 1.65;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.nm-feature-link:hover,
.nm-feature-link:focus-visible {
    color: var(--nm-color-on-primary);
}

/* Ruhige Feature-Fläche für umfangreichere Übersichten */
.nm-feature-surface {
    background: var(--nm-color-surface);
    color: var(--nm-color-text);
}

.nm-feature-surface .nm-subheading,
.nm-feature-surface .nm-heading,
.nm-feature-surface .nm-text,
.nm-feature-surface .nm-eyebrow,
.nm-feature-surface .nm-feature-link,
.nm-feature-surface .nm-feature-link:visited,
.nm-feature-surface .nm-feature-link:hover,
.nm-feature-surface .nm-feature-link:focus-visible {
    color: var(--nm-color-text);
}

.nm-feature-surface .nm-eyebrow-line {
    --nm-eyebrow-accent: var(--nm-color-secondary);
}

/* Story-Kapitel werden mobil einspaltig */
@media (max-width: 820px) {
    .nm-story,
    .nm-story-reverse {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .nm-story-reverse .nm-story-visual,
    .nm-story-reverse .nm-story-copy {
        grid-row: auto;
        grid-column: auto;
    }

    .nm-story-staged,
    .nm-story-staged.nm-story-reverse {
        grid-template-areas:
            'title'
            'copy'
            'visual';
        grid-template-rows: auto;
    }

    .nm-story-staged .nm-story-copy {
        grid-area: copy;
    }

    .nm-story-staged .nm-story-visual {
        grid-area: visual;
    }

    .nm-story-visual:not(.nm-story-visual-plain) {
        min-height: 310px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nm-story-portrait img,
    .nm-story-portrait::after {
        transition: none;
    }
}
.nm-tag-groups {
    display: grid;
    gap: var(--nm-space-md);
    margin-top: var(--nm-space-md);
}

.nm-tag-group h4 {
    margin: 0 0 var(--nm-space-xs);
    color: var(--nm-color-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.nm-tag-group .nm-cluster {
    --nm-cluster-space: 8px;
}
