/* assets/styles/archive.css - The Hydro Room High-End Lab Archive */

/* --- Archive Layout: Index & Gallery (Glassmorphism) --- */
.archive-view-container {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: var(--glass-bg);
    /* Match Navigation opacity */
    color: var(--text-color);
    min-height: 100vh;
    backdrop-filter: blur(20px);
    /* Increased blur to match nav/container style */
    transition: background 0.5s ease;
    position: relative;
    overflow-x: hidden;
}

/* 3% Grain / Noise Effect Overlay */
.archive-view-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    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.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    /* 3% Grain intensity requested */
    pointer-events: none;
    z-index: 1;
}

.archive-header,
.archive-index-table,
.archive-gallery-wrapper {
    position: relative;
    z-index: 2;
    /* Bring content above grain */
}


.archive-header {
    padding: 80px var(--space-md) 40px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.archive-title {
    font-size: clamp(32px, 6.4vw, 58px);
    /* Reduced by 20% from (40px, 8vw, 72px) */
    font-weight: 800;
    letter-spacing: -0.05em;
    margin: 0;
    font-family: var(--font-main);
    text-transform: uppercase;
}


/* --- Index View (SR-World Style: Big, Bold, Tight) --- */
.archive-index-table {
    width: 100%;
}

.index-header {
    display: grid;
    grid-template-columns: 6fr 1.5fr 3fr 1.5fr;
    /* 4-column layout weight */
    padding: 8px 40px;
    border-bottom: 1px solid var(--text-color);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}


.index-row {
    display: grid;
    grid-template-columns: 6fr 1.5fr 3fr 1.5fr;
    /* Matches header */
    padding: 16px 40px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    /* Very subtle border */
    cursor: pointer;
    background: transparent;
    transition: all 0.2s ease-in-out;
    align-items: baseline;
    /* Align meta to name's baseline */
}

[data-theme="dark"] .index-row {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

/* Hover: Underline Effect */
.index-row:hover .cell-name {
    text-decoration: underline;
    text-underline-offset: 6px;
    text-decoration-thickness: 1px;
}

.index-row:hover .cell-meta {
    opacity: 1;
}


.index-cell {
    display: flex;
}

.cell-name {
    font-size: 1.25rem;
    /* text-xl (~20px) */
    font-weight: 700;
    letter-spacing: -0.04em;
    /* tracking-tight */
    line-height: 1.2;
    text-transform: uppercase;
}

.cell-meta {
    font-family: var(--font-mono);
    font-size: 12px;
    /* text-xs/sm mix */
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}


/* --- Gallery View (Dynamic Grid) --- */
.archive-gallery-view {
    display: none;
    padding: 40px;
    animation: fadeIn 0.8s ease-out forwards;
}

.archive-gallery-view.active {
    display: block;
}

.gallery-controls {
    display: flex;
    justify-content: flex-start;
    padding: 0 0 40px 0;
}

.back-to-index {
    font-family: var(--font-mono);
    font-size: 11px;
    background: transparent;
    border: 1px solid var(--glass-border);
    padding: 12px 24px;
    cursor: pointer;
    letter-spacing: 0.1em;
    color: var(--text-color);
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.back-to-index:hover {
    background: var(--text-color);
    color: var(--bg-color);
    border-color: var(--text-color);
}

.year-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 768px) {
    .year-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
}

@media (min-width: 1200px) {
    .year-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 40px;
    }
}

.archive-item-minimal {
    position: relative;
    overflow: hidden;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    cursor: zoom-in;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.archive-item-minimal:hover {
    transform: translateY(-12px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1);
}

.archive-img-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.5s ease, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.archive-item-minimal:hover .archive-img-thumb {
    filter: brightness(1.1) saturate(1.1);
    transform: scale(1.08);
}

/* Aspect Ratios */
.grid-item-album {
    aspect-ratio: 1 / 1;
}

.grid-item-poster {
    aspect-ratio: 3 / 4;
}

.grid-item-object {
    aspect-ratio: 16 / 9;
}

.grid-item-default {
    aspect-ratio: 4 / 5;
}

/* --- SR Lightbox (Supreme Glass Immersive) --- */
.archive-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    /* Frosty White */
    z-index: 3000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(50px);
    /* Deep blur */
}

[data-theme="dark"] .archive-lightbox {
    background: rgba(0, 0, 0, 0.85);
    /* Deep Black Glass */
}

.archive-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-main-stage {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 80px;
    cursor: zoom-out;
}

.lightbox-img-main {
    max-height: 70vh;
    max-width: 85%;
    object-fit: contain;
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-img-main.loaded {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: drop-shadow(0 40px 80px rgba(0, 0, 0, 0.15));
}

.lightbox-info {
    position: absolute;
    bottom: 160px;
    right: 60px;
    text-align: right;
    max-width: 480px;
    /* ~max-w-md */
    color: var(--text-color);
    pointer-events: none;
}

[data-theme="dark"] .lightbox-info {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.lightbox-title {
    font-size: 48px;
    /* text-4xl equivalent */
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.05em;
    /* tracking-tighter */
    margin-bottom: 12px;
    font-family: var(--font-main);
    color: var(--text-color);
}

.lightbox-meta {
    font-family: var(--font-mono);
    font-size: 14px;
    /* text-sm */
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.lightbox-desc {
    font-size: 16px;
    /* text-base */
    line-height: 1.7;
    /* leading-relaxed */
    font-weight: 400;
    color: var(--text-color);
    font-family: var(--font-main);
}


.lightbox-record-link {
    margin-top: 24px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    cursor: pointer;
    text-decoration: underline;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.lightbox-record-link:hover {
    opacity: 1;
}

.lightbox-filmstrip {
    height: 130px;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 60px;
    overflow-x: auto;
    border-top: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    scrollbar-width: none;
}

.lightbox-filmstrip::-webkit-scrollbar {
    display: none;
}

.film-thumb {
    height: 90px;
    aspect-ratio: 1;
    flex-shrink: 0;
    cursor: pointer;
    opacity: 0.2;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
}

.film-thumb.active,
.film-thumb:hover {
    opacity: 1;
    transform: translateY(-8px) scale(1.05);
}

.film-thumb.active {
    border-color: var(--text-color);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.film-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lightbox-close {
    position: absolute;
    top: 50px;
    right: 50px;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    z-index: 3010;
    opacity: 0.6;
    transition: opacity 0.3s, transform 0.3s;
}

.lightbox-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}


/* Portable Text Fallback (Cleaned up) */
.archive-detail-view {
    background: var(--bg-color);
    padding: 100px 40px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}