/* ... existing overrides ... */

/* REEL BUTTON OVERRIDES */
.drawer-reel {
    background-color: rgba(255, 255, 255, 0.1) !important;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex !important; /* Force show even on desktop */
}

.drawer-reel:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: #fff;
}

.card-drawer .drawer-share + .drawer-share {
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

@media (min-width: 768px) {
    .drawer-reel {
        border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
}

/* ========================================
   GALLERY WALL - "DIGITAL ARCHIVE" STYLE
   ======================================== */
.deep-dive-gallery-card {
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    justify-content: flex-start !important;
    padding-top: 64px !important; /* Space for top bar */
    padding-bottom: 24px !important;
    box-sizing: border-box;
    overflow: hidden; /* Prevent spillover affecting scroll snap */
}

.deep-dive-gallery-card .deep-dive-card-label {
    padding-left: 24px;
    margin-bottom: 12px;
    flex-shrink: 0; /* Never shrink label */
}

.gallery-actions {
    padding: 0 24px;
    margin-bottom: 16px !important;
    flex-shrink: 0; /* Never shrink button */
}

.gallery-wall {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr); /* Force 3 equal rows */
    gap: 2px;
    width: 100%;
    flex: 1; /* Take up all remaining vertical space */
    min-height: 0; /* Allow shrinking */
    padding: 2px;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .gallery-wall {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(2, 1fr); /* 2 rows on desktop */
        max-width: 1000px;
        margin: 0 auto;
        gap: 4px;
        padding: 4px;
    }
}

/* Gallery Item Container */
.gallery-item {
    position: relative;
    width: 100%;
    height: 100%; /* Fill the grid cell */
    overflow: hidden;
    background: #111;
    cursor: pointer;
    transition: all 0.3s ease;
    /* Removed aspect-ratio to allow flex-grid resizing */
}

/* The Image - Base "Archive" State */
.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) contrast(1.1) brightness(0.8);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0.9;
}

/* Noise Overlay (Pseudo-element) */
.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.15'/%3E%3C/svg%3E");
    opacity: 0.3;
    pointer-events: none;
    mix-blend-mode: overlay;
    transition: opacity 0.3s ease;
}

/* Interaction: Active State (Tapped/Hovered) - Restore Color */
.gallery-item:hover .gallery-image,
.gallery-item.active .gallery-image {
    filter: grayscale(0%) contrast(1.05) brightness(1.0);
    opacity: 1;
}

.gallery-item:hover::after,
.gallery-item.active::after {
    opacity: 0.05; /* Reduce noise when viewing */
}

/* Metadata Caption - Hidden by default, reveals on interaction */
.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 20px 12px 12px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    pointer-events: none;
}

.gallery-item:hover .gallery-caption,
.gallery-item.active .gallery-caption {
    transform: translateY(0);
}

.gallery-title {
    font-family: var(--font-display, 'Courier New', monospace);
    font-size: 10px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 2px;
    line-height: 1.3;
    text-shadow: 0 1px 2px black;
}

.gallery-source {
    font-family: var(--font-body, sans-serif);
    font-size: 9px;
    color: var(--accent-glow, #00ffff);
    opacity: 0.8;
}

/* ========================================
   INFOGRAPHIC CARD OVERRIDES
   ======================================== */
.deep-dive-image-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start !important; /* Top align to respect label */
    padding-top: 80px !important; /* Ensure spacing from top UI */
}

.deep-dive-image-card .deep-dive-card-label {
    position: static !important; /* Remove absolute positioning */
    align-self: flex-start;
    padding-left: 24px;
    margin-bottom: 24px;
}

.deep-dive-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0 24px;
    box-sizing: border-box;
}

.deep-dive-image {
    max-height: 75vh; /* Keep it safe */
    object-fit: contain;
    width: 100%;
}

/* ========================================
   MICRO-LEARNING TEXT STYLES
   ======================================== */
   
/* Icon List (Clean, minimal, vertical) */
.icon-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.icon-list li {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
}

.icon-list i {
    font-size: 20px;
    color: var(--accent-glow);
    margin-top: 3px;
    flex-shrink: 0;
}

/* Bold text emphasis */
.icon-list strong, 
.deep-dive-card-content strong {
    color: #fff;
    font-weight: 600;
}

/* Text Highlight Interaction */
.deep-dive-card-content p,
.deep-dive-card-content li {
    cursor: pointer;
    transition: background-color 0.2s ease, border-left 0.2s ease;
    padding: 8px 0;
    border-left: 2px solid transparent;
}

.deep-dive-card-content p:hover, 
.deep-dive-card-content li:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.deep-dive-card-content p.highlighted,
.deep-dive-card-content li.highlighted {
    background-color: rgba(0, 255, 255, 0.08);
    border-left: 2px solid var(--accent-glow);
    padding-left: 12px;
}
