/* =================================================================
   coverViewer.css — Lightbox for album cover variants (front, back,
   disk). Modal with prev/next nav, thumbnail strip, click-backdrop
   to close. Aesthetic mirrors the booklet viewer (booklet.css) but
   on a neutral dark backdrop since covers aren't paper-textured.
   ================================================================= */

.cover-viewer-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 6000;
    padding: 24px;
    animation: fadeIn 0.18s ease-out;
}

.cover-viewer-frame {
    width: 100%;
    max-width: 1200px;
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: linear-gradient(180deg, #14141a 0%, #0a0a0f 100%);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 40px 80px rgba(0, 0, 0, 0.7),
        inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    overflow: hidden;
}

.cover-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.25);
}

.cover-viewer-title {
    font-size: 14px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-primary);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 12px;
}

.cover-viewer-header-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.cover-viewer-counter {
    font-size: 11.5px;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}

.cover-viewer-close {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.cover-viewer-close:hover {
    background: rgba(var(--accent-primary-rgb), 0.18);
    border-color: rgba(var(--accent-primary-rgb), 0.4);
    color: var(--accent-primary);
}

.cover-viewer-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 24px 70px;
    background:
        radial-gradient(ellipse at center, rgba(255, 255, 255, 0.02) 0%, transparent 70%),
        #07070a;
}

.cover-viewer-image-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.cover-viewer-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    background: #1a1a24;
}

.cover-viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 80px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
    z-index: 2;
}

.cover-viewer-nav-prev { left: 12px; }
.cover-viewer-nav-next { right: 12px; }

.cover-viewer-nav:hover {
    background: rgba(var(--accent-primary-rgb), 0.18);
    border-color: rgba(var(--accent-primary-rgb), 0.4);
    color: var(--accent-primary);
}

.cover-viewer-nav:active {
    transform: translateY(-50%) scale(0.96);
}

/* Thumbnail strip — only rendered when more than one image is available.
   Each thumb shows a 64×64 preview plus the variant label below it. */
.cover-viewer-thumbs {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: flex-end;
    padding: 12px 18px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.25);
}

.cover-viewer-thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
    font-family: inherit;
}

.cover-viewer-thumb img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 4px;
    background: #1a1a24;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.cover-viewer-thumb-label {
    font-size: 10.5px;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.cover-viewer-thumb:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.cover-viewer-thumb.active {
    background: rgba(var(--accent-primary-rgb), 0.12);
    border-color: rgba(var(--accent-primary-rgb), 0.5);
}

.cover-viewer-thumb.active .cover-viewer-thumb-label {
    color: var(--accent-primary);
}

/* Hint that the cover is clickable. Only applied when the element
   actually has art on it — empty placeholder covers shouldn't show
   the zoom cursor (the click handler is a no-op for those). After
   the background-image → <img> refactor, "has art" means the wrapper
   contains an <img.cover-img>; :has() is supported by every browser
   we ship to (Electron 41 = Chromium 134). The legacy attribute
   match is preserved as a fallback so partially-converted callers
   (or any setup that re-applies a background-image) still light up. */
.detail-cover:has(img.cover-img),
.qh-cover:has(img.cover-img),
.detail-cover[style*="background-image"],
.qh-cover[style*="background-image"] {
    cursor: zoom-in;
}
