/* =========================================
   GALLERY PAGE DUAL-LAYOUT REVAMP
========================================= */

/* --- 1. HERO SECTION (DUAL DESIGN) --- */
.gal-hero-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #000;
}

/* LAPTOP HERO DESIGN (Split Screen with Floating Photos) */
@media (min-width: 992px) {
    .gal-hero-wrapper {
        height: 70vh;
        display: flex;
        align-items: center;
        padding: 0 5%;
        background: linear-gradient(135deg, #0b1a4a, #1a2b66);
    }
    .gal-hero-bg {
        display: none; /* Hide background image for clean split look */
    }
    .gal-hero-content {
        flex: 1;
        z-index: 10;
        padding-right: 50px;
    }
    .gal-hero-title {
        font-size: 4rem;
        font-weight: 900;
        color: white;
        line-height: 1.1;
        margin-bottom: 20px;
        opacity: 0;
        animation: slideInUpGal 1s forwards;
    }
    .gal-hero-title span { color: #f75023; }
    .gal-hero-subtitle {
        font-size: 1.1rem;
        color: #eee;
        line-height: 1.7;
        margin-bottom: 30px;
        max-width: 500px;
        opacity: 0;
        animation: slideInUpGal 1s 0.2s forwards;
    }
    .gal-breadcrumbs {
        display: inline-block;
        background: rgba(255,255,255,0.1);
        padding: 8px 20px;
        border-radius: 30px;
        color: white;
        opacity: 0;
        animation: slideInUpGal 1s 0.4s forwards;
    }
    .gal-breadcrumbs a { color: #f75023; text-decoration: none; }
    
    @keyframes slideInUpGal {
        from { opacity: 0; transform: translateY(30px); }
        to { opacity: 1; transform: translateY(0); }
    }
    
    /* Right Side 3D Photo Stack */
    .gal-hero-visual {
        flex: 1;
        height: 100%;
        position: relative;
        perspective: 1200px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .gal-photo-stack {
        position: relative;
        width: 350px; height: 250px;
        transform-style: preserve-3d;
        animation: rotateStack 20s infinite linear;
        right: 50px;
    }
    .gal-photo-stack img {
        position: absolute;
        width: 100%; height: 100%;
        object-fit: cover;
        border-radius: 15px;
        border: 5px solid white;
        box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    }
    .gal-photo-stack img:nth-child(1) { transform: translateZ(50px) rotate(-10deg); }
    .gal-photo-stack img:nth-child(2) { transform: translateZ(0px) rotate(5deg); }
    .gal-photo-stack img:nth-child(3) { transform: translateZ(-50px) rotate(20deg); }

    @keyframes rotateStack {
        0% { transform: rotateY(0deg) rotateX(10deg); }
        100% { transform: rotateY(360deg) rotateX(10deg); }
    }
}

/* MOBILE HERO DESIGN (Immersive Full Screen) */
@media (max-width: 991px) {
    .gal-hero-wrapper {
        height: 60vh;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
    .gal-hero-bg {
        position: absolute;
        inset: 0;
        background-size: cover;
        background-position: center;
        animation: zoomMobile 20s infinite alternate;
        opacity: 0.6;
    }
    .gal-hero-overlay {
        position: absolute;
        inset: 0;
        background: linear-gradient(to top, #0b1a4a, rgba(11,26,74,0.4));
    }
    .gal-hero-content {
        position: relative;
        z-index: 10;
        padding: 0 20px;
    }
    .gal-hero-visual { display: none; } /* Hide 3D stack on mobile */
    .gal-hero-title {
        font-size: 2.8rem;
        font-weight: 800;
        color: white;
        margin-bottom: 15px;
    }
    .gal-hero-title span { color: #f75023; }
    .gal-hero-subtitle {
        font-size: 1rem;
        color: #eee;
        margin-bottom: 25px;
    }
    .gal-breadcrumbs {
        display: inline-block;
        background: rgba(247, 80, 35, 0.2);
        padding: 5px 15px;
        border-radius: 20px;
        color: white;
        border: 1px solid rgba(247, 80, 35, 0.5);
    }
    .gal-breadcrumbs a { color: white; text-decoration: none; font-weight: bold; }
    @keyframes zoomMobile {
        0% { transform: scale(1); }
        100% { transform: scale(1.2); }
    }
}


/* --- 2. GALLERY GRID (DUAL DESIGN) --- */
.gal-main-section {
    background: #f8f9fa;
    padding: 80px 0;
}

/* Tabs */
.gal-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
}
.gal-tab {
    background: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    color: #0b1a4a;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.3s;
}
.gal-tab.active, .gal-tab:hover {
    background: #f75023;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(247, 80, 35, 0.2);
}

/* LAPTOP GALLERY DESIGN (Masonry Hover Grid) */
@media (min-width: 992px) {
    .gal-layout {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 300px; /* Base height */
        gap: 20px;
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 30px;
    }
    /* Create Masonry varying heights */
    .gal-item:nth-child(1) { grid-row: span 2; }
    .gal-item:nth-child(4) { grid-row: span 2; }
    .gal-item:nth-child(7) { grid-row: span 2; }

    .gal-item {
        position: relative;
        border-radius: 15px;
        overflow: hidden;
        display: block;
    }
    .gal-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    .gal-overlay {
        position: absolute;
        inset: 0;
        background: rgba(11, 26, 74, 0.8);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        opacity: 0;
        transition: opacity 0.4s;
        text-align: center;
        padding: 20px;
        color: white;
    }
    .gal-item:hover .gal-img { transform: scale(1.1); }
    .gal-item:hover .gal-overlay { opacity: 1; }
    
    .gal-overlay h3 {
        font-size: 1.5rem;
        font-weight: 700;
        margin-bottom: 10px;
        transform: translateY(20px);
        transition: transform 0.4s;
    }
    .gal-overlay span {
        background: #f75023;
        padding: 5px 15px;
        border-radius: 20px;
        font-size: 0.85rem;
        font-weight: 600;
        transform: translateY(20px);
        transition: transform 0.4s 0.1s;
    }
    .gal-overlay i {
        font-size: 2.5rem;
        margin-bottom: 15px;
        color: rgba(255,255,255,0.5);
        transform: translateY(20px);
        transition: transform 0.4s 0.2s;
    }
    .gal-item:hover .gal-overlay h3,
    .gal-item:hover .gal-overlay span,
    .gal-item:hover .gal-overlay i {
        transform: translateY(0);
    }
}

/* MOBILE GALLERY DESIGN (App-Style Vertical Feed) */
@media (max-width: 991px) {
    .gal-main-section {
        padding: 0 0 50px 0;
        background: #f0f2f5; /* App style background */
    }
    /* Sticky Tabs for Mobile */
    .gal-tabs {
        position: sticky;
        top: 0;
        z-index: 100;
        background: white;
        padding: 15px;
        margin-bottom: 0;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        border-bottom: 1px solid #eee;
        display: flex;
        justify-content: center;
        gap: 10px;
    }
    .gal-tab {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .gal-layout {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px;
    }
    .gal-item {
        background: white;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        display: block;
        position: relative;
    }
    .gal-img {
        width: 100%;
        height: 150px;
        object-fit: cover;
        display: block;
    }
    .gal-overlay {
        position: absolute;
        inset: 0;
        background: rgba(11, 26, 74, 0.4);
        display: flex;
        justify-content: center;
        align-items: center;
        opacity: 0;
        pointer-events: none;
    }
    .gal-overlay i {
        color: white;
        font-size: 2rem;
    }
    .gal-item:active .gal-overlay {
        opacity: 1;
    }
    .gal-overlay h3, .gal-overlay span {
        display: none;
    }
}
