/* ============================================ */
/* GALLERY DISPLAY - HERO GALLERY STYLE        */
/* Desktop: Horizontal spread with zoom        */
/* Mobile: Swipeable card deck                 */
/* ============================================ */

.gallery {
    padding: 60px 0 40px;
    background: var(--bg-light-parchment);
    min-height: auto;
    overflow: hidden;
}

.gallery .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.gallery h2 {
    text-align: center;
    margin-bottom: 8px;
    color: var(--brand-brown-dark);
    font-size: 2.2rem;
}

.gallery .section-subtitle {
    text-align: center;
    color: var(--brand-brown-medium);
    margin-bottom: 40px;
    font-size: 1rem;
}

/* ============================================ */
/* DESKTOP: HERO GALLERY STYLE                 */
/* Horizontal spread of 5-7 maps               */
/* ============================================ */

@media (min-width: 769px) {
    .maps-gallery-container {
        position: relative;
        width: 100%;
        height: 500px;
        display: flex;
        justify-content: center;
        align-items: center;
        perspective: 1000px;
        overflow: visible;
        padding: 80px 40px;
        margin-bottom: 40px;
    }
    
    /* Individual map cards */
    .gallery-map-card {
        position: absolute;
        background: var(--bg-parchment);
        border: 3px solid rgba(139, 69, 19, 0.3);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
        border-radius: 8px;
        overflow: hidden;
        cursor: zoom-in;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        will-change: transform;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
    
    /* Aspect ratios based on data-orientation */
    .gallery-map-card[data-orientation="portrait"] {
        width: 250px;
        height: 354px; /* 250 * 1.414 */
    }
    
    .gallery-map-card[data-orientation="landscape"] {
        width: 354px; /* 250 * 1.414 */
        height: 250px;
    }
    
    .gallery-map-card[data-orientation="square"] {
        width: 250px;
        height: 250px;
    }
    
    /* Hover effects */
    .gallery-map-card:hover {
        transform: scale(1.08) rotate(0deg) !important;
        box-shadow: 0 15px 40px rgba(139, 69, 19, 0.3);
        z-index: 999 !important;
        border-color: rgba(139, 69, 19, 0.5);
    }
    
    /* Images */
    .gallery-map-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        filter: sepia(0.05) contrast(1.05);
        transition: transform 0.2s ease, filter 0.3s ease;
        user-select: none;
        -webkit-user-select: none;
        -webkit-user-drag: none;
    }
    
    .gallery-map-card:hover img {
        filter: sepia(0) contrast(1.1);
    }
    
    /* Amazon-style zoom */
    .gallery-map-card img.zooming {
        cursor: crosshair;
        transform-origin: center center;
        transform: scale(2.5);
        transition: none;
    }
    
    /* Shuffle button */
    .gallery-shuffle-btn {
        display: block;
        margin: 0 auto;
        padding: 12px 35px;
        background: var(--brand-brown-medium);
        color: white;
        border: none;
        border-radius: 30px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(139, 69, 19, 0.2);
    }
    
    .gallery-shuffle-btn:hover {
        background: var(--brand-brown-dark);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(139, 69, 19, 0.3);
    }
    
    .gallery-shuffle-btn i {
        margin-right: 8px;
    }
}

/* ============================================ */
/* MOBILE: CARD DECK STYLE                     */
/* Swipeable cards (existing system)           */
/* ============================================ */

@media (max-width: 768px) {
    .maps-gallery-container {
        display: none; /* Hide desktop gallery on mobile */
    }
    
    /* Card deck container */
    .card-deck-container {
        position: relative;
        width: 90%;
        max-width: 400px;
        margin: 0 auto 20px;
    }
    
    .card-stack {
        position: relative;
        width: 100%;
        min-height: 300px;
        touch-action: pan-y;
    }
    
    .deck-card {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: auto;
        background: white;
        border-radius: 16px;
        box-shadow: 0 10px 40px rgba(139, 69, 19, 0.15);
        overflow: hidden;
        transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
        user-select: none;
        backface-visibility: hidden;
    }
    
    .deck-card[data-position="0"] {
        z-index: 30;
        transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
    }
    
    .deck-card[data-position="1"] {
        z-index: 20;
        transform: translate3d(-8px, 10px, 0) scale(0.96) rotate(-2.5deg);
        pointer-events: none;
    }
    
    .deck-card[data-position="2"] {
        display: none;
    }
    
    .deck-card-image {
        width: 100%;
        height: auto;
        display: block;
        padding: 20px;
        background: var(--bg-parchment);
    }
    
    .deck-card-image img {
        width: 100%;
        height: auto;
        display: block;
        user-select: none;
        -webkit-user-drag: none;
    }
    
    /* Mobile info */
    .deck-info {
        text-align: center;
        margin-top: 20px;
    }
    
    .deck-title {
        font-size: 1.15rem;
        color: var(--brand-brown-dark);
        margin-bottom: 8px;
        font-weight: 600;
    }
    
    .deck-counter {
        font-size: 0.85rem;
        color: var(--brand-brown-medium);
    }
    
    /* Mobile shuffle button */
    .gallery-shuffle-btn {
        display: block;
        margin: 30px auto 0;
        padding: 10px 30px;
        background: var(--brand-brown-medium);
        color: white;
        border: none;
        border-radius: 30px;
        font-size: 0.95rem;
        font-weight: 600;
        cursor: pointer;
    }
}