/* ==========================================================================
   Modern Luxury Gallery Section - Premium & Creative Layout
   ========================================================================== */

.modern-gallery-section {
    padding: 100px 0;
    background-color: #f9f9f9; /* Subtle contrast from pure white */
    overflow: hidden;
    position: relative;
}

.gallery-header {
    text-align: center;
    margin-bottom: 70px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.gallery-title-wrapper {
    position: relative;
    display: inline-block;
    padding-bottom: 20px;
}

.gallery-title {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: -1px;
    position: relative;
    z-index: 2;
}

.gallery-title::after {
    content: '';
    position: absolute;
    bottom: 5px;
    right: -20px;
    width: 60px;
    height: 60px;
    background-color: rgba(220, 220, 220, 0.3);
    border-radius: 50%;
    z-index: -1;
}

.gallery-subtitle {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    color: #555;
    line-height: 1.7;
    max-width: 650px;
    margin: 20px auto 0;
    font-weight: 300;
}

/* Creative Masonry Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 300px; /* Base height for standard items */
    gap: 25px;
    padding: 0 60px;
    max-width: 1800px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    /* border-radius: 8px; */ /* Sharp edges for ultra-modern luxury, or slight radius */
    border-radius: 2px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: all 0.5s ease;
}

/* Item Sizing Classes for Masonry */
.gallery-item.large {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-item.wide {
    grid-column: span 2;
    grid-row: span 1;
}

.gallery-item.tall {
    grid-column: span 1;
    grid-row: span 2;
}

/* Image Handling */
.gallery-img-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.2, 1, 0.3, 1);
    filter: brightness(0.95);
}

/* Hover Interaction Overlay */
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 60%, rgba(0,0,0,0) 100%);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.2, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 40px;
    z-index: 10;
}

/* Hover States */
.gallery-item:hover {
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    transform: translateY(-5px);
    z-index: 5;
}

.gallery-item:hover .gallery-img {
    transform: scale(1.08); /* Sophisticated zoom */
    filter: brightness(1);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* Content Within Overlay */
.gallery-content {
    transform: translateY(30px);
    transition: transform 0.6s cubic-bezier(0.2, 1, 0.3, 1);
    transition-delay: 0.1s;
}

.gallery-item:hover .gallery-content {
    transform: translateY(0);
}

.gallery-category {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #e2c17d; /* Muted gold */
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.gallery-name {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: #ffffff;
    margin: 0 0 15px 0;
    line-height: 1.1;
    font-weight: 500;
}

.gallery-link-btn {
    display: inline-flex;
    align-items: center;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.5s ease 0.2s;
}

.gallery-link-btn i {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-link-btn {
    opacity: 1;
    transform: translateX(0);
}

.gallery-link-btn:hover i {
    transform: translateX(5px);
}

/* Button Container */
.gallery-footer {
    text-align: center;
    margin-top: 60px;
}

/* Custom CTA Button */
.btn-gallery-cta {
    display: inline-block;
    padding: 18px 50px;
    background-color: #1a1a1a;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 1px solid #1a1a1a;
    transition: all 0.4s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-gallery-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background-color: #fff;
    transition: width 0.4s ease;
    z-index: -1;
}

.btn-gallery-cta:hover {
    color: #1a1a1a;
}

.btn-gallery-cta:hover::before {
    width: 100%;
}

/* Unique Gallery Design Elements (Optional background patterns) */
.modern-gallery-section::before {
    content: '';
    position: absolute;
    top: 50px;
    left: 0;
    width: 300px;
    height: 600px;
    background: radial-gradient(circle, rgba(0,0,0,0.03) 0%, transparent 70%);
    z-index: 0;
}

/* Responsive Styles */
@media screen and (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        padding: 0 40px;
    }

    .gallery-item.wide { /* Adjust for 3 columns */
        grid-column: span 2;
    }
}

@media screen and (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-item.large, .gallery-item.wide {
        grid-column: span 2;
    }
    
    .gallery-title {
        font-size: 2.8rem;
    }
}

@media screen and (max-width: 600px) {
    .modern-gallery-section {
        padding: 70px 0;
    }

    .gallery-header {
        margin-bottom: 40px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        padding: 0 20px;
        gap: 20px;
    }

    .gallery-item.large, .gallery-item.wide, .gallery-item.tall {
        grid-column: span 1;
        grid-row: span 1;
        height: 350px; /* Force consistent height on mobile */
    }

    .gallery-title {
        font-size: 2.2rem;
    }
    
    .gallery-item:hover .gallery-img {
        transform: scale(1.05); /* Less aggressive zoom on mobile */
    }

    .gallery-overlay {
        opacity: 1; /* Always show overlay text slightly on mobile? Or keep hover behavior? Let's keep hover/tap behavior or make it partly visible */
        background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 60%);
        padding: 25px;
    }
    
    .gallery-content {
        transform: translateY(0);
    }
    
    .gallery-link-btn {
        opacity: 1;
        transform: translateX(0);
    }
}
