/* ── PLAQUETTE VIEWER ── */
.plaquette-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 80px;
}

/* ── MAIN VIEWER STAGE ── */
.viewer-stage {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── VIEWER FRAME ── */
.viewer-frame {
    position: relative;
    background: #1a1a2e;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 600px;
}

.viewer-img {
    display: block;
    max-height: 72vh;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: opacity 0.25s ease;
}
.viewer-img.loading { opacity: 0; }

/* ── NAV ARROWS ── */
.viewer-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 22px;
    transition: background 0.2s, transform 0.2s;
    z-index: 10;
    user-select: none;
}
.viewer-arrow:hover { background: rgba(69,71,150,0.7); transform: translateY(-50%) scale(1.1); }
.viewer-arrow.prev { left: 16px; }
.viewer-arrow.next { right: 16px; }
.viewer-arrow:disabled { opacity: 0.25; cursor: default; pointer-events: none; }

/* ── PAGE COUNTER ── */
.viewer-counter {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 5px 14px;
    border-radius: 20px;
    pointer-events: none;
}

/* ── PAGE LABEL ── */
.viewer-label {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(69,71,150,0.85);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 4px 14px;
    border-radius: 20px;
    pointer-events: none;
    white-space: nowrap;
}

/* ── FULLSCREEN BUTTON ── */
.viewer-fullscreen-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
    z-index: 10;
}
.viewer-fullscreen-btn:hover { background: rgba(69,71,150,0.7); }

/* ── TOOLBAR ── */
.viewer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.viewer-title {
    font-size: 13px;
    font-weight: 600;
    color: #6b6f8a;
    letter-spacing: 0.5px;
}
.viewer-title strong {
    color: #232340;
}
.viewer-jump-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.viewer-jump-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #9ca3c0;
}
.viewer-jump-btn {
    background: #f0f1f9;
    border: none;
    color: #454796;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    letter-spacing: 0.5px;
}
.viewer-jump-btn:hover, .viewer-jump-btn.active {
    background: #454796;
    color: #fff;
}

/* ── ALPHABET INDEX ── */
.viewer-alpha-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px solid rgba(69, 71, 150, 0.1);
    width: 100%;
}
.viewer-alpha-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.viewer-alpha-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e2f0;
    background: #fff;
    color: #454796;
    font-size: 12px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0;
}
.viewer-alpha-btn:not(:disabled):hover,
.viewer-alpha-btn.active {
    background: #454796;
    color: #fff;
    border-color: #454796;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(69, 71, 150, 0.3);
}
.viewer-alpha-btn:disabled {
    background: #f5f5f8;
    color: #c5c8d8;
    border-color: #e8e9f0;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ── THUMBNAIL STRIP ── */
.thumb-strip-wrap {
    position: relative;
}
.thumb-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
    scrollbar-width: thin;
    scrollbar-color: #454796 #f0f1f9;
}
.thumb-strip::-webkit-scrollbar { width: 5px; }
.thumb-strip::-webkit-scrollbar-track { background: #f0f1f9; border-radius: 4px; }
.thumb-strip::-webkit-scrollbar-thumb { background: #454796; border-radius: 4px; }

.thumb-item {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
    background: #1a1a2e;
    aspect-ratio: 3/4;
    position: relative;
}
.thumb-item:hover { transform: scale(1.04); box-shadow: 0 4px 16px rgba(69,71,150,0.2); }
.thumb-item.active {
    border-color: #454796;
    box-shadow: 0 0 0 3px rgba(69,71,150,0.25);
}
.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.thumb-page-num {
    position: absolute;
    bottom: 3px;
    right: 4px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
}

/* ── SECTION HEADER ── */
.viewer-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.viewer-section-icon {
    width: 34px;
    height: 34px;
    background: rgba(69,71,150,0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #454796;
    font-size: 16px;
    flex-shrink: 0;
}
.viewer-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #232340;
    letter-spacing: 0.3px;
}
.viewer-section-sub {
    font-size: 11px;
    color: #9ca3c0;
}

/* ── TWO-COL LAYOUT (large screens) ── */
.viewer-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    align-items: start;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .viewer-layout {
        grid-template-columns: 1fr;
    }
    .thumb-strip {
        grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
        max-height: 200px;
    }
}
@media (max-width: 600px) {
    .viewer-frame { min-height: 350px; }
    .viewer-arrow { width: 40px; height: 40px; font-size: 18px; }
}

/* ── FULLSCREEN OVERLAY ── */
#fullscreenOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
#fullscreenOverlay.open { display: flex; }
#fullscreenOverlay img {
    max-width: 95vw;
    max-height: 92vh;
    object-fit: contain;
}
#fullscreenClose {
    position: fixed;
    top: 20px;
    right: 24px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    font-size: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}
#fullscreenClose:hover { background: rgba(255,255,255,0.3); }
#fullscreenArrowPrev, #fullscreenArrowNext {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 22px;
    transition: background 0.2s;
}
#fullscreenArrowPrev { left: 16px; }
#fullscreenArrowNext { right: 16px; }
#fullscreenArrowPrev:hover, #fullscreenArrowNext:hover { background: rgba(69,71,150,0.7); }
#fullscreenCounter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 16px;
    border-radius: 20px;
    letter-spacing: 1px;
}
