/* static/css/slideshow.css */

/* ===========================
   Layout
   =========================== */

.slideshow-layout {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    height: 100%;
    min-height: 0;
    position: relative;
}

/* ===========================
   Infokarte
   =========================== */

.sa-info-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 252, 249, 0.95)),
        var(--sa-surface);
    border-radius: var(--sa-radius-card);
    box-shadow: var(--sa-shadow-soft);
    border: 1px solid rgba(152, 114, 72, 0.16);
    padding: 1.1rem 1.2rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    max-height: 40vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--sa-border) transparent;
}

.sa-title {
    margin: 0 0 0.15rem;
    font-size: clamp(1.05rem, 0.96rem + 0.56vw, 1.42rem);
    line-height: 1.28;
    letter-spacing: 0.01em;
}

.sa-meta-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr);
    gap: 0.75rem 1.5rem;
    font-size: 0.8rem;
}

.sa-meta-col {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sa-meta-col-right {
    text-align: right;
}

.sa-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.sa-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.7rem;
    color: var(--sa-text-muted);
    white-space: nowrap;
}

.sa-value {
    font-weight: 560;
    font-size: 0.8rem;
}

.sa-hint {
    margin: 0.35rem 0 0.1rem;
    font-size: 0.75rem;
    color: var(--sa-text-muted);
}

/* ===========================
   Bildpanel
   =========================== */

.slideshow-main-panel {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    flex: 1 1 auto;
    min-height: 0;
}

.sa-image-shell {
    flex: 1 1 auto;
    min-height: 0;
    background:
        radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.72), transparent 40%),
        radial-gradient(circle at 84% 0, rgba(179, 18, 23, 0.12), transparent 50%),
        linear-gradient(160deg, #f5e8da 0%, #f0e4d8 46%, #eadccf 100%);
    border-radius: var(--sa-radius-card);
    box-shadow: var(--sa-shadow-soft-strong);
    border: 1px solid rgba(132, 94, 62, 0.14);
    padding: 0.52rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.sa-image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 0.62rem;
    object-fit: contain;
    display: block;
    box-shadow:
        0 18px 44px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(255, 255, 255, 0.12) inset;
    background: #111;
    opacity: 0;
    transform: scale(0.992);
    transition: opacity 0.32s ease, transform 0.36s ease;
}

.sa-image.is-visible {
    opacity: 1;
    transform: scale(1);
}

.sa-image-loader {
    position: absolute;
    inset: 0.7rem;
    border-radius: 0.7rem;
    background: repeating-linear-gradient(
        135deg,
        #f7f2eb,
        #f7f2eb 10px,
        #efe1d3 10px,
        #efe1d3 20px
    );
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--sa-text-muted);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.sa-image-shell.is-loading .sa-image-loader {
    opacity: 1;
}

.sa-image-shell.is-loading .sa-image {
    opacity: 0.18;
    transform: scale(0.992);
}

.sa-image-shell.is-playing .sa-image.is-visible {
    animation: sa-ken-burns 6s ease-in-out infinite alternate;
}

/* kleine "Filmstreifen"-Kante oben */

.sa-image-shell::before {
    content: "";
    position: absolute;
    top: 0.4rem;
    left: 1.3rem;
    right: 1.3rem;
    height: 0.35rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    opacity: 0.4;
}

.sa-image-shell::after {
    content: "";
    position: absolute;
    inset: -18% 10% auto;
    height: 45%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 64%);
    pointer-events: none;
}

/* ===========================
   Untere Leiste (Controls)
   =========================== */

.sa-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.52rem 0.8rem;
    border-radius: 0.9rem;
    background:
        radial-gradient(circle at top right, rgba(179, 18, 23, 0.1), transparent 56%),
        #fff;
    border: 1px solid rgba(148, 109, 68, 0.24);
    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.sa-controls-left,
.sa-controls-center,
.sa-controls-right {
    display: flex;
    align-items: center;
}

.sa-controls-center {
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
}

.sa-controls-right {
    justify-content: flex-end;
}

/* Button-Gruppe */

.sa-btn-group {
    display: inline-flex;
    border-radius: 999px;
    background: #f6efe6;
    padding: 0.1rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.sa-btn {
    min-width: 3.2rem;
    padding: 0.26rem 0.9rem;
    font-size: 0.8rem;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    border-radius: 999px;
    transition:
        background 0.12s ease,
        box-shadow 0.12s ease,
        transform 0.08s ease,
        color 0.12s ease;
    color: var(--sa-text-main);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.sa-btn-icon {
    font-size: 0.9rem;
}

.sa-btn-ghost {
    background: transparent;
}

.sa-btn-primary {
    background: var(--sa-red);
    color: #fff;
    box-shadow: 0 2px 6px rgba(179, 18, 23, 0.4);
}

.sa-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-0.3px);
}

.sa-btn-primary:hover {
    background: var(--sa-red-dark);
    box-shadow: 0 4px 10px rgba(179, 18, 23, 0.6);
}

.sa-btn-left {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.sa-btn-middle {
    border-radius: 0;
}

.sa-btn-right {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Zähler */

.sa-counter {
    font-size: 0.8rem;
    color: #5c4b3a;
    font-weight: 630;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.78rem;
    border-radius: 999px;
    background: #f8efe2;
    box-shadow: inset 0 0 0 1px rgba(132, 96, 62, 0.14);
}

.sa-counter-wrap {
    display: grid;
    grid-template-columns: minmax(8.5rem, auto);
    justify-items: center;
    gap: 0.16rem;
}

.sa-progress-track {
    width: 100%;
    height: 0.2rem;
    border-radius: 999px;
    background: rgba(138, 102, 64, 0.24);
    overflow: hidden;
}

.sa-progress-bar {
    display: block;
    width: 100%;
    height: 100%;
    transform-origin: left center;
    transform: scaleX(0);
    background: linear-gradient(90deg, #b31217, #dd4a4d);
    transition: transform 0.08s linear;
}

.sa-controls-bar.is-playing .sa-progress-track {
    box-shadow: 0 0 0 1px rgba(179, 18, 23, 0.14);
}

.sa-hotkey-hint {
    font-size: 0.66rem;
    color: var(--sa-text-muted);
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* Link „im Originalkontext“ als dezente Ghost‑Variante */

.sa-slideshow-link {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    gap: 0.02rem;
    padding: 0.34rem 0.9rem 0.35rem 0.76rem;
    border-radius: 0.82rem;
    border: 1px solid rgba(179, 18, 23, 0.24);
    background: linear-gradient(180deg, #fff, #fff8f7);
    color: #8f1317;
    font-size: 0.8rem;
    font-weight: 570;
    text-decoration: none;
    transition:
        background 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.12s ease,
        border-color 0.18s ease;
}

.sa-slideshow-link::before {
    content: "↗";
    font-size: 0.9rem;
    position: absolute;
    left: 0.58rem;
    top: 0.52rem;
    opacity: 0.8;
}

.sa-link-main {
    padding-left: 0.65rem;
}

.sa-link-sub {
    margin-left: 0.68rem;
    font-size: 0.66rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(93, 56, 36, 0.86);
    background: rgba(209, 178, 146, 0.24);
    border-radius: 999px;
    padding: 0.05rem 0.44rem;
}

.sa-slideshow-link:hover {
    background: linear-gradient(180deg, #fff8f7, #fff2f0);
    border-color: rgba(179, 18, 23, 0.42);
    box-shadow: 0 8px 18px rgba(125, 32, 35, 0.22);
    transform: translateY(-1px);
}

.sa-slideshow-link:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(125, 32, 35, 0.2);
}

@keyframes sa-ken-burns {
    from {
        transform: scale(1.01) translateY(0);
    }
    to {
        transform: scale(1.035) translateY(-0.45%);
    }
}

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

@media (max-width: 960px) {
    .sa-meta-grid {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .sa-info-card {
        max-height: 42vh;
    }

    .sa-hotkey-hint {
        display: none;
    }
}

@media (max-width: 640px) {
    .slideshow-layout {
        gap: 0.7rem;
    }

    .sa-controls-bar {
        flex-direction: column;
        align-items: stretch;
        border-radius: 0.9rem;
        padding: 0.6rem;
        gap: 0.5rem;
    }

    .sa-controls-center {
        justify-content: flex-start;
    }

    .sa-controls-right {
        justify-content: flex-start;
    }

    .sa-counter-wrap {
        justify-items: start;
        width: 100%;
        grid-template-columns: 1fr;
    }

    .sa-progress-track {
        max-width: 12rem;
    }

    .sa-slideshow-link {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sa-image,
    .sa-btn,
    .sa-slideshow-link,
    .sa-progress-bar {
        transition: none !important;
    }

    .sa-image-shell.is-playing .sa-image.is-visible {
        animation: none !important;
    }
}
