/* ============================================================
   uoAvox — Facet page (download gallery + interactive map popup)
   Reuses the variables and .btn / .gh-status styles from site.css
   ============================================================ */

.facet-wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 8px 24px 80px;
}

.facet-intro {
    color: var(--text-2);
    max-width: 72ch;
    margin: 0 0 32px;
    font-size: 22px;
}

.facet-intro code {
    font-family: var(--font-mono);
    font-size: 15px;
    color: var(--gold);
}

.facet-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ---------- Facet card (preview left, details right) ---------- */

.facet-card {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 12px 24px;
    transition: border-color 0.18s ease;
}

    .facet-card:hover {
        border-color: var(--gold-2);
    }

/* Fixed square container: the layout never shifts whether the image has loaded, failed, or is missing */
.facet-preview {
    position: relative;
    width: 280px;
    aspect-ratio: 1 / 1;
    background: #000;
    border: 1px solid var(--border-2);
    overflow: hidden;
}

.facet-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px;
    font-family: var(--font-display);
    font-size: 13px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-3);
}

    .facet-placeholder::before {
        content: '';
        position: absolute;
        inset: 14%;
        border-radius: 50%;
        border: 1px solid var(--border-2);
        background: radial-gradient(circle at 35% 30%, #2a251f 0%, #141210 70%);
        box-shadow: 0 0 18px rgba(201, 163, 74, 0.12);
    }

    .facet-placeholder span {
        position: relative;
    }

.facet-preview img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.facet-preview.is-loaded img {
    opacity: 1;
}

.facet-preview.is-loaded .facet-placeholder {
    display: none;
}

.facet-details {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.facet-name {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--gold);
    margin: 0;
    overflow-wrap: anywhere;
}

.facet-size,
.facet-cart,
.facet-desc {
    font-family: var(--font-mono);
    font-size: 16px;
    color: var(--text-2);
    margin: 0;
}

    .facet-size b,
    .facet-cart b,
    .facet-desc b {
        font-family: var(--font-display);
        font-weight: 600;
        letter-spacing: 0.16em;
        text-transform: uppercase;
        font-size: 13px;
        color: var(--text-3);
        margin-right: 10px;
    }

.facet-divider {
    width: 100%;
    height: 1px;
    margin: 0;
    border: 0;
    background: var(--border-2);
}

.facet-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.facet-actions .btn { padding-top: 10px; padding-bottom: 10px; }

.facet-sep {
    margin: 0 2ch;
    color: var(--border-2);
}

/* ---------- Map popup ---------- */

body.fv-open {
    overflow: hidden;
}

.fv-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(10, 8, 6, 0.88);
}

    .fv-overlay[hidden] {
        display: none;
    }

.fv-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(1120px, 100%);
    height: min(780px, 100%);
    background: var(--bg-2);
    border: 1px solid var(--border-2);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.85);
}

.fv-corner {
    position: absolute;
    width: 22px;
    height: 22px;
    border: 1px solid var(--gold);
    opacity: 0.55;
    pointer-events: none;
    z-index: 2;
}

    .fv-corner.tl {
        top: 6px;
        left: 6px;
        border-right: none;
        border-bottom: none;
    }

    .fv-corner.tr {
        top: 6px;
        right: 6px;
        border-left: none;
        border-bottom: none;
    }

    .fv-corner.bl {
        bottom: 6px;
        left: 6px;
        border-right: none;
        border-top: none;
    }

    .fv-corner.br {
        bottom: 6px;
        right: 6px;
        border-left: none;
        border-top: none;
    }

.fv-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #1a1714 0%, #141210 100%);
}

.fv-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fv-tools {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.fv-btn {
    min-width: 40px;
    height: 36px;
    padding: 0 12px;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-2);
    cursor: pointer;
    transition: all 0.18s ease;
}

    .fv-btn:hover,
    .fv-btn:focus-visible {
        background: var(--surface-2);
        border-color: var(--gold);
        color: var(--gold);
        outline: none;
    }

.fv-viewport {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: #0a0908;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

    .fv-viewport.is-dragging {
        cursor: grabbing;
    }

    .fv-viewport img {
        position: absolute;
        left: 0;
        top: 0;
        max-width: none;
        transform-origin: 0 0;
        will-change: transform;
        pointer-events: none;
    }

        .fv-viewport img.is-pixelated {
            image-rendering: pixelated;
        }

.fv-message {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    font-style: italic;
    color: var(--text-2);
    pointer-events: none;
}

.fv-hint {
    padding: 10px 20px;
    border-top: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-3);
    text-align: center;
}

/* ---------- Pagination ---------- */
.facet-pagination:not([hidden]) {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.facet-page-button {
    padding: 8px 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--gold-2);
    font: 600 14px/1.6 var(--font-display);
    cursor: pointer;
}

.facet-page-button:hover:not(:disabled),
.facet-page-button[aria-current="page"] {
    border-color: var(--gold-2);
    background: var(--gold-2);
    color: var(--bg);
}

.facet-page-button:disabled { opacity: 0.5; cursor: default; }
.facet-page-button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.facet-list { scroll-margin-top: 100px; }

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
    .facet-wrap {
        padding: 8px 16px 60px;
    }

    .facet-card {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 18px;
    }

    .facet-preview {
        width: min(100%, 320px);
        margin: 0 auto;
    }

    .facet-intro {
        font-size: 18px;
    }

    .facet-name {
        font-size: 18px;
    }

    .fv-overlay {
        padding: 8px;
    }

    .fv-title {
        font-size: 14px;
        letter-spacing: 0.08em;
    }
}
