/* ==========================================================================
   8. Centered Modular Exhibition Card Modal (matching pew.ibk10025.hu)
   ========================================================================== */

body.pew-modal-open {
    overflow: hidden !important;
}

.pew-card-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.pew-card-modal.is-active {
    opacity: 1;
    visibility: visible;
}

/* Dark Backdrop with Blur */
.pew-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(18, 26, 31, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.28s ease;
}

.pew-card-modal.is-active .pew-modal-backdrop {
    opacity: 1;
}

/* Floating Navigation Arrows */
.pew-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(44, 57, 66, 0.22);
    color: #2c3942;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.18s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.pew-modal-nav.prev {
    left: max(12px, calc((100vw - 940px) / 2 - 58px));
}

.pew-modal-nav.next {
    right: max(12px, calc((100vw - 940px) / 2 - 58px));
}

.pew-modal-nav:hover {
    background: #5d7686;
    border-color: #466070;
    color: #ffffff;
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Center Magnified Card - FIXED SIZE & SMOOTH POP TRANSITION */
.pew-modal-card {
    position: relative;
    z-index: 5;
    width: 940px;
    height: 640px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 24px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42), 0 4px 16px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9) translateY(12px);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.24s ease;
    box-sizing: border-box;
}

.pew-card-modal.is-active .pew-modal-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Topbar */
.pew-modal-card-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    flex: 0 0 48px;
    padding: 0 16px;
    background: linear-gradient(180deg, #f7fafc 0%, #edf3f8 100%);
    border-bottom: 1px solid rgba(44, 57, 66, 0.14);
    box-sizing: border-box;
}

.pew-modal-badge-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pew-modal-badge {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #3d5667;
    background: rgba(93, 118, 134, 0.14);
    border: 1px solid rgba(93, 118, 134, 0.3);
    border-radius: 9999px;
    padding: 2px 8px;
}

.pew-modal-id {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #2c3942;
}

.pew-modal-counter {
    font-family: 'Inter', sans-serif;
    font-size: 12.5px;
    font-weight: 700;
    color: #2c3942;
    background: rgba(44, 57, 66, 0.08);
    padding: 3px 9px;
    border-radius: 6px;
    border: 1px solid rgba(44, 57, 66, 0.12);
}

.pew-modal-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pew-modal-action-btn,
.pew-modal-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(44, 57, 66, 0.18);
    color: #2c3942;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pew-modal-action-btn:hover,
.pew-modal-close-btn:hover {
    background: #5d7686;
    border-color: #466070;
    color: #ffffff;
}

.pew-modal-action-btn.is-active {
    background: #5d7686;
    border-color: #466070;
    color: #ffffff;
}

/* Card Body: 2 Columns (Image Stage & Details Column) with Slide/Fade Transition */
.pew-modal-card-body {
    display: flex;
    align-items: stretch;
    flex: 1 1 auto;
    height: calc(100% - 48px - 74px);
    min-height: 0;
    overflow: hidden;
    position: relative;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
    box-sizing: border-box;
    will-change: transform, opacity;
}

/* Smooth Slide Transitions for Prev / Next Navigation */
.pew-modal-card-body.slide-out-left {
    transform: translateX(-32px);
    opacity: 0;
    transition: transform 0.12s ease-in, opacity 0.12s ease-in;
}

.pew-modal-card-body.slide-out-right {
    transform: translateX(32px);
    opacity: 0;
    transition: transform 0.12s ease-in, opacity 0.12s ease-in;
}

.pew-modal-card-body.slide-in-right {
    transform: translateX(32px);
    opacity: 0;
    transition: none !important;
}

.pew-modal-card-body.slide-in-left {
    transform: translateX(-32px);
    opacity: 0;
    transition: none !important;
}

/* Left Image Column - FIXED 54% PROPORTION */
.pew-modal-image-col {
    flex: 0 0 54%;
    width: 54%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: radial-gradient(circle at center, #ffffff 40%, #edf3f8 100%);
    border-right: 1px solid rgba(44, 57, 66, 0.12);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.pew-modal-image-viewport {
    flex: 1 1 auto;
    width: 100%;
    height: calc(100% - 44px);
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: zoom-in;
    position: relative;
    border-radius: 8px;
}

.pew-modal-image-viewport.is-zoomed {
    cursor: zoom-out;
}

.pew-modal-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.pew-modal-image-caption {
    font-size: 12px;
    font-weight: 700;
    color: #556c7d;
    margin-top: 8px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 95%;
}

.pew-modal-zoom-hint {
    font-size: 11px;
    color: #7c92a4;
    margin-top: 3px;
    text-align: center;
}

/* Right Details Column - FIXED 46% PROPORTION WITH DEDICATED SCROLL */
.pew-modal-details-col {
    flex: 0 0 46%;
    width: 46%;
    height: 100%;
    padding: 18px 20px;
    background: #ffffff;
    overflow-y: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.pew-modal-details-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pew-modal-meta-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    background: #f7fafc;
    border: 1px solid rgba(44, 57, 66, 0.08);
    border-radius: 6px;
    transition: background 0.12s ease;
}

.pew-modal-meta-row:hover {
    background: #edf3f8;
}

.pew-modal-meta-row .meta-label {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 11.5px;
    font-weight: 700;
    color: #556c7d;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.pew-modal-meta-row .meta-value {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #1a252c;
    text-align: right;
    word-break: break-word;
}

.pew-modal-meta-empty {
    padding: 12px;
    color: #7c92a4;
    text-align: center;
    font-style: italic;
    font-size: 12px;
}

/* Bottom Thumbnail Carousel Strip */
.pew-modal-card-carousel {
    display: flex;
    align-items: center;
    height: 74px;
    flex: 0 0 74px;
    background: linear-gradient(180deg, #f7fafc 0%, #edf3f8 100%);
    border-top: 1px solid rgba(44, 57, 66, 0.14);
    padding: 0 10px;
    box-sizing: border-box;
    gap: 8px;
    position: relative;
    z-index: 10;
}

.pew-carousel-arrow {
    width: 28px;
    height: 52px;
    flex: 0 0 28px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(44, 57, 66, 0.18);
    color: #2c3942;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.pew-carousel-arrow:hover {
    background: #80602e;
    border-color: #5d4421;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pew-carousel-track {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    flex: 1 1 auto;
    height: 100%;
    padding: 6px 2px;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(44, 57, 66, 0.25) transparent;
}

.pew-carousel-track::-webkit-scrollbar {
    height: 4px;
}

.pew-carousel-track::-webkit-scrollbar-thumb {
    background: rgba(44, 57, 66, 0.25);
    border-radius: 4px;
}

.pew-carousel-thumb {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    padding: 2px;
    background: #ffffff;
    border: 2px solid rgba(44, 57, 66, 0.14);
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    opacity: 0.6;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.pew-carousel-thumb:hover {
    opacity: 0.92;
    border-color: #80602e;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.pew-carousel-thumb.is-active {
    opacity: 1;
    border-color: #80602e;
    box-shadow: 0 0 0 2px rgba(128, 96, 46, 0.4), 0 4px 10px rgba(0, 0, 0, 0.18);
    transform: scale(1.06);
}

.pew-carousel-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 3px;
    pointer-events: none;
    user-select: none;
}

/* Mobile & Tablet Responsive Adjustments */
@media screen and (max-width: 768px) {
    .pew-modal-nav.prev {
        left: 8px;
        width: 38px;
        height: 38px;
    }

    .pew-modal-nav.next {
        right: 8px;
        width: 38px;
        height: 38px;
    }

    .pew-modal-card {
        width: calc(100vw - 20px);
        height: min(680px, calc(100vh - 20px));
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 12px;
    }

    .pew-modal-card-body {
        flex-direction: column;
        height: calc(100% - 46px - 64px);
    }

    .pew-modal-card-carousel {
        height: 64px;
        flex: 0 0 64px;
        padding: 0 6px;
        gap: 6px;
    }

    .pew-carousel-arrow {
        width: 24px;
        height: 46px;
        flex: 0 0 24px;
    }

    .pew-carousel-thumb {
        width: 46px;
        height: 46px;
        flex: 0 0 46px;
    }

    .pew-modal-image-col {
        flex: 0 0 48%;
        width: 100%;
        height: 48%;
        border-right: none;
        border-bottom: 1px solid rgba(44, 57, 66, 0.12);
        padding: 10px;
    }

    .pew-modal-img {
        max-height: 100%;
    }

    .pew-modal-details-col {
        flex: 0 0 52%;
        width: 100%;
        height: 52%;
        padding: 12px 14px;
    }
}

