/* The "Interaktywne kadry filmowe" module: the frame viewer, its hotspots and the credits panel.
   Lifted verbatim out of the <style> block of home/home_page.html (2026-10-24), because the module is
   now on two pages — the home page and /cyfrowe-archiwum/ — and a second copy of 240 lines would drift.
   Loaded by home/_film_archive.html's two hosts; the partial itself carries only the markup. */

.film-archive-section {
    padding: 4rem 2rem;
}

/* On a phone the module is hidden on the home page, as it has been since the port: the frame was laid
   out for a wide viewport and the home page has plenty else to show. /cyfrowe-archiwum/ is *about* this
   module, so there it stays and the rules at the foot of this file stack it instead. */
@media (max-width: 768px) {
    .homepage .film-archive-section {
        display: none !important;
    }
}

.film-archive-header {
    margin-bottom: 1.5rem;
}

.film-archive-title {
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.15;
    margin: 0 0 0.4rem;
}

.film-archive-dot {
    display: inline-block;
    width: 13px;
    height: 13px;
    background: var(--primary-orange);
    border-radius: 50%;
    margin-left: 0.35rem;
    vertical-align: middle;
    position: relative;
    top: -2px;
}

.film-archive-subtitle {
    font-size: 0.78rem;
    color: #555;
    max-width: 340px;
    line-height: 1.5;
    margin: 0;
}

/* Film frame */
.film-frame-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #000;
    line-height: 0;
}

.film-frame-img {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.25s ease;
}

/* Hotspot layer */
.film-hotspots-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.film-hotspot {
    position: absolute;
    width: 30px;
    height: 30px;
    transform: translate(-50%, -50%);
    cursor: pointer;
    pointer-events: auto;
}

.film-hotspot-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(224, 90, 0, 0.22);
    border: 2px solid var(--primary-orange, #e05a00);
    transition: background 0.2s;
}

.film-hotspot-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: var(--primary-orange, #e05a00);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid #fff;
    transition: transform 0.2s;
}

.film-hotspot:hover .film-hotspot-ring,
.film-hotspot.active .film-hotspot-ring {
    background: rgba(224, 90, 0, 0.45);
}

.film-hotspot:hover .film-hotspot-dot,
.film-hotspot.active .film-hotspot-dot {
    transform: translate(-50%, -50%) scale(1.2);
}

/* Tooltip */
.film-hotspot-tooltip {
    position: absolute;
    left: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    padding: 0.45rem 0.4rem 0.45rem 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 150px;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.2);
    z-index: 30;
    white-space: nowrap;
    pointer-events: auto;
    cursor: pointer;
    color: inherit;
    text-decoration: none;
}

.film-hotspot-tooltip.flip-left {
    left: auto;
    right: calc(100% + 6px);
}

.film-hotspot-tooltip-text {
    flex: 1;
    line-height: 1.35;
}

.film-hotspot-tooltip-name {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #111;
}

.film-hotspot-tooltip-desc {
    display: block;
    font-size: 0.63rem;
    color: #666;
    letter-spacing: 0.03em;
}

.film-hotspot-arrow {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-orange, #e05a00);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

/* Film info panel */
.film-info-panel {
    background: #f0f0f0;
    padding: 1.8rem 3rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    align-items: start;
    min-height: 110px;
}

.film-info-desc {
    font-size: 0.78rem;
    font-weight: 500;
    color: #222;
    line-height: 1.65;
    margin: 0;
    letter-spacing: 0.01em;
    padding-right: 3rem;
    transition: opacity 0.25s ease;
}

.film-info-credits {
    font-size: 0.73rem;
    color: #444;
    line-height: 1.85;
    margin: 0;
    letter-spacing: 0.01em;
    white-space: pre-line;
    padding-left: 3rem;
    border-left: 1px solid #d0d0d0;
    transition: opacity 0.25s ease;
}

/* Nav bar */
.film-nav-bar {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.film-nav-btn {
    width: 32px;
    height: 32px;
    border: 1.5px solid #bbb;
    background: #fff;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    color: #333;
    transition: border-color 0.2s, color 0.2s;
}

.film-nav-btn:hover {
    border-color: var(--primary-orange, #e05a00);
    color: var(--primary-orange, #e05a00);
}

/* Tooltip hidden fix: display:flex on .film-hotspot-tooltip overrides [hidden] */
.film-hotspot-tooltip[hidden] {
    display: none !important;
}

/* Phone layout, which only /cyfrowe-archiwum/ ever reaches (the home page hides the module above).
   The credits sit under the description instead of beside it, the generous desktop padding comes off,
   and the hotspots shrink: at 30px they cover a quarter of a 360px-wide frame. Tooltips are opened by
   a tap — the script binds `click` as well as `mouseenter` — and are allowed to wrap, because
   `white-space: nowrap` on a 150px-min card runs them off the side of a narrow screen. */
@media (max-width: 768px) {
    .film-archive-section {
        padding: 2.5rem 1rem;
    }

    .film-archive-subtitle {
        max-width: none;
    }

    .film-info-panel {
        grid-template-columns: 1fr;
        gap: 1.1rem;
        padding: 1.2rem 1.1rem;
    }

    .film-info-desc {
        padding-right: 0;
    }

    .film-info-credits {
        padding-left: 0;
        padding-top: 1.1rem;
        border-left: 0;
        border-top: 1px solid #d0d0d0;
    }

    .film-hotspot {
        width: 22px;
        height: 22px;
    }

    .film-hotspot-tooltip {
        white-space: normal;
        min-width: 120px;
        max-width: 42vw;
    }
}
