/* ==========================================================================
   Ahrtal Entwicklung 2021–2022–2024 (Seiten-Stylesheet)
   ========================================================================== */

:root {
    --pano-blue: #1d5fa7;
    --pano-blue-hover: #154880;
    --pano-handle-bg: rgba(29, 95, 167, 0.72);
    --pano-handle-active: rgba(21, 72, 128, 0.95);
    --pano-surface-light: rgba(255, 255, 255, 0.75);
    --pano-ink-dark: #181a1f;
    --pano-ink-muted: #4b5262;
}

[hidden] {
    display: none !important;
}

@keyframes compareFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.intro-block {
    margin-block: 1.5rem 3.5rem;
}

.section-breadcrumb {
    margin: 0 0 0.25rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.section-breadcrumb a {
    color: var(--pano-blue);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.15s ease;
}

.section-breadcrumb a::before {
    content: "←";
    font-size: 0.9em;
}

.section-breadcrumb a:hover,
.section-breadcrumb a:focus-visible {
    color: var(--pano-blue-hover);
    text-decoration: underline;
}

.intro-block h1 {
    margin: 0 0 1.25rem;
}

.intro-lead-compare {
    margin: 0 0 2.5rem;
    animation: compareFadeIn 0.42s ease-out both;
}

.entwicklung-list {
    display: flex;
    flex-direction: column;
    gap: 4.5rem;
    margin-block: 2rem 4rem;
}

.motiv-header {
    margin-bottom: 1rem;
}

.motiv-code {
    display: inline-block;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--pano-ink-muted);
}

.motiv-header h2 {
    margin: 0.15rem 0 0;
    font-size: clamp(1.2rem, 1.9vw, 1.55rem);
}

/* Zeile mit 3 Einzelbildern (2021, 2022, 2024) */
.year-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.year-card {
    margin: 0;
}

.year-card__btn {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    border-radius: 6px;
    overflow: hidden;
}

.year-card__btn:focus-visible {
    outline: 2px solid var(--pano-blue);
    outline-offset: 2px;
}

.year-card img {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 1;
    object-fit: cover;
    border-radius: 6px;
    background: #14161a;
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.year-card__btn:hover img,
.year-card__btn:focus-visible img {
    transform: scale(1.02);
    opacity: 0.94;
}

.year-card figcaption {
    margin-top: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--pano-ink-muted);
    text-align: center;
}

/* Vergleichs-Slider */
.motiv-compare-wrap {
    position: relative;
}

.compare-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 1;
    overflow: hidden;
    border-radius: 6px;
    background: #111;
    touch-action: pan-y;
    user-select: none;
}

.compare-stage:fullscreen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    border-radius: 0;
    aspect-ratio: auto;
}

.compare-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.compare-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.compare-label {
    position: absolute;
    top: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    background: var(--pano-surface-light);
    color: var(--pano-ink-dark);
    font-size: 0.78rem;
    font-weight: 600;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 5;
}

.compare-label--left {
    left: 0.75rem;
}

.compare-label--right {
    right: 0.75rem;
}

.compare-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(-50%);
    cursor: ew-resize;
    z-index: 15;
}

.compare-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.92);
    background: var(--pano-handle-bg);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.18s ease, background-color 0.18s ease;
}

.compare-divider:hover .compare-handle,
.compare-divider:focus-visible .compare-handle,
.compare-stage.is-dragging .compare-handle {
    transform: translate(-50%, -50%) scale(1.08);
    background: var(--pano-handle-active);
    outline: none;
}

.compare-controls {
    position: absolute;
    right: 0.65rem;
    bottom: 0.65rem;
    display: flex;
    gap: 0.35rem;
    z-index: 20;
}

.ctrl-btn {
    background: var(--pano-blue);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.36rem 0.62rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.1;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    transition: background-color 0.15s ease;
}

.ctrl-btn:hover,
.ctrl-btn:focus-visible {
    background: var(--pano-blue-hover);
    outline: none;
}

/* Kleiner Exit-Button unten rechts im Vollbildmodus */
.fs-exit-bottom-btn {
    position: fixed;
    right: 1.15rem;
    bottom: 1.15rem;
    z-index: 30;
    background: rgba(20, 24, 31, 0.85);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    padding: 0.42rem 0.95rem;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.fs-exit-bottom-btn:hover,
.fs-exit-bottom-btn:focus-visible {
    background: var(--pano-blue-hover);
    transform: translateY(-1px);
    outline: none;
}

/* Lightbox für die Einzelbilder */
.img-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.img-lightbox:not([hidden]) {
    animation: lightboxFadeIn 0.22s ease-out;
}

.img-lightbox__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 12, 16, 0.88);
    backdrop-filter: blur(4px);
}

.img-lightbox__dialog {
    position: relative;
    z-index: 1;
    max-width: min(1280px, 94vw);
    max-height: 92vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-lightbox__figure {
    position: relative;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
}

.img-lightbox__img {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
    background: #0f1115;
    opacity: 1;
    transition: opacity 0.35s ease-in-out;
}

.img-lightbox__img.is-fading {
    opacity: 0;
}

.img-lightbox__img--top {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    box-shadow: none;
    background: transparent;
}

.img-lightbox__caption {
    width: 100%;
    color: #eef1f6;
    font-size: 0.88rem;
    text-align: left;
}

.img-lightbox__close,
.img-lightbox__nav {
    position: fixed;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(24, 28, 36, 0.82);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease;
}

.img-lightbox__close:hover,
.img-lightbox__close:focus-visible,
.img-lightbox__nav:hover,
.img-lightbox__nav:focus-visible {
    background: var(--pano-blue);
    outline: none;
}

.img-lightbox__close {
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.1rem;
}

.img-lightbox__nav {
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 56px;
    border-radius: 6px;
    font-size: 1.8rem;
    line-height: 1;
}

.img-lightbox__nav--prev {
    left: 1rem;
}

.img-lightbox__nav--next {
    right: 1rem;
}

@media (prefers-reduced-motion: reduce) {
    .intro-lead-compare,
    .img-lightbox:not([hidden]),
    .year-card img,
    .compare-handle,
    .ctrl-btn,
    .fs-exit-bottom-btn,
    .img-lightbox__img,
    .img-lightbox__close,
    .img-lightbox__nav,
    .section-breadcrumb a {
        animation: none !important;
        transition: none !important;
    }
}

@media (max-width: 768px) {
    .year-row {
        grid-template-columns: 1fr;
    }

    .img-lightbox__nav {
        top: auto;
        bottom: 1rem;
        transform: none;
        width: 42px;
        height: 42px;
    }

    .img-lightbox__nav--prev {
        left: 1rem;
    }

    .img-lightbox__nav--next {
        right: 1rem;
    }
}