/* ==========================================================================
   Gallery Section (Our Expertise) CSS - Custom Agency
   ========================================================================== */

/* Visibility wrappers for Desktop vs Mobile */
.gallery-desktop-view {
    display: none;
    width: 100%;
    height: 100%;
    position: relative;
}

.gallery-mobile-view {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
}

@media (min-width: 768px) {
    .gallery-desktop-view {
        display: block;
    }
    .gallery-mobile-view {
        display: none !important;
    }
}

.gallery-page4 {
    position: relative;
    height: 100vh;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #2b2825;
    transition: background-color 0.3s ease;
}

.gallery-page4 .gallery-background {
    position: absolute;
    width: min(90vw, 42rem);
    height: 20rem;
    border-radius: 2.5rem;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.gallery-page4 .gallery-background2 {
    position: absolute;
    width: calc(100% - 2rem);
    height: calc(100% - 2rem);
    border-radius: 2.5rem;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 100%);
    overflow: hidden;
    z-index: 3;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.gallery-background img,
.gallery-background2 img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.15);
    transition: transform 0.8s ease;
}

/* Top text over image */
.gallery-topText {
    position: absolute;
    width: 100%;
    top: 2.5rem;
    left: 0;
    color: #f4efe7;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0 3rem;
    z-index: 20;
    opacity: 1 !important;
}

.gallery-topText h4 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: #f4efe7;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8);
    margin: 0;
}

@media (min-width: 1024px) {
    .gallery-topText h4 {
        font-size: 3.5rem;
    }
}

.gallery-topText h3 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(244, 239, 231, 0.95);
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8);
    margin: 0.5rem 0 0 0;
}

@media (min-width: 1024px) {
    .gallery-topText h3 {
        font-size: 1.2rem;
    }
}

/* Bottom text over image */
.gallery-bottomText {
    position: absolute;
    width: 100%;
    bottom: 2.5rem;
    left: 0;
    color: #f4efe7;
    display: flex;
    flex-direction: column;
    padding: 0 3rem;
    z-index: 20;
    opacity: 1 !important;
}

.gallery-bottomText-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
}

.gallery-bottomText-desc {
    font-size: 1rem;
    line-height: 1.6;
    color: #eae5dd;
    max-width: 36rem;
    font-weight: 400;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    margin: 0;
}

@media (min-width: 1024px) {
    .gallery-bottomText-desc {
        font-size: 1.125rem;
    }
}

.gallery-explore-btn {
    background-color: #f4efe7;
    color: #181717;
    padding: 0.65rem 1.5rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.gallery-explore-btn:hover {
    background-color: #b1a696;
    color: #181717;
}

.gallery-progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.gallery-progress-text {
    font-size: 10px;
    font-weight: 700;
    color: #b1a696;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.gallery-progress-bar {
    position: relative;
    z-index: 10;
    flex: 1;
    max-width: 18rem;
    height: 3px;
    background-color: #4f4b48;
    border-radius: 9999px;
    overflow: hidden;
}

.gallery-progress-fill {
    height: 100%;
    background-color: #f4efe7;
    transition: width 0.3s ease;
}

/* Mobile Specific Styles (< 768px) */
@media (max-width: 767px) {
    .gallery-page4 {
        height: auto;
        min-height: 0;
        background-color: #181717;
        display: block;
        padding: 0.5rem;
    }

    .gallery-mobile-card {
        position: relative;
        width: 100%;
        border-radius: 1rem;
        overflow: hidden;
        border: 1px solid rgba(177, 166, 150, 0.2);
        background-color: rgba(42, 39, 37, 0.6);
        transition: all 0.3s ease;
        cursor: pointer;
    }

    .gallery-mobile-card.is-active {
        border-color: #f4efe7;
        background-color: #2a2725;
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    }

    .gallery-mobile-card .gallery-mobile-card-active {
        display: none;
    }

    .gallery-mobile-card.is-active .gallery-mobile-card-active {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        position: relative;
        width: 100%;
        min-height: 260px;
        padding: 1rem;
        color: #f4efe7;
    }

    .gallery-mobile-card .gallery-mobile-card-collapsed {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.875rem;
        color: #f4efe7;
    }

    .gallery-mobile-card.is-active .gallery-mobile-card-collapsed {
        display: none;
    }

    .gallery-mobile-bg {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        opacity: 0.35;
        z-index: 0;
    }

    .gallery-mobile-overlay {
        position: absolute;
        inset: 0;
        background: linear-gradient(to top, #181717 0%, rgba(24, 23, 23, 0.7) 50%, transparent 100%);
        z-index: 0;
    }

    .gallery-mobile-top {
        position: relative;
        z-index: 10;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid rgba(177, 166, 150, 0.2);
        padding-bottom: 0.625rem;
    }

    .gallery-mobile-num {
        font-size: 10px;
        font-weight: 700;
        color: #b1a696;
        letter-spacing: 0.1em;
        text-transform: uppercase;
    }

    .gallery-mobile-badge {
        font-size: 10px;
        background-color: #f4efe7;
        color: #181717;
        padding: 2px 8px;
        border-radius: 9999px;
        font-weight: 700;
    }

    .gallery-mobile-body {
        position: relative;
        z-index: 10;
        margin: 0.75rem 0;
    }

    .gallery-mobile-body h3 {
        font-size: 1.125rem;
        font-weight: 700;
        color: #f4efe7;
        line-height: 1.375;
    }

    .gallery-mobile-body p {
        font-size: 0.75rem;
        color: #eae5dd;
        margin-top: 0.375rem;
        line-height: 1.5;
        font-weight: 500;
    }

    .gallery-mobile-bottom {
        position: relative;
        z-index: 10;
        padding-top: 0.625rem;
        border-top: 1px solid rgba(177, 166, 150, 0.2);
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
    }

    .gallery-mobile-progress {
        display: flex;
        flex-direction: column;
        gap: 4px;
        width: 50%;
    }

    .gallery-mobile-prog-text {
        font-size: 9px;
        color: #b1a696;
        font-weight: 700;
    }

    .gallery-mobile-prog-bar {
        width: 100%;
        height: 4px;
        background-color: #4f4b48;
        border-radius: 9999px;
        overflow: hidden;
    }

    .gallery-mobile-prog-fill {
        background-color: #f4efe7;
        height: 100%;
        transition: all 0.5s ease;
    }

    .gallery-mobile-collapsed-info {
        display: flex;
        align-items: center;
        gap: 0.625rem;
    }

    .gallery-mobile-collapsed-info h4 {
        font-size: 0.875rem;
        font-weight: 700;
        color: #f4efe7;
    }

    .gallery-mobile-tap {
        font-size: 10px;
        color: #b1a696;
        border: 1px solid rgba(177, 166, 150, 0.3);
        padding: 2px 8px;
        border-radius: 9999px;
        font-weight: 500;
    }

    /* Scroll Reveal Animation (Mobile Only) */
    .gallery-mobile-card {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, background-color 0.3s ease;
    }

    .gallery-mobile-card.is-revealed,
    .gallery-mobile-card.is-active {
        opacity: 1;
        transform: translateY(0);
    }

    /* Responsive Explore Button in Mobile Cards */
    .gallery-mobile-explore-btn {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.35rem !important;
        padding: 0.375rem 0.85rem !important;
        border-radius: 9999px !important;
        font-size: 0.75rem !important;
        font-weight: 700 !important;
        background-color: #f4efe7 !important;
        color: #181717 !important;
        text-decoration: none !important;
        transition: background-color 0.2s ease, transform 0.2s ease !important;
    }

    .gallery-mobile-explore-btn svg {
        width: 1rem !important;
        height: 1rem !important;
        flex-shrink: 0 !important;
    }
}
