/* ==========================================
   GALLERY STRUCTURE & TYPOGRAPHY
   ========================================== */
.gallery_container {
    max-width: 1400px; /* Wider window layout for immersive visual lookbooks */
    margin: 0 auto;
    padding: 60px 20px;
    font-family: "Red Rose", sans-serif;
}

.gallery_header {
    text-align: center;
    margin-bottom: 60px;
}

.gallery_header .tagline {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: #b5892c;
    display: block;
    margin-bottom: 10px;
}

.gallery_header h2 {
    font-size: 2.8rem;
    font-weight: 800;
    color: #111;
    letter-spacing: -0.03em;
    margin: 0 0 15px 0;
}

.gallery_header p {
    color: #666;
    font-size: 1.05rem;
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ==========================================
   THE MODERN MOSAIC GRID LAYOUT
   ========================================== */
.gallery_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    grid-auto-rows: 280px; /* Establishes baseline modular block heights */
    grid-auto-flow: dense;  /* Automatically packs gaps tightly if tiles shift orders */
    gap: 20px;
    width: 100%;
}

/* Base Frame Structure matching your signature borders */
.gallery_item {
    position: relative;
    background-color: #f4f4f4;
    border: 3px solid #111111;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
}

/* ==========================================
   DYNAMIC ASPECT MODIFIERS (The Mosaic Look)
   ========================================== */
@media screen and (min-width: 768px) {
    /* Spans 2 full columns wide horizontally */
    .gallery_item.grid_wide {
        grid-column: span 2;
    }
    
    /* Spans 2 rows deep vertically */
    .gallery_item.grid_tall {
        grid-row: span 2;
    }
}

/* Layout Image Scaling Core */
.gallery_item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ==========================================
   PREMIUM GLASS-MORPHISM OVERLAY TRANSITION
   ========================================== */
.item_overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to top, 
        rgba(17, 17, 17, 0.85) 0%, 
        rgba(17, 17, 17, 0.2) 60%,
        rgba(17, 17, 17, 0) 100%
    );
    opacity: 0;
    display: flex;
    align-items: flex-end; /* Locks typography alignment to bottom edge */
    padding: 30px;
    box-sizing: border-box;
    transition: opacity 0.4s ease;
}

.overlay_text {
    transform: translateY(15px); /* Hidden offset state */
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.overlay_text h3 {
    color: #ffffff;
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 5px 0;
}

.overlay_text span {
    color: #b5892c; /* Signature gold detail label accent */
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================
   HOVER ENGINE EFFECTS
   ========================================== */
.gallery_item:hover img {
    transform: scale(1.06); /* Expensive-looking slow cinematic zoom */
}

.gallery_item:hover .item_overlay {
    opacity: 1;
}

.gallery_item:hover .overlay_text {
    transform: translateY(0); /* Shifts elements perfectly back into row line */
}

/* ==========================================
   MOBILE FALLBACK (Enforces Single Vertical Rows)
   ========================================== */
@media screen and (max-width: 768px) {
    .gallery_grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 240px; /* Standardize cell framing for mobile sightlines */
        gap: 15px;
    }

    .gallery_item.grid_wide,
    .gallery_item.grid_tall {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }
    
    .gallery_header h2 {
        font-size: 2.2rem;
    }
}