/* ═══════════════════════════════════════════════════════════════
   Focus Rail Carousel — mobile first
   ═══════════════════════════════════════════════════════════════ */

.fr-wrap {
    position: relative;
    width: 100%;
    height: 460px;
    overflow: hidden;
    background: var(--bg-deep);
    outline: none;
    user-select: none;
    -webkit-user-select: none;
    contain: layout style;
    transform: translateZ(0); /* own compositing layer */
}

/* ── Background ambience ─────────────────────────────────────── */
.fr-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}
.fr-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(40px) saturate(140%);
    opacity: 0;
    transition: opacity 0.6s ease;
    display: block;
}
.fr-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
        var(--bg-deep) 0%,
        rgba(6,6,10,0.55) 50%,
        rgba(6,6,10,0.2) 100%);
}

/* ── Stage ───────────────────────────────────────────────────── */
.fr-stage-wrap {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding-bottom: 8px;
}

.fr-stage {
    position: relative;
    width: 100%;
    height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
    cursor: grab;
    flex-shrink: 0;
    touch-action: none; /* lets pointer events handle all touch — prevents page scroll conflict */
}
.fr-stage.dragging { cursor: grabbing; }

/* ── Cards ───────────────────────────────────────────────────── */
.fr-card {
    position: absolute;
    width: 160px;
    aspect-ratio: 3 / 4; /* overridden per-card by JS based on image dimensions */
    border-radius: 14px;
    overflow: hidden;
    border-top: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    transform-style: preserve-3d;
    will-change: transform, opacity, filter;
    transition:
        transform 0.55s cubic-bezier(0.34,1.56,0.64,1),
        opacity   0.4s ease,
        filter    0.4s ease;
}
.fr-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}
.fr-card-gloss {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.1), transparent 60%);
    pointer-events: none;
    border-radius: 14px;
}

/* ── Info bar — stacked, centred below active card ───────────── */
.fr-info {
    width: 100%;
    max-width: 860px;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    pointer-events: auto;
    text-align: center;
}

.fr-info-text {
    min-height: 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    width: 100%;
}

.fr-title {
    font-family: var(--font-display);
    font-size: clamp(18px, 3.5vw, 28px);
    font-weight: 400;
    font-style: italic;
    color: var(--text-primary);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* ── Navigation ──────────────────────────────────────────────── */
.fr-controls { flex-shrink: 0; }

.fr-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(13,13,24,0.85);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 100px;
    padding: 4px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.fr-prev,
.fr-next {
    background: none;
    border: none;
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
.fr-prev:hover, .fr-next:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}
.fr-prev:active, .fr-next:active { transform: scale(0.9); }
.fr-prev svg, .fr-next svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.fr-counter {
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    min-width: 40px;
    text-align: center;
}

/* ── Click hint ──────────────────────────────────────────────── */
.fr-click-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px 0;
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

@media (min-width: 900px) {
    .fr-click-hint { padding: 10px 72px 0; }
}

/* ── Lightbox ────────────────────────────────────────────────── */
.fr-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0,0,0,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 20px;
}
.fr-lightbox.open {
    opacity: 1;
    pointer-events: all;
}

/* Inner wrapper — photo + optional info panel */
.fr-lb-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    max-width: 90vw;
    max-height: 90vh;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.fr-lightbox.open .fr-lb-inner { transform: scale(1); }

/* With info panel: side-by-side on desktop */
@media (min-width: 700px) {
    .fr-lb-inner.fr-lb-has-info {
        flex-direction: row;
        align-items: stretch;
        gap: 0;
    }
}

/* Photo side */
.fr-lb-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.fr-lb-photo img {
    max-width: 80vw;
    max-height: 85vh;
    object-fit: contain;
    display: block;
    border-radius: 4px 0 0 4px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.8);
    transition: opacity 0.25s ease;
}
.fr-lb-inner:not(.fr-lb-has-info) .fr-lb-photo img {
    border-radius: 4px;
    max-width: 90vw;
}
@media (min-width: 700px) {
    .fr-lb-inner.fr-lb-has-info .fr-lb-photo img {
        max-height: 80vh;
        max-width: 58vw;
    }
}

/* Info panel */
.fr-lb-info {
    background: rgba(14,14,24,0.96);
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 4px 4px 0;
    padding: 36px 28px;
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    justify-content: center;
}
@media (max-width: 699px) {
    .fr-lb-info {
        border-left: 1px solid var(--border);
        border-top: none;
        border-radius: 0 0 4px 4px;
        width: 100%;
        padding: 20px;
        gap: 12px;
    }
    .fr-lb-photo img { border-radius: 4px 4px 0 0 !important; max-width: 90vw !important; }
}

.fr-lb-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 400;
    font-style: italic;
    color: var(--text-primary);
    line-height: 1.3;
}
.fr-lb-desc {
    font-size: 13px;
    line-height: 1.75;
    color: var(--text-secondary);
}
.fr-lb-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.fr-lb-credit,
.fr-lb-year {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.fr-lb-credit:empty,
.fr-lb-year:empty { display: none; }

/* Close button */
.fr-lightbox-close {
    position: fixed;
    top: 20px;
    right: 24px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 20px;
    line-height: 1;
    z-index: 1;
}
.fr-lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* Center card shows zoom cursor */
.fr-card.is-center { cursor: zoom-in; }

/* ── Tablet ──────────────────────────────────────────────────── */
@media (min-width: 600px) {
    .fr-wrap   { height: 520px; }
    .fr-stage  { height: 320px; }
    .fr-card   { width: 210px; }
    .fr-info   { padding: 0 32px; }
}

/* ── Desktop ─────────────────────────────────────────────────── */
@media (min-width: 900px) {
    .fr-wrap   { height: 600px; }
    .fr-stage  { height: 380px; }
    .fr-card   { width: 270px; border-radius: 18px; }
    .fr-info   { padding: 0 72px; max-width: none; }
    .fr-title  { font-size: 30px; }
    .fr-prev, .fr-next { width: 38px; height: 38px; }
}
