/* -----------------------------------------------------------------------------
   INSPIRE TRAVELS & TOURS - GALLERY & MODAL COMPONENTS
   -----------------------------------------------------------------------------

   Author: Zig Zag AI
   Description: Photo gallery lightbox captions, tour modal card, and custom scrollbars
   Purpose: Groups every popup and overlay related style together
   Loaded directly by pages that use galleries or modals

   Table of Contents:
    1. PhotoSwipe Gallery Captions
    2. Custom Scrollbar
    3. Tour Modal Card
    4. Hidden Scrollbar Utility
    5. Responsive Adjustments

   -----------------------------------------------------------------------------
*/

/* Gallery Modal Styling */
.pswp__caption {
    display: none !important;
}

/* Premium Custom Scrollbar for Modal Highlights (visible on scroll and hover) */
.custom-scrollbar::-webkit-scrollbar {
    width: 5px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 10px;
}

.custom-scrollbar.is-scrolling::-webkit-scrollbar-thumb,
.custom-scrollbar:hover::-webkit-scrollbar-thumb {
    background: rgba(12, 60, 58, 0.22);
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(12, 60, 58, 0.42);
}

/* iOS-inspired Premium Fixed Height Glass Panel for Modal Card */
.tour-modal-card {
    position: relative;
    height: 540px;
    width: 100%;
    max-width: 448px;
    /* matches max-w-md */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.82));
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 2.25rem;
    /* Clean iOS pill corner squircle */
    box-shadow: 0 35px 70px -15px rgba(0, 0, 0, 0.25),
        inset 1.5px 1.5px 0px rgba(255, 255, 255, 0.85);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.tour-modal-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    -webkit-backdrop-filter: blur(25px);
    backdrop-filter: blur(25px);
    filter: url(#container-glass);
    z-index: -2;
}

/* Hide scrollbars for smooth mobile/tablet touch tracks */
.no-scrollbar::-webkit-scrollbar {
    display: none !important;
}

.no-scrollbar {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

@media (max-width: 375px) {
    /* Tour modal — fill almost full screen on small phones */
    .tour-modal-card {
        width: 96vw !important;
        max-width: 96vw !important;
        max-height: 90vh !important;
        padding: 1.25rem !important;
    }
}
@media (max-width: 320px) {
    /* Tour modal — essentially full screen */
    .tour-modal-card {
        width: 99vw !important;
        max-width: 99vw !important;
        max-height: 92vh !important;
        padding: 1rem !important;
        border-radius: 1rem !important;
    }
}

/* -----------------------------------------------------------------------------
   UNIVERSAL LUXURY GALLERY CANVAS & PINTEREST CARD ARCHITECTURE
   ----------------------------------------------------------------------------- */

.secondary-gallery-canvas {
    position: relative;
    isolation: isolate;
    color: var(--secondary-paper-ink, #13261d);
    /* Rich warm paper canvas matching reviews showcase with golden yellow, amber, sage & teal radiance */
    background:
        radial-gradient(circle at 12% 16%, rgba(234, 192, 120, 0.14), transparent 36rem),
        radial-gradient(circle at 88% 82%, rgba(110, 150, 130, 0.10), transparent 38rem),
        radial-gradient(circle at 82% 14%, rgba(65, 145, 139, 0.08), transparent 32rem),
        radial-gradient(circle at 20% 80%, rgba(220, 175, 105, 0.10), transparent 34rem),
        radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.94), transparent 44rem),
        linear-gradient(155deg, #fbf9f4 0%, #f7f4ec 40%, #f4efe5 70%, #f8f5ee 100%) !important;
}

/* Layer 1: Enhanced Grid Texture & Topo Contours */
.secondary-gallery-canvas::before {
    position: absolute;
    z-index: 0;
    inset: 0;
    content: "";
    pointer-events: none;
    opacity: 0.68;
    background-image:
        linear-gradient(rgba(19, 38, 29, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(19, 38, 29, 0.055) 1px, transparent 1px),
        repeating-radial-gradient(ellipse at 12% 20%, transparent 0 3.7rem, rgba(29, 79, 55, 0.065) 3.74rem 3.8rem, transparent 3.84rem 7.2rem),
        repeating-radial-gradient(ellipse at 86% 68%, transparent 0 4.8rem, rgba(154, 101, 30, 0.06) 4.84rem 4.9rem, transparent 4.94rem 9.4rem);
    background-size: 6rem 6rem, 6rem 6rem, 82rem 68rem, 94rem 78rem;
    mask-image: linear-gradient(180deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
}

/* Layer 2: Tactile Fine Paper Grain & Spores */
.secondary-gallery-canvas::after {
    position: absolute;
    z-index: 0;
    inset: 0;
    content: "";
    pointer-events: none;
    opacity: 0.18;
    background-image:
        radial-gradient(rgba(19, 38, 29, 0.22) 0.035rem, transparent 0.045rem),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.025'/%3E%3C/svg%3E");
    background-size: 0.35rem 0.35rem, 160px 160px;
    mix-blend-mode: multiply;
}

.gallery-archive-item > .gallery-archive-frame,
.secondary-gallery-canvas .gallery-archive-item > .gallery-archive-frame {
    isolation: isolate;
    border: 1.5px solid rgba(255, 252, 240, 0.9) !important;
    border-radius: clamp(1.15rem, 1.6vw, 1.85rem) !important;
    background: #dce3d6;
    box-shadow: 0 0.9rem 2.4rem rgba(19, 60, 45, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04), inset 0 1.5px rgba(255, 255, 255, 0.85) !important;
    transition: transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 420ms ease;
}

.gallery-archive-frame::after {
    position: absolute;
    inset: 0;
    content: "";
    opacity: 0;
    background: linear-gradient(180deg, transparent 38%, rgba(6, 24, 16, 0.85));
    transition: opacity 320ms ease;
}

.gallery-archive-caption {
    position: absolute;
    z-index: 2;
    right: 1.35rem;
    bottom: 1.25rem;
    left: 1.35rem;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 0.35rem 1rem;
    color: #fffdf5;
    opacity: 0;
    transform: translateY(0.65rem);
    transition: opacity 320ms ease, transform 320ms ease;
}

.gallery-archive-caption span {
    font-family: var(--font-mono, monospace);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #eab05b;
}

.gallery-archive-caption h3 {
    grid-column: 1;
    margin: 0;
    font-family: var(--font-display, serif);
    font-size: clamp(1.3rem, 2vw, 1.75rem);
    font-weight: 480;
    line-height: 1.08;
    color: #fffdf5;
}

.gallery-archive-caption i {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: end;
    font-size: 1.45rem;
    color: #f4eedb;
}

@media (hover: hover) and (pointer: fine) {
    .gallery-archive-item:hover .gallery-archive-frame {
        box-shadow: 0 1.8rem 3.5rem rgba(19, 60, 45, 0.22), inset 0 1px rgba(255, 255, 255, 0.95) !important;
        transform: translateY(-0.45rem) scale(1.015);
    }
    .gallery-archive-item:hover .gallery-archive-frame::after,
    .gallery-archive-item:hover .gallery-archive-caption {
        opacity: 1;
    }
    .gallery-archive-item:hover .gallery-archive-caption {
        transform: translateY(0);
    }
}

@media (hover: none) or (pointer: coarse) {
    .gallery-archive-frame::after {
        opacity: 0.88;
    }
    .gallery-archive-caption {
        opacity: 1;
        transform: translateY(0);
    }
}
