/* --- Timeframe Banner Styles (Futuristic / Antigravity) --- */
/* v2: Theme Compatibility Updates */

#timeframe-banner-section {
    position: relative;
    width: 100%;
    margin-top: 5rem;
    /* Increased spacing */
    margin-bottom: 5rem;
    padding: 0;
    /* Full bleed */
    z-index: 10;
}

/* Wrapper - Use transparent/glass base instead of black */
.timeframe-banner-wrapper {
    width: 100%;
    height: 460px;
    /* Increased from 400px to fix cropping */
    position: relative;
    overflow: hidden;

    /* Theme Compatibility: Glass Surface matching existing site */
    background: var(--glass-surface, rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    /* Soft borders to blend */
    border-top: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
    border-bottom: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));

    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

@media (min-width: 1200px) {
    .timeframe-banner-wrapper {
        height: 520px;
        /* Cinematic height on desktop */
    }
}

@media (max-width: 768px) {
    .timeframe-banner-wrapper {
        height: 500px;
        /* Increased to fit 420px cards + padding */
    }

    #timeframe-banner-section {
        margin-top: 2rem;
        margin-bottom: 2rem;
    }
}

/* Slider Stage */
.tf-slider-stage {
    width: 100%;
    height: 100%;
    position: relative;
}

.tf-slide-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.tf-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transform: scale(1.15);
    /* Subtle zoom start */
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1),
        transform 8s ease-out;
    /* Slower, smoother zoom */
    z-index: 1;
}

.tf-slide.active {
    opacity: 1;
    transform: scale(1);
    z-index: 2;
}

/* Overlay - Adjusted for Saffron compatibility */
.tf-overlay-glass {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Gradient adapted to blend with saffron/dark theme */
    background: linear-gradient(90deg,
            rgba(46, 21, 3, 0.8) 0%,
            /* Match header dark brown */
            rgba(46, 21, 3, 0.4) 40%,
            transparent 100%);
    z-index: 3;
    pointer-events: none;
}

/* Content Layer */
.tf-content-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Left align */
}

/* Glass Title Box - Premium Look */
.tf-title-box {
    margin-left: 8%;
    /* Cinematic indent */
    background: rgba(255, 255, 255, 0.03);
    /* Lighter touch */
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 2.5rem 3.5rem;
    border-radius: 20px;
    /* Modern radius */
    max-width: 650px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);

    opacity: 0;
    animation: tf-box-fade-in 1s ease forwards 0.5s;
}

/* --- Marquee / Moving Collage Styles --- */
.tf-marquee-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    background: transparent;
    /* Mask for fade edges */
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.tf-marquee-wrapper:hover .tf-marquee-track {
    animation-play-state: paused;
}

.tf-marquee-track {
    display: flex;
    gap: 15px;
    /* Spacing between tiles */
    animation: tf-scroll 40s linear infinite;
    width: max-content;
    /* Ensure it stretches */
    will-change: transform;
    padding-bottom: 40px;
    /* Add breathing room for hover shadows/transforms to prevent clipping at bottom container edge */
}

/* --- Folder Collage Card Styles --- */
.tf-folder-card {
    height: 400px;
    width: 300px;
    background: rgba(30, 10, 0, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* Explicit gap between collage and footer */
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
    /* Critical for padding calculation */
}


.tf-folder-card:hover {
    transform: translateY(-8px);
    border-color: #ff9100;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.tf-mini-collage {
    flex: 1;
    min-height: 0;
    /* Allow shrinking */
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 4px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0;
}

.tf-mini-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    background: rgba(255, 255, 255, 0.1);
}

/* Specific Collage Layouts */
.tf-folder-card.layout-3 .tf-mini-thumb:first-child {
    grid-row: span 2;
    height: 100%;
}

.tf-folder-card:hover .tf-mini-thumb {
    transform: scale(1.1);
}

.tf-card-footer {
    position: absolute;
    /* Force it to overlay at the bottom */
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    min-height: 80px;
    /* Ensure enough touch area and visual weight */

    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Align text to bottom */

    padding: 15px;
    /* Comfortable padding */
    padding-bottom: 40px;
    /* SIGNIFICANTLY increased to lift text up */

    background: linear-gradient(to top, rgba(10, 5, 0, 1.0) 0%, rgba(10, 5, 0, 0.7) 70%, transparent 100%);
    z-index: 20;
    /* High z-index to sit on top of images */
    border-top: none;
    /* Remove border as it's an overlay now */
}

.tf-card-title {
    color: #ffffff !important;
    font-family: 'Outfit', sans-serif;
    font-size: 1.0rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.35;
    /* Increased line height */
    white-space: normal;
    /* Force wrap */
    overflow: visible;
    /* Show all text */
    text-overflow: clip;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
    display: block;
    /* Removed webkit-box to allow standard flow */
}

.tf-card-subtitle {
    font-size: 0.85rem;
    color: #ffffff !important;
    /* Force White */
    opacity: 0.9;
    margin: 6px 0 0;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    /* Shadow for contrast */
}

/* --- Modal Close Button Fix --- */
.tf-close-btn {
    position: fixed;
    /* Force fixed positioning relative to viewport */
    top: 20px;
    right: 5%;
    /* Match header padding */
    background: rgba(200, 0, 0, 0.8) !important;
    /* Solid Red-ish */
    border: 2px solid white !important;
    color: white !important;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 999999;
    /* Super high Z-index */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.tf-close-btn:hover {
    background: #ff0000 !important;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 20px #ff0000;
}

/* Duplicates removed */

.tf-card-overlay-hint {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 16px;
}

.tf-folder-card:hover .tf-card-overlay-hint {
    opacity: 1;
}

.tf-btn-view {
    padding: 8px 20px;
    background: var(--accent-color);
    color: white;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.tf-folder-card:hover .tf-btn-view {
    transform: translateY(0);
}

/* Mobile Adjustments */
/* Mobile Adjustments */
/* Mobile Adjustments - LIST VIEW */
/* Mobile Adjustments - MARQUEE RESTORED */
/* Mobile Adjustments - MARQUEE & GALLERY LIST */
@media (max-width: 768px) {

    /* --- Banner Marquee Fix --- */
    .timeframe-banner-wrapper {
        height: 480px;
    }

    /* Force Horizontal Scroll */
    .tf-marquee-track {
        display: flex !important;
        flex-direction: row !important;
        animation-play-state: running !important;
        transform: none;
        /* Let animation handle it */
    }

    /* Standard Mobile Card */
    .tf-folder-card {
        height: 420px;
        width: 290px;
        flex-direction: column;
        gap: 0;
        padding: 10px;
        background: rgba(30, 10, 0, 0.7);
    }

    .tf-mini-collage {
        width: 100%;
        height: auto;
        flex: 1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
        gap: 4px;
        border-radius: 12px;
    }

    .tf-mini-thumb {
        display: block;
    }

    .tf-card-footer {
        padding: 10px;
        min-height: 80px;
        justify-content: flex-start;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        text-align: center;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    }

    .tf-card-title {
        font-size: 0.95rem;
        text-align: left;
    }

    .tf-card-subtitle {
        display: block;
        font-size: 0.8rem;
        margin-top: 4px;
        text-align: left;
    }

    .tf-btn-view {
        display: block;
    }

    /* --- Gallery Modal Vertical List --- */
    /* Reinforced List View for Mobile */
    .tf-gallery-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        width: 90% !important;
        margin: 1rem auto !important;
        align-items: stretch !important;
    }

    .tf-gallery-item {
        width: 100% !important;
        height: auto !important;
        min-height: 250px !important;
        /* Ensure visibility */
        aspect-ratio: 16/9 !important;
        /* Cinematic Ratio */
        border-radius: 15px !important;

        /* Reset any grid residue */
        grid-column: auto !important;
        grid-row: auto !important;
        flex-shrink: 0 !important;
    }

    .tf-gallery-item img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
}

@keyframes tf-scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
        /* Move half way (since we duplicate content) */
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .tf-marquee-item {
        height: 220px;
        width: 160px;
    }

    .tf-marquee-item.wide {
        width: 260px;
    }
}

/* --- Section Navigation Strip --- */
.tf-section-title {
    color: var(--text-dark, #ffffff);
    font-family: 'Outfit',
        sans-serif;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.1;
    margin: 0;
    letter-spacing: -0.5px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .tf-title-box {
        margin: 0 1rem;
        padding: 1.5rem;
        width: 100%;
    }

    .tf-section-title {
        font-size: 1.8rem;
    }

    .tf-content-layer {
        justify-content: center;
        /* Center on mobile */
    }
}

/* Progress Bar */
.tf-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    /* Thicker for visibility */
    background: rgba(255, 255, 255, 0.05);
}

.tf-progress-fill {
    height: 100%;
    background: var(--accent-color, #ff9100);
    /* Use Orange Accent */
    box-shadow: 0 0 15px var(--accent-color, #ff9100);
    width: 0%;
}

/* --- Section Navigation Strip --- */
.tf-nav-strip {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 50;
    max-width: 95%;
    overflow-x: auto;
    padding: 10px;
    /* Glass Strip */
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Hide scrollbar on strip */
.tf-nav-strip::-webkit-scrollbar {
    display: none;
}

.tf-nav-item {
    min-width: 100px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    color: white;
    white-space: nowrap;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.tf-nav-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.tf-nav-item.active {
    background: var(--primary-color, #26d0ce);
    color: #000;
    /* Contrast */
    font-weight: 700;
    box-shadow: 0 0 10px var(--primary-color, #26d0ce);
}

/* --- Gallery Modal (Interactive) --- */
#tf-gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Theme Matching Background */
    background: radial-gradient(circle at 10% 20%, rgba(74, 37, 17, 0.98) 0%, rgba(74, 37, 17, 0.95) 50%),
        radial-gradient(circle at 90% 80%, rgba(139, 64, 0, 0.98) 0%, rgba(139, 64, 0, 0.95) 50%),
        #2e1503;
    z-index: 9999;
    display: none;
    /* Hidden by default */
    /* Fix scrolling: Use block display or flex-start alignment */
    align-items: flex-start;
    justify-content: flex-start;
    /* Construct from top */
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.4s ease;
    overflow-y: auto;
    /* Enable Modal Scroll */
    padding-top: 100px;
    /* Space for fixed header */
    padding-bottom: 50px;
}

#tf-gallery-modal.active {
    display: flex;
    opacity: 1;
}

.tf-modal-header {
    position: fixed;
    /* Fixed header */
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    /* Explicit height */
    background: rgba(46, 21, 3, 0.95);
    backdrop-filter: blur(15px);
    z-index: 10000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    /* Ensure Header consumes clicks */
    pointer-events: auto;
}

.tf-modal-title {
    color: #ff9100;
    /* Saffron */
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    /* Requested size */
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* --- Modal Close Button Fix (Authoritative) --- */
.tf-close-btn {
    /* Flex position inside header */
    position: relative;
    background: rgba(255, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10002;
    margin-left: auto;
    /* Push to right if in flex container */
}

.tf-close-btn:hover {
    background: #ff0000;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 15px #ff0000;
    border-color: white;
}

/* Bento / Collage Grid */
.tf-gallery-grid {
    width: 90%;
    max-width: 1400px;
    /* Removed padding-top since parent has padding */
    margin-bottom: 3rem;
    display: grid;
    /* Responsive Bento Grid */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: 250px;
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Scrollbar for modal */
#tf-gallery-modal::-webkit-scrollbar {
    width: 10px;
}

#tf-gallery-modal::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

#tf-gallery-modal::-webkit-scrollbar-thumb {
    background: var(--primary-color, #26d0ce);
    border-radius: 5px;
}

.tf-gallery-item {
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    /* Glass card */
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Bento Spans for "Collage" feel - Randomly applied by JS or nth-child */
.tf-gallery-item:nth-child(5n+1) {
    grid-column: span 2;
    grid-row: span 2;
}

.tf-gallery-item:nth-child(7n+3) {
    grid-row: span 2;
}

.tf-gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: var(--primary-color, #26d0ce);
    z-index: 2;
}

.tf-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.tf-gallery-item:hover img {
    transform: scale(1.1);
}

/* --- Internal Lightbox (Zoom View) --- */
#tf-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10001;
    /* Above Modal */
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

#tf-lightbox.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

#tf-lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#tf-lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.8;
}

#tf-lightbox-close:hover {
    opacity: 1;
    color: var(--accent-color);
}