/**
 * Module: Gallery Page Styles
 * Purpose: Specific styles for before/after gallery page (template-gallery.php)
 * Inputs: design-tokens.css, base.css, components.css, geo-page.css
 * Outputs: Page-specific styles for gallery template
 * Notes: Based on Figma design (file iHRdHsiPhWToSxUaedGtxF, node 80-2029)
 *         Reuses breadcrumbs and title styles from geo-page.css
 */

/* ==========================================================================
   1. PAGE HEADER (additional styles for gallery)
   ========================================================================== */

.vc-gallery-header {
    margin-bottom: 3rem;
}

.vc-gallery-subtitle {
    margin: 0 0 var(--vc-space-12);
    margin-top: -0.5rem; /* Pull subtitle closer to title on desktop */
    font-size: var(--vc-font-size-body);
    color: var(--vc-color-text-muted);
    line-height: var(--vc-line-height-relaxed);
    max-width: 800px;
}

/* ==========================================================================
   2. GALLERY SECTION
   ========================================================================== */

.vc-gallery-section {
    margin-bottom: 3rem;
}

.vc-gallery-section:last-child {
    margin-bottom: 0;
}

.vc-gallery-section__title {
    font-weight: var(--vc-font-weight-semibold);
    font-size: var(--vc-font-size-h3);
    line-height: 1.25;
    color: var(--vc-color-text-primary);
    margin: 0 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--vc-color-primary-light);
}

/* ==========================================================================
   3. GALLERY GRID
   ========================================================================== */

.vc-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    align-items: stretch;
}

/* ==========================================================================
   4. GALLERY CARD
   ========================================================================== */

.vc-gallery-card {
    background: var(--vc-color-bg-primary);
    border-radius: var(--vc-radius-lg);
    overflow: hidden;
    box-shadow: var(--vc-shadow-sm);
    transition: box-shadow var(--vc-transition-fast), transform var(--vc-transition-fast);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.vc-gallery-card:hover {
    box-shadow: var(--vc-shadow-md);
    transform: translateY(-2px);
}

/* Before/After Slider Container */
/* Higher specificity to override city-hub.css styles */
/* Using .image-compare class for maximum specificity (0,4,0) */
.vc-city-hub .vc-gallery-card .vc-ba.image-compare {
    position: relative;
    width: 100%;
    height: 220px;
    min-height: 220px;
    overflow: hidden;
    cursor: ew-resize;
    border-radius: var(--vc-radius-md);
}

.vc-city-hub .vc-gallery-card .vc-ba.image-compare .vc-ba__after-image {
    position: relative;
    display: block;
    width: 100%;
    height: 220px;
    z-index: 1;
}

.vc-city-hub .vc-gallery-card .vc-ba.image-compare .vc-ba__after-image img {
    width: 100%;
    height: 220px;
    display: block;
    user-select: none;
    object-fit: cover;
}

.vc-city-hub .vc-gallery-card .vc-ba.image-compare .vc-ba__before-image {
    position: absolute;
    height: 220px;
    width: 50%;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: 3;
}

.vc-city-hub .vc-gallery-card .vc-ba.image-compare .vc-ba__before-image img {
    height: 220px;
    width: auto;
    object-fit: cover;
    object-position: left center;
    display: block;
    user-select: none;
}

/* Resizer Handle - white line with arrow icon (matching city-hub.css style) */
.vc-city-hub .vc-gallery-card .vc-ba.image-compare .vc-ba__resizer {
    position: absolute;
    display: flex;
    align-items: center;
    z-index: 5;
    top: 0;
    left: 50%;
    height: 100%;
    width: 4px;
    background: var(--vc-color-bg-primary);
    cursor: ew-resize;
    touch-action: pan-y;
}

.vc-city-hub .vc-gallery-card .vc-ba.image-compare .vc-ba__resizer::after {
    content: '';
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    margin: 0 0 0 -14px;
    width: 30px;
    height: 30px;
    border-radius: var(--vc-radius-circle);
    border: 1px solid var(--vc-color-border-primary-medium);
    background-color: var(--vc-color-bg-primary);
    background-image: url('/wp-content/themes/vcleaning-child/assets/css/../img/icon/arrow-right.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 15px 15px;
}

/* Expand Icon - with drop shadow for visibility on light backgrounds */
.vc-city-hub .vc-gallery-card .vc-ba.image-compare .vc-ba__expand-icon {
    position: absolute;
    bottom: var(--vc-space-2);
    right: var(--vc-space-2);
    cursor: pointer;
    z-index: 10;
    transition: opacity var(--vc-transition-fast), transform var(--vc-transition-fast);
    pointer-events: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.vc-city-hub .vc-gallery-card .vc-ba.image-compare .vc-ba__expand-icon:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

/* Card Content - matching vc-services__ba-title and vc-services__ba-text styles */
.vc-gallery-card__title {
    font-size: var(--vc-font-size-h6);
    font-weight: var(--vc-font-weight-semibold);
    color: var(--vc-color-text-primary);
    margin: var(--vc-space-3) var(--vc-space-4) var(--vc-space-2);
}

.vc-gallery-card__text {
    font-size: 13px;
    line-height: var(--vc-line-height-relaxed);
    color: var(--vc-color-text-muted);
    margin: 0 var(--vc-space-4) var(--vc-space-4);
    flex-grow: 1;
}

/* ==========================================================================
   5. RESPONSIVE STYLES
   ========================================================================== */

@media (max-width: 1024px) {
    .vc-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .vc-geo-page {
        padding: 2rem 0 2rem;
    }

    .vc-gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Add top margin to H2 section titles on mobile */
    .vc-gallery-section__title {
        font-size: var(--vc-font-size-h4);
        margin-top: 2rem;
    }

    .vc-gallery-header {
        margin-top: 1rem;
        margin-bottom: 2rem;
    }

    /* Reset subtitle negative margin on mobile */
    .vc-gallery-subtitle {
        margin-top: 0;
    }

    /* Ensure burger menu button is clickable */
    .vc-city-hub .vc-header__burger {
        pointer-events: auto;
        z-index: 100;
    }

    /* Hide burger button when menu is open (show only close button) */
    .vc-city-hub .vc-header--menu-open .vc-header__burger {
        display: none;
    }
}
