/*
Theme Name: Historias Cursed Library (V4.1 - 3D Fix)
Version: 4.1
*/

:root {
    --bg-dark: #0f0f0f;
    --polaroid-white: #f0f0f0;
    --postit-yellow: #fff740;
    --ink-black: #1a1a1a;
    --tape-color: rgba(255, 255, 255, 0.4);
    --font-hand: 'Courier Prime', monospace;
    --font-heading: 'Cinzel', serif;

    /* VHS Dimensions */
    --vhs-width: 260px;
    --vhs-height: 420px;
    /* Box aspect ratio */
    --vhs-depth: 50px;
}

body {
    background-color: var(--bg-dark);
    color: #ccc;
    font-family: var(--font-hand);
    background-image: url('https://www.transparenttextures.com/patterns/dark-matter.png');
    overflow-x: hidden;
    /* Prevent 3D spill */
}

.container {
    max-width: 1200px;
    /* Wider for 3D rotation space */
    margin: 0 auto;
    padding: 20px;
}

/* --- 3D SCENE SETUP --- */
.case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 80px;
    padding: 50px 20px;
    perspective: 1000px;
    /* CRITICAL for 3D */
}

.case-wrapper {
    width: 100%;
    height: 400px;
    position: relative;
    transform-style: preserve-3d;
    /* CRITICAL */
    transition: transform 0.5s ease;
}

/* =========================================
   GENERIC 3D SCENE UTILS
   ========================================= */
.scene-3d-box {
    position: relative;
    transform-style: preserve-3d;
    width: 100%;
    height: 100%;
}

.face {
    position: absolute;
    box-sizing: border-box;
    backface-visibility: hidden;
    /* Optional: hide inside faces if needed, but for solid mostly show */
    /* backface-visibility: visible; */
}

/* =========================================
   TYPE 1: POLAROID (Remains roughly same but refined)
   ========================================= */
.polaroid-group {
    position: relative;
    transform-style: preserve-3d;
    width: 280px;
    margin: 0 auto;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.case-wrapper:hover .polaroid-group {
    transform: rotateY(15deg) rotateX(10deg) scale(1.1);
    z-index: 100;
}

.polaroid {
    background: #fff;
    padding: 15px 15px 60px 15px;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.5);
    transform: rotate(var(--rotation));
}

.polaroid img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    filter: sepia(0.3) contrast(1.2);
    border: 1px solid #ccc;
}

.post-it {
    background: #fff740;
    color: #1a1a1a;
    width: 200px;
    padding: 10px;
    position: absolute;
    bottom: -20px;
    left: 20px;
    box-shadow: 2px 4px 6px rgba(0, 0, 0, 0.3);
    font-family: 'Permanent Marker', cursive;
    transform: translateZ(20px) rotate(-3deg);
    font-size: 1.1rem;
}

/* =========================================
   TYPE 2: MANILA FOLDER (Video Log)
   ========================================= */
.folder-group {
    width: 320px;
    height: 240px;
    margin: 40px auto;
    perspective: 1000px;
    position: relative;
    cursor: pointer;
}

.folder-dims {
    transform: rotateX(10deg);
    transition: transform 0.5s ease;
    transform-style: preserve-3d;
}

.folder-group:hover .folder-dims {
    transform: rotateX(-5deg) translateY(-10px);
}

.folder-back {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #c3a168;
    /* Deep Manila */
    border-radius: 5px;
    transform: translateZ(-2px);
    box-shadow: 2px 5px 15px rgba(0, 0, 0, 0.5);
    border: 1px solid #a08050;
}

/* The tab on back */
.folder-back::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    width: 120px;
    height: 20px;
    background: #c3a168;
    border-radius: 5px 5px 0 0;
    border: 1px solid #a08050;
    border-bottom: none;
}

.folder-front {
    position: absolute;
    width: 100%;
    height: 95%;
    top: 5%;
    background: #e8d0a9;
    /* Lighter Manila Front */
    border-radius: 0 0 5px 5px;
    transform: rotateX(-5deg);
    /* Slightly Open */
    transform-origin: bottom;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
    border: 1px solid #c0a070;
    display: flex;
    align-items: center;
    justify-content: center;
}

.folder-tab {
    position: absolute;
    top: 20px;
    right: 20px;
    border: 2px solid #a00;
    color: #a00;
    padding: 2px 8px;
    font-size: 1rem;
    font-family: 'Black Ops One';
    transform: rotate(10deg);
    opacity: 0.8;
}

.folder-paper {
    position: absolute;
    width: 90%;
    height: 90%;
    left: 5%;
    top: 0;
    background: white;
    transform: translateZ(-1px) rotate(2deg);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

/* =========================================
   TYPE 5: CONFIDENTIAL ENVELOPE (Legends)
   ========================================= */
.envelope-group {
    width: 320px;
    height: 220px;
    margin: 60px auto;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    cursor: pointer;
}

.case-wrapper:hover .envelope-group {
    transform: rotate(0deg) scale(1.05) !important;
}

.envelope-dims {
    transform: rotateX(10deg);
}

.envelope-body {
    width: 100%;
    height: 100%;
    background: #b69b7d;
    /* Darker Real Envelope Color */
    position: absolute;
    transform: translateZ(5px);
    border: 1px solid #8f785e;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* String Closure Mechanism */
.cereal-string-closure {
    position: absolute;
    right: 20px;
    top: 40%;
    width: 40px;
    height: 60px;
}

.string-circle {
    width: 14px;
    height: 14px;
    background: #8b4513;
    border-radius: 50%;
    position: absolute;
    left: 10px;
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    border: 1px solid #5e2f0d;
}

.string-circle.top {
    top: 5px;
}

.string-circle.bottom {
    bottom: 5px;
}

.string-line {
    position: absolute;
    top: 12px;
    left: 16px;
    width: 2px;
    height: 35px;
    background: #fff;
    transform: rotate(15deg);
    opacity: 0.7;
    box-shadow: 1px 0 1px rgba(0, 0, 0, 0.3);
}

.envelope-flap {
    width: 100%;
    height: 45%;
    background: #a88d70;
    /* Slightly darker flap */
    clip-path: polygon(0 0, 50% 100%, 100% 0);
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top;
    transform: rotateX(5deg);
    border-top: 1px solid #8f785e;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

.envelope-address {
    font-family: 'Courier Prime';
    color: #222;
    text-align: center;
    background: rgba(255, 255, 255, 0.7);
    padding: 10px 20px;
    border: 1px solid #999;
    width: 70%;
    transform: rotate(-1deg);
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.envelope-address span {
    display: block;
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: #555;
    margin-bottom: 5px;
}

.envelope-address .highlight {
    font-weight: bold;
    font-size: 1.2rem;
    color: #000;
}

.envelope-address .highlight {
    font-weight: bold;
    font-size: 1.1em;
}

/* =========================================
   GENERIC ADJUSTMENTS & FOLDER FIXES
   ========================================= */

/* Folder Label - Smaller & Centered */
.folder-label-text {
    font-family: 'Courier Prime', monospace;
    font-size: 1rem;
    /* Smaller */
    color: #333;
    text-align: center;
    border-bottom: 2px dotted #999;
    padding: 5px;
    margin: 10px auto;
    width: 80%;
    display: block;
    line-height: 1.2;
}

/* Facetted Search Bar */
.archive-header {
    text-align: center;
    padding: 20px;
    margin-bottom: 20px;
    background: #111;
    border-bottom: 1px solid #333;
}

.archive-title {
    font-family: 'Black Ops One';
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.facetted-search .search-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.facetted-search input,
.facetted-search select {
    background: #222;
    border: 1px solid #444;
    color: #fff;
    padding: 10px;
    font-family: 'Courier Prime';
}

.facetted-search button {
    background: #d00;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-family: 'Black Ops One';
    cursor: pointer;
    transition: background 0.3s;
}

.facetted-search button:hover {
    background: #f00;
}

/* =========================================
   RESPONSIVE / MOBILE STYLES
   ========================================= */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    /* Grid becomes 1 column but items aren't huge */
    .case-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    /* Scale down all 3D objects to fit mobile screen nicely */
    .case-wrapper {
        height: 300px;
        /* Reduced height */
        transform: scale(0.8);
        /* Shrink everything 20% */
        margin-bottom: -50px;
        /* Reduce gap caused by scaling */
    }

    /* Simplify Search Bar */
    .facetted-search .search-row {
        flex-direction: column;
        align-items: stretch;
    }

    .archive-title {
        font-size: 1.8rem;
    }

    /* Adjust specific items if needed */
    .folder-group,
    .envelope-group,
    .vhs-tape-naked,
    .floppy-group {
        margin: 20px auto;
    }

    .post-it,
    .post-it-small {
        transform: translateZ(50px) rotate(0deg) !important;
        /* Flatten for readability */
        position: relative;
        bottom: auto;
        right: auto;
        left: auto;
        margin: 10px auto;
    }
}

/* =========================================
   TYPE 3: MP3 RECORDER (Updated: Less Rotation)
   ========================================= */
.mp3-recorder {
    width: 140px;
    height: 320px;
    margin: 20px auto;
    perspective: 1000px;
}

.mp3-dims {
    /* More frontal view as requested */
    transform: rotateY(-10deg) rotateX(5deg);
    transition: transform 0.6s ease;
}

.mp3-recorder:hover .mp3-dims {
    transform: rotateY(0deg) rotateX(0deg) scale(1.05);
    /* Subtle zoom */
}

/* Re-asserting mp3 dimensions */
.mp3-face-front,
.mp3-face-back {
    width: 140px;
    height: 320px;
}

.mp3-face-side {
    width: 30px;
    height: 320px;
}

.mp3-face-top {
    width: 140px;
    height: 30px;
}

.mp3-face-front {
    transform: translateZ(15px);
    background: linear-gradient(145deg, #dce1e6, #adb5bd);
    border: 1px solid #999;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 10px;
}

.mp3-face-back {
    transform: rotateY(180deg) translateZ(15px);
    background: #999;
}

.mp3-face-right {
    transform: rotateY(90deg) translateZ(70px);
    background: #888;
}

.mp3-face-left {
    transform: rotateY(-90deg) translateZ(70px);
    background: #888;
}

.mp3-face-top {
    transform: rotateX(90deg) translateZ(160px);
    background: #888;
}

.mp3-face-bottom {
    transform: rotateX(-90deg) translateZ(160px);
    background: #888;
}


/* =========================================
   TYPE 4: FLOPPY DISK (Updated Labels)
   ========================================= */
.floppy-group {
    width: 240px;
    height: 240px;
    margin: 60px auto;
    perspective: 1000px;
}

.floppy-dims {
    transform: rotateX(15deg) rotateY(-10deg);
    transition: transform 0.6s ease;
}

.floppy-group:hover .floppy-dims {
    transform: rotateX(0deg) rotateY(0deg) scale(1.1);
}

/* Re-asserting floppy faces */
.floppy-face-front,
.floppy-face-back {
    width: 240px;
    height: 240px;
}

.floppy-face-side {
    width: 16px;
    height: 240px;
}

.floppy-face-top {
    width: 240px;
    height: 16px;
}

.floppy-face-front {
    transform: translateZ(8px);
    background: #333;
    border: 1px solid #222;
    border-radius: 4px;
}

.floppy-face-back {
    transform: rotateY(180deg) translateZ(8px);
    background: #222;
}

.floppy-face-right {
    transform: rotateY(90deg) translateZ(120px);
    background: #1a1a1a;
}

.floppy-face-left {
    transform: rotateY(-90deg) translateZ(120px);
    background: #1a1a1a;
}

.floppy-face-top {
    transform: rotateX(90deg) translateZ(120px);
    background: #1a1a1a;
}

.floppy-face-bottom {
    transform: rotateX(-90deg) translateZ(120px);
    background: #1a1a1a;
}

/* =========================================
   UNIVERSAL POST-IT STYLES
   ========================================= */
.post-it {
    background: #fff740;
    /* Yellow */
    color: #1a1a1a;
    width: 180px;
    padding: 10px;
    position: absolute;
    bottom: 20px;
    right: 20px;
    /* Standardize position */
    box-shadow: 2px 4px 6px rgba(0, 0, 0, 0.3);
    font-family: 'Permanent Marker', cursive;
    transform: translateZ(30px) rotate(-3deg);
    /* Pop out */
    font-size: 1rem;
    z-index: 50;
    clip-path: polygon(0% 0%, 100% 0%, 100% 90%, 90% 100%, 0% 100%);
}

/* Smaller Post-it for small items like MP3/Floppy to avoid hiding object */
.post-it-small {
    background: #fff740;
    color: #1a1a1a;
    width: 140px;
    padding: 5px;
    position: absolute;
    bottom: -20px;
    right: -20px;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-family: 'Permanent Marker', cursive;
    transform: translateZ(50px) rotate(2deg);
    font-size: 0.8rem;
    z-index: 50;
}

/* Ensure links inside post-it don't break structure (h3, p) */
.post-it h3,
.post-it-small h3 {
    margin: 0;
    font-size: inherit;
}

.post-it p {
    margin: 5px 0 0 0;
    font-size: 0.8em;
    opacity: 0.8;
}


.case-wrapper:hover .polaroid-group {
    transform: rotateY(15deg) rotateX(10deg) scale(1.1);
    z-index: 100;
}

.polaroid {
    background: #fff;
    padding: 15px 15px 60px 15px;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.5);
    transform: rotate(var(--rotation));
}

.polaroid img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    filter: sepia(0.3) contrast(1.2);
    border: 1px solid #ccc;
}

.post-it {
    background: #fff740;
    color: #1a1a1a;
    width: 200px;
    padding: 10px;
    position: absolute;
    bottom: -20px;
    left: 20px;
    box-shadow: 2px 4px 6px rgba(0, 0, 0, 0.3);
    font-family: 'Permanent Marker', cursive;
    transform: translateZ(20px) rotate(-3deg);
    font-size: 1.1rem;
}

/* =========================================
   TYPE 2: NAKED VHS TAPE
   ========================================= */
.vhs-tape-naked {
    width: 300px;
    height: 180px;
    /* Landscape aspect ratio of real tape */
    margin: 80px auto;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    transform: rotateX(40deg) rotateZ(-10deg);
}

.case-wrapper:hover .vhs-tape-naked {
    transform: rotateX(0deg) rotateZ(0deg) scale(1.1);
}

.tape-body {
    width: 100%;
    height: 100%;
    background: #111;
    border-radius: 10px;
    transform: translateZ(12px);
    /* Half thickness */
    /* Physical Tape Texture */
    background: repeating-linear-gradient(90deg, #1a1a1a 0px, #111 2px, #1a1a1a 4px);
    box-shadow:
        0 15px 20px rgba(0, 0, 0, 0.6),
        inset 0 0 10px #000;
    border: 1px solid #333;
}

/* Side Thickness (Pseudo-3D) */
.tape-body::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 25px;
    /* Thickness */
    background: #080808;
    transform-origin: top;
    transform: rotateX(-90deg);
    border-radius: 0 0 5px 5px;
}

.tape-body::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 25px;
    /* Thickness */
    height: 100%;
    background: #080808;
    transform-origin: right;
    transform: rotateY(90deg);
}

.tape-label-area {
    width: 80%;
    height: 60px;
    background: #eee;
    margin: 15px auto 10px;
    border-radius: 4px;
    padding: 10px;
    font-family: 'Courier Prime';
    text-align: center;
    border: 1px solid #ccc;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.tape-title {
    font-weight: bold;
    font-size: 1.1rem;
    color: #000;
    line-height: 1.1;
    margin-bottom: 5px;
}

.tape-sub {
    font-size: 0.7rem;
    color: #cc0000;
    letter-spacing: 1px;
}

.tape-windows {
    display: flex;
    justify-content: space-between;
    padding: 0 40px;
    align-items: center;
}

.spool {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #fff;
    /* White spool hubs */
    border: 8px solid #333;
    box-shadow: inset 0 0 5px #000;
}

.window-glass {
    width: 80px;
    height: 40px;
    background: rgba(50, 50, 50, 0.5);
    /* Semi-transparent window */
    border-radius: 5px;
    border: 1px solid #333;
}

/* =========================================
   TYPE 3: MP3 DIGITAL RECORDER
   ========================================= */
.mp3-recorder {
    width: 140px;
    height: 320px;
    /* Tall thin device */
    margin: 20px auto;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    transform: rotateY(-20deg) rotateX(10deg);
}

.case-wrapper:hover .mp3-recorder {
    transform: rotateY(0deg) rotateX(0deg) scale(1.1);
}

.recorder-body {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #dce1e6, #adb5bd);
    /* Silver Metallic */
    border-radius: 15px;
    box-shadow:
        5px 5px 15px rgba(0, 0, 0, 0.5),
        inset 2px 2px 5px rgba(255, 255, 255, 0.8);
    transform: translateZ(15px);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 10px;
    border: 1px solid #999;
}

/* Thickness */
.recorder-body::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 100%;
    background: #888;
    transform-origin: right;
    transform: rotateY(90deg);
    border-radius: 0 5px 5px 0;
}

.recorder-screen {
    width: 100px;
    height: 80px;
    background: #90cea9;
    /* LCD Green */
    border: 4px solid #333;
    border-radius: 4px;
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.3);
    padding: 5px;
    font-family: 'Courier Prime';
    /* Use Monospace for digital look */
    overflow: hidden;
    margin-bottom: 20px;
}

.screen-text {
    font-size: 0.7rem;
    color: #111;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recorder-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.btn.rec {
    background: #d00000;
    border: 2px solid #500;
}

.btn.play {
    background: #333;
    border: 2px solid #000;
}

.btn.stop {
    background: #333;
    border: 2px solid #000;
}

.recorder-speaker {
    width: 80px;
    height: 80px;
    background: radial-gradient(#666 15%, transparent 16%);
    background-size: 8px 8px;
    /* Perforated texture */
    border-radius: 50%;
    border: 1px solid #bbb;
}

.recorder-label {
    margin-top: 15px;
    background: #fff;
    padding: 5px;
    width: 90%;
    font-size: 0.7rem;
    text-align: center;
    border: 1px solid #ccc;
    font-family: Arial, sans-serif;
    transform: rotate(-2deg);
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* =========================================
   TYPE 4: FLOPPY DISK (DEEP 3D)
   ========================================= */
.floppy-group {
    width: 240px;
    height: 240px;
    margin: 60px auto;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    transform: rotateX(25deg) rotateY(-15deg);
}

.case-wrapper:hover .floppy-group {
    transform: rotateX(0deg) rotateY(0deg) scale(1.1);
}

.floppy-disk {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
}

.floppy-front {
    width: 240px;
    height: 240px;
    background: #333;
    /* Dark Grey Plastic */
    position: absolute;
    transform: translateZ(8px);
    /* Front Face */
    border-radius: 4px;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.1);
}

/* Thickness Sides */
.floppy-front::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 16px;
    /* Fat Thickness */
    background: #1a1a1a;
    transform-origin: top;
    transform: rotateX(-90deg);
}

.floppy-front::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 16px;
    height: 100%;
    background: #1a1a1a;
    transform-origin: right;
    transform: rotateY(90deg);
}

.shutter {
    width: 160px;
    height: 60px;
    background: linear-gradient(180deg, #dcdcdc 0%, #ffffff 50%, #dcdcdc 100%);
    /* Silver */
    position: absolute;
    top: 0;
    left: 40px;
    border-radius: 0 0 4px 4px;
    box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.4);
}

.floppy-label {
    width: 180px;
    height: 120px;
    background: #000080;
    /* Navy Blue */
    position: absolute;
    bottom: 20px;
    left: 30px;
    color: #fff;
    padding: 15px;
    font-family: 'Courier Prime';
    font-size: 1rem;
    font-weight: bold;
    border-top: 6px solid #fff;
    border-radius: 2px;
    text-shadow: 1px 1px 0 #000;
    line-height: 1.2;
    overflow: hidden;
}

/* =========================================
   TYPE 5: OLD BOOK (DEEP 3D)
   ========================================= */
.book-group {
    width: 220px;
    height: 320px;
    margin: 30px auto;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    transform: rotateY(-35deg);
}

.case-wrapper:hover .book-group {
    transform: rotateY(-20deg) translateZ(20px);
}

.book-cover-front {
    width: 220px;
    height: 320px;
    background: #550000;
    /* Deep Red */
    position: absolute;
    transform: translateZ(25px);
    /* Thick book */
    border: 4px solid #cfaa48;
    /* Gold Border */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-shadow: inset 0 0 30px #220000;
}

.book-title-gold {
    color: #cfaa48;
    font-family: var(--font-heading);
    font-size: 1.4rem;
    text-align: center;
    text-shadow: 2px 2px 4px #000;
    border: 2px solid #cfaa48;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
}

.book-spine {
    width: 50px;
    height: 320px;
    background: #330000;
    position: absolute;
    left: 0;
    transform: rotateY(-90deg) translateZ(25px);
    /* Half width of spine needs to match translateZ of covers technically, or adjusted */
    background: linear-gradient(90deg, #200, #500, #200);
}

.book-cover-back {
    width: 220px;
    height: 320px;
    background: #550000;
    position: absolute;
    transform: translateZ(-25px) rotateY(180deg);
    border: 4px solid #cfaa48;
}

.book-pages-block {
    width: 210px;
    height: 310px;
    background: repeating-linear-gradient(90deg, #fff 0px, #ddd 1px, #fff 2px);
    position: absolute;
    top: 5px;
    left: 5px;
    transform: rotateY(-90deg) translateZ(23px) translateX(100px);
    /* This positioning is tricky in pure CSS without a container, adjusting to be "inside" */
    width: 50px;
    /* Thickness of pages */
    height: 310px;
    transform: translateX(215px) rotateY(90deg) translateZ(0);
    /* Right side pages */
    /* Actually simpler: just make a block */
}

/* Correction for pages Visualization */
.book-group::after {
    content: '';
    position: absolute;
    right: 0;
    top: 5px;
    width: 48px;
    /* Page thickness */
    height: 310px;
    background: repeating-linear-gradient(90deg, #fff 0px, #ccc 1px, #fff 2px);
    transform: rotateY(90deg) translateZ(-24px);
    /* Shift to align right edge */
}

.case-wrapper:hover .polaroid-group {
    transform: rotateY(20deg) rotateX(10deg) scale(1.1);
    z-index: 100;
}

.polaroid {
    background: #fff;
    padding: 15px 15px 60px 15px;
    box-shadow: 2px 2px 20px rgba(0, 0, 0, 0.5);
    transform: rotate(var(--rotation));
}

.polaroid img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    filter: sepia(0.3) contrast(1.2) brightness(0.9);
    border: 1px solid #ddd;
}

.post-it {
    background: #ffeb3b;
    /* Post-it Yellow */
    color: #1a1a1a;
    width: 200px;
    padding: 15px;
    position: absolute;
    bottom: -30px;
    left: 20px;
    box-shadow: 2px 4px 6px rgba(0, 0, 0, 0.3);
    font-family: 'Permanent Marker', cursive;
    transform: translateZ(30px) rotate(-3deg);
    clip-path: polygon(0% 0%, 100% 0%, 100% 95%, 95% 100%, 0% 100%);
    /* Folded corner */
}

/* =========================================
   TYPE 2: THE VHS TAPE (Video) 
   ========================================= */
.vhs-tape {
    width: 240px;
    height: 400px;
    position: relative;
    margin: 0 auto;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    transform: rotateY(-30deg);
}

.case-wrapper:hover .vhs-tape {
    transform: rotateY(0deg) scale(1.1);
}

.vhs-face {
    position: absolute;
    border: 1px solid #111;
}

.vhs-front {
    width: 240px;
    height: 400px;
    background: #111;
    transform: translateZ(25px);
    /* Plastic texture */
    background-image:
        linear-gradient(90deg, transparent 50%, rgba(255, 255, 255, 0.05) 50%),
        linear-gradient(rgba(255, 255, 255, 0.05) 50%, transparent 50%);
    background-size: 4px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 20px;
    box-shadow: inset 0 0 20px #000;
}

.vhs-thumb {
    width: 200px;
    height: 250px;
    background-size: cover;
    background-position: center;
    border: 2px solid #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

.vhs-label {
    margin-top: 20px;
    background: #fff;
    color: #000;
    padding: 10px;
    width: 200px;
    text-align: center;
    font-family: 'Courier Prime';
    font-weight: bold;
    transform: rotate(-1deg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.vhs-spine-left {
    width: 50px;
    height: 400px;
    background: #1a1a1a;
    transform: rotateY(-90deg) translateZ(25px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vhs-spine-text {
    background: #fff;
    padding: 5px 20px;
    width: 300px;
    text-align: center;
    transform: rotate(90deg);
    font-family: 'Courier Prime';
    font-size: 0.9rem;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vhs-back {
    width: 240px;
    height: 400px;
    background: #080808;
    transform: translateZ(-25px) rotateY(180deg);
    color: #fff;
    padding: 20px;
    font-family: 'Courier Prime';
    font-size: 0.8rem;
    box-shadow: inset 0 0 30px #000;
}

/* =========================================
   TYPE 3: THE CASSETTE (Audio) 
   ========================================= */
.cassette-group {
    width: 300px;
    height: 190px;
    margin: 100px auto;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    transform: rotateX(40deg) rotateZ(-5deg);
}

.case-wrapper:hover .cassette-group {
    transform: rotateX(0deg) rotateZ(0deg) scale(1.1);
}

.cassette-body {
    width: 100%;
    height: 100%;
    background: #333;
    border-radius: 10px;
    transform: translateZ(10px);
    /* Plastic sheen */
    background: linear-gradient(135deg, #444 0%, #111 100%);
    box-shadow: 0 10px 10px rgba(0, 0, 0, 0.5), inset 0 0 5px rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #222;
}

/* The transparent window with reels */
.cassette-body::before {
    content: '';
    position: absolute;
    width: 180px;
    height: 40px;
    background: #111;
    border-radius: 20px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: inset 0 0 10px #000;
}

/* Spools */
.cassette-body::after {
    content: '';
    position: absolute;
    width: 140px;
    height: 30px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-image:
        radial-gradient(circle, #fff 4px, transparent 5px),
        /* Left Spool hole */
        radial-gradient(circle, #fff 4px, transparent 5px);
    /* Right Spool hole */
    background-position: 20px center, 120px center;
    background-repeat: no-repeat;
}

.cassette-label-sticker {
    width: 260px;
    height: 100px;
    background: #e0d0b0;
    /* Beige */
    position: absolute;
    top: 20px;
    border-radius: 5px;
    padding: 10px;
    text-align: center;
    font-family: 'Courier Prime';
    font-weight: bold;
    color: #900;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 85% 80%, 15% 80%, 0 100%);
    z-index: 2;
}

.headphones-wire {
    width: 200px;
    height: 200px;
    border: 3px solid #111;
    border-radius: 50%;
    position: absolute;
    bottom: -80px;
    right: -20px;
    transform: rotateX(80deg) translateZ(-20px);
    z-index: -1;
    filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.5));
}

/* =========================================
   TYPE 4: THE FLOPPY DISK (Internet)
   ========================================= */
.floppy-group {
    width: 240px;
    height: 240px;
    margin: 80px auto;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    transform: rotateX(20deg) rotateY(-10deg);
}

.case-wrapper:hover .floppy-group {
    transform: rotateX(0deg) rotateY(0deg) scale(1.1);
}

.floppy-body {
    width: 100%;
    height: 100%;
    background: #222;
    border-radius: 4px;
    transform: translateZ(5px);
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
    /* Metal Shutter */
    background-image: linear-gradient(to bottom, #ccc 0%, #eee 10%, #999 90%, #ccc 100%);
    background-size: 140px 50px;
    background-repeat: no-repeat;
    background-position: center 20px;
}

/* Shutter track */
.floppy-body::before {
    content: '';
    position: absolute;
    left: 40px;
    top: 20px;
    width: 160px;
    height: 52px;
    border: 1px solid #111;
    background: transparent;
}

.floppy-label {
    width: 80%;
    height: 50%;
    background: #000080;
    /* Navy Blue Label */
    position: absolute;
    bottom: 20px;
    left: 10%;
    color: #fff;
    padding: 10px;
    font-family: 'Courier Prime';
    font-size: 0.8rem;
    border-top: 4px solid #fff;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    transform: rotate(180deg);
    /* Label is usually upside down relative to shutter? No, depends on orientation. Let's keep it straight. */
    transform: rotate(0deg);
}

/* =========================================
   TYPE 5: OLD BOOK (SOLID 220x320x50 - GRIMOIRE STYLE)
   ========================================= */
.book-group {
    width: 220px;
    height: 320px;
    margin: 30px auto;
    perspective: 1000px;
}

.book-dims {
    transform: rotateY(-35deg);
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}

.book-group:hover .book-dims {
    transform: rotateY(-20deg) translateX(10px) translateZ(20px);
}

/* Dimensions W:220 H:320 D:50 */
.book-face-front,
.book-face-back {
    width: 220px;
    height: 320px;
}

.book-face-side {
    width: 50px;
    height: 320px;
}

.book-face-top {
    width: 220px;
    height: 50px;
}

.book-face-front {
    transform: translateZ(25px);
}

.book-face-back {
    transform: rotateY(180deg) translateZ(25px);
    background: #300;
    border: 4px solid #c90;
}

.book-face-right {
    transform: rotateY(90deg) translateZ(110px);
}

.book-face-spine {
    transform: rotateY(-90deg) translateZ(110px);
}

.book-face-top {
    transform: rotateX(90deg) translateZ(160px);
}

.book-face-bottom {
    transform: rotateX(-90deg) translateZ(160px);
}

/* Styling */
.book-face-front {
    background: #400;
    /* Dark Red Leather */
    border: 5px solid #d4af37;
    /* Gold Border */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 40px #000;
    position: relative;
}

.book-ornaments {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    border: 2px solid #d4af37;
    background-image:
        radial-gradient(circle at 10% 10%, #d4af37 2px, transparent 3px),
        radial-gradient(circle at 90% 10%, #d4af37 2px, transparent 3px),
        radial-gradient(circle at 10% 90%, #d4af37 2px, transparent 3px),
        radial-gradient(circle at 90% 90%, #d4af37 2px, transparent 3px);
    box-shadow: inset 10px 10px 20px rgba(0, 0, 0, 0.5);
}

.book-title-gold {
    color: #d4af37;
    font-family: var(--font-heading);
    font-size: 1.6rem;
    text-align: center;
    text-shadow: 2px 2px 0px #000;
    z-index: 10;
    padding: 10px;
}

.book-face-spine {
    background: linear-gradient(90deg, #200, #500, #200);
    box-shadow: inset 0 0 10px #000;
    border-top: 2px solid #d4af37;
    border-bottom: 2px solid #d4af37;
}

.book-pages-texture {
    background: repeating-linear-gradient(90deg, #f5e0b0 0px, #d0c090 1px, #f5e0b0 2px);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.4);
}

.book-face-top,
.book-face-bottom {
    background: #300;
}


.case-wrapper:hover .polaroid-group {
    transform: rotateY(20deg) rotateX(10deg) scale(1.1);
    z-index: 100;
}

.polaroid {
    background: var(--polaroid-white);
    padding: 15px 15px 50px 15px;
    box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.6);
    transform: rotate(var(--rotation));
    /* Static tilt */
    backface-visibility: hidden;
}

.polaroid img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    filter: sepia(0.2) contrast(1.1);
    border: 1px solid #ddd;
}

.post-it {
    background: var(--postit-yellow);
    color: var(--ink-black);
    width: 90%;
    padding: 15px;
    position: absolute;
    bottom: -40px;
    left: 5%;
    box-shadow: 2px 5px 10px rgba(0, 0, 0, 0.4);
    font-family: 'Permanent Marker', cursive;
    transform: rotate(calc(var(--rotation) * -2)) translateZ(20px);
    /* Pop out in Z space */
    clip-path: polygon(0% 0%, 100% 0%, 100% 90%, 90% 100%, 0% 100%);
}

.post-it h3 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    line-height: 1;
}

/* =========================================
   TYPE 2: THE VHS TAPE (Video) 
   ========================================= */
/* A pure CSS 3D Box */
.vhs-tape {
    width: 240px;
    height: 380px;
    position: relative;
    margin: 0 auto;
    transform-style: preserve-3d;
    transition: transform 0.8s ease;
    transform: rotateY(-25deg);
    /* Initial angled rest */
}

.case-wrapper:hover .vhs-tape {
    transform: rotateY(0deg) scale(1.1);
    /* Face forward on hover */
}

/* Faces */
.vhs-face {
    position: absolute;
    box-sizing: border-box;
    border: 1px solid #222;
}

.vhs-front {
    width: 240px;
    height: 380px;
    background: #111;
    transform: translateZ(25px);
    display: flex;
    flex-direction: column;
    /* Retro VHS Cover Art Vibe */
    background-image: repeating-linear-gradient(0deg, transparent 0px, transparent 2px, rgba(0, 0, 0, 0.5) 3px), linear-gradient(to bottom, #222, #000);
}

.vhs-back {
    width: 240px;
    height: 380px;
    background: #111;
    transform: translateZ(-25px) rotateY(180deg);
    padding: 20px;
    color: #fff;
    font-family: 'Courier Prime';
    text-align: left;
}

.vhs-spine-left {
    width: 50px;
    height: 380px;
    background: #eee;
    /* White Label on Spine */
    transform: rotateY(-90deg) translateZ(120px) translateX(-120px);
    /* Math magic for box side */
    transform-origin: left;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vhs-thumb {
    width: 100%;
    height: 250px;
    object-fit: cover;
    margin-top: 20px;
    border: 2px solid #fff;
}

.vhs-label {
    background: #fff;
    color: #000;
    margin: 15px;
    padding: 10px;
    font-family: 'Black Ops One';
    text-align: center;
    transform: rotate(-2deg);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.vhs-spine-text {
    transform: rotate(90deg);
    white-space: nowrap;
    font-family: 'Permanent Marker';
    font-size: 1.2rem;
    color: #000;
}

/* =========================================
   TYPE 3: THE CASSETTE (Audio) 
   ========================================= */
.cassette-group {
    width: 300px;
    height: 190px;
    margin: 100px auto 0;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    transform: rotateX(60deg) rotateZ(-10deg);
    /* Resting on table look */
}

.case-wrapper:hover .cassette-group {
    transform: rotateX(0deg) rotateZ(0deg) scale(1.2);
    /* Float up on hover */
}

.cassette-body {
    width: 100%;
    height: 100%;
    background: #333;
    border-radius: 10px;
    position: absolute;
    transform: translateZ(10px);
    box-shadow: 5px 5px 0px #111;
    /* Fake thickness */
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 50%, #111 15%, transparent 16%),
        radial-gradient(circle at 70% 50%, #111 15%, transparent 16%),
        #444;
    /* Holes for spools */
}

.cassette-label-sticker {
    width: 90%;
    height: 60%;
    background: #f4e4bc;
    /* Beige paper */
    border-radius: 5px;
    padding: 10px;
    text-align: center;
    font-family: 'Courier Prime';
    font-weight: bold;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 80% 85%, 20% 85%, 0% 100%);
    /* Label shape */
}

.headphones-wire {
    position: absolute;
    bottom: -100px;
    left: 50%;
    width: 200px;
    height: 200px;
    border: 4px solid #111;
    border-radius: 50%;
    z-index: -1;
    transform: rotateX(90deg);
}

/* --- GENERIC STYLES --- */
.single-case-container {
    max-width: 800px;
}

.case-file-open {
    background: #e8e4d9;
    padding: 50px;
    position: relative;
    margin-top: 30px;
}

.stamp-confidential {
    border: 3px solid #d00;
    color: #d00;
    display: inline-block;
    padding: 5px 15px;
    font-size: 1.5rem;
    font-family: 'Black Ops One', cursive;
    transform: rotate(-15deg);
    margin-bottom: 20px;
}

.case-meta-top {
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    font-family: var(--font-hand);
    text-transform: uppercase;
}

.entry-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    text-align: center;
    margin: 30px 0;
}

.case-report-body {
    font-family: 'Crimson Text', serif;
    font-size: 1.2rem;
    line-height: 1.8;
    text-align: justify;
}

/* Header Fix */
header h1 a {
    color: #666;
    font-family: 'Black Ops One';
    font-size: 2.5rem;
    text-decoration: none;
    letter-spacing: 2px;
}

/* =========================================
   TYPE 4: THE FLOPPY DISK (Internet/Creepypasta)
   ========================================= */
.floppy-group {
    width: 240px;
    height: 240px;
    margin: 50px auto;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    transform: rotateX(10deg) rotateY(0deg);
}

.case-wrapper:hover .floppy-group {
    transform: rotateX(0deg) scale(1.1);
}

.floppy-body {
    width: 100%;
    height: 100%;
    background: #333;
    border-radius: 5px;
    position: absolute;
    transform: translateZ(5px);
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
    /* Shutter */
    background-image: linear-gradient(to right, #ccc 0%, #eee 50%, #ccc 100%);
    background-size: 140px 60px;
    background-repeat: no-repeat;
    background-position: center top;
}

.floppy-label {
    width: 80%;
    height: 60%;
    background: #f0f0f0;
    margin: 80px auto 0;
    padding: 10px;
    font-family: 'Courier Prime';
    text-transform: uppercase;
    font-size: 0.9rem;
    border-radius: 3px;
    border-top: 4px solid blue;
    transform: rotate(180deg);
    /* Upside down label style */
}

/* =========================================
   SINGLE POST HERO SCENES
   ========================================= */

/* Common Container */
.artifact-hero {
    height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #050505;
    overflow: hidden;
    position: relative;
    border-bottom: 2px solid #333;
}

/* Scaling Wrapper for Heroes */
.hero-scale {
    transform: scale(1.5);
    /* Make them big! */
}

/* --- TV SCENE (VHS) --- */
.tv-set-3d {
    width: 400px;
    height: 300px;
    position: relative;
    perspective: 1000px;
}

.tv-housing {
    width: 100%;
    height: 100%;
    background: #222;
    border-radius: 20px;
    border: 4px solid #444;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.tv-screen {
    width: 90%;
    height: 80%;
    background: #111;
    border-radius: 50% 50% 50% 50% / 10% 10% 10% 10%;
    /* CRT Curve */
    border: 2px solid #000;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tv-glitch-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0px, transparent 1px, transparent 2px);
    pointer-events: none;
    z-index: 10;
}

.play-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    font-family: 'VCR OSD Mono', monospace;
    color: #0f0;
    font-size: 1.5rem;
    text-shadow: 0 0 5px #0f0;
    animation: blink 2s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.tv-controls {
    width: 100%;
    height: 20%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    padding-right: 30px;
}

.dial {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #333;
    border: 2px solid #111;
}

.power-btn {
    width: 15px;
    height: 15px;
    background: red;
    border-radius: 50%;
    box-shadow: 0 0 5px red;
}

/* Floating Tape */
.vhs-tape-floating {
    position: absolute;
    bottom: -50px;
    left: -50px;
    width: 200px;
    height: 40px;
    background: #111;
    border: 1px solid #333;
    transform: rotateY(20deg) rotateX(10deg) translateZ(100px);
    color: white;
    font-family: monospace;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.5);
}

/* --- AUDIO SCENE (Cassette) --- */
.audio-scene-3d {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle, #222, #000);
}

.scrolling-title {
    white-space: nowrap;
    overflow: hidden;
    animation: scrollText 5s linear infinite;
}

@keyframes scrollText {
    0% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* --- TERMINAL SCENE (Floppy) --- */
.terminal-scene-3d {
    width: 100%;
    height: 100%;
    display: flex;
    gap: 50px;
    justify-content: center;
    align-items: center;
    background: #001100;
    /* Dark Green Matrix */
}

.terminal-text {
    font-family: 'Courier Prime', monospace;
    color: #0f0;
    font-size: 1.2rem;
    text-shadow: 0 0 5px #0f0;
}

/* --- BOOK SCENE (Legends) --- */
.book-scene-3d {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #1a0a0a;
}

.candle-light-overlay {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 200px;
    background: radial-gradient(ellipse at center bottom, rgba(255, 100, 0, 0.2), transparent 70%);
}

/* --- PAPER CONTAINERS --- */
.vhs-paper,
.cassette-paper,
.floppy-paper,
.book-paper {
    max-width: 800px;
    margin: -50px auto 50px;
    background: #fff;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 10;
}

.vhs-paper {
    background: #f0f0f0;
    border-left: 5px solid #000;
    font-family: 'Courier New', monospace;
}

.book-paper {
    background: #fdf5e6;
    border: 1px solid #d4af37;
    padding: 60px;
    font-family: 'Crimson Text', serif;
}

.book-paper .main-title {
    font-family: 'Cinzel', serif;
    color: #4a0404;
    text-align: center;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 20px;
}

.floppy-paper {
    background: #000;
    color: #0f0;
    font-family: 'Courier Prime';
    border: 1px solid #0f0;
}

body {
    background-color: #050505;
    color: #e0e0e0;
    font-family: 'Courier Prime', monospace;
    overflow-x: hidden;
    /* CRITICAL: Prevent horizontal sway/expansion */
    width: 100%;
    position: relative;
}

.floppy-paper .main-title {
    color: #0f0;
    border-bottom: 1px dashed #0f0;
}

/* =========================================
   SINGLE POST: TYPEWRITER DOCUMENT STYLE
   ========================================= */

body.single-post {
    background-color: #1a1a1a;
    background-image: url('https://www.transparenttextures.com/patterns/dark-wood.png');
    /* Desk Texture */
}

/* The Paper Sheet */
.document-paper {
    background-color: #fdf5e6;
    /* Old Paper */
    background-image: url('https://www.transparenttextures.com/patterns/cream-paper.png');
    width: 100%;
    max-width: 800px;
    margin: 40px auto;
    padding: 80px;
    box-shadow:
        0 1px 4px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(0, 0, 0, 0.1) inset;
    font-family: 'Courier Prime', monospace;
    font-size: 1.15rem;
    line-height: 1.8;
    color: #222;
    position: relative;
    transform: rotate(0.5deg);
    /* Subtle organic feel */
    border: 1px solid #d3c6a6;
}

/* Mobile Adjustments for Paper */
@media (max-width: 768px) {
    .document-paper {
        padding: 40px 20px;
        width: 95%;
    }
}

/* The Header/Stamps */
.doc-header {
    border-bottom: 2px solid #333;
    padding-bottom: 20px;
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
}

.case-info h1 {
    font-family: 'Courier Prime', monospace;
    font-weight: 700;
    font-size: 2rem;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: -1px;
}

.case-meta {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

/* Dynamic Stamps */
.stamp {
    position: relative;
    display: inline-block;
    padding: 0.25rem 1rem;
    text-transform: uppercase;
    font-family: 'Black Ops One', system-ui;
    font-size: 1.5rem;
    font-weight: bold;
    color: #d00;
    /* Red Ink */
    border: 0.3rem solid #d00;
    transform: rotate(-10deg);
    opacity: 0.8;
}

/* Content Typography */
.entry-content p {
    margin-bottom: 25px;
}

/* Highlighter Effect (Bold) */
.entry-content strong,
.entry-content b {
    background: linear-gradient(100deg, rgba(255, 255, 0, 0) 0%, rgba(255, 255, 0, 0.5) 4%, rgba(255, 255, 0, 0.1) 100%);
    background-color: rgba(255, 247, 64, 0.4);
    /* Fallback */
    padding: 0 4px;
    font-weight: bold;
    color: #000;
}

/* Masking Tape Links */
.entry-content a {
    position: relative;
    background: #fdfdfd;
    color: #333;
    text-decoration: none;
    padding: 2px 8px;
    margin: 0 2px;
    border: 1px solid #ddd;
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    font-size: 0.95em;
    transform: rotate(-1deg);
    display: inline-block;
}

/* Tape strip visual */
.entry-content a::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(2deg);
    width: 60%;
    height: 12px;
    background: rgba(255, 255, 255, 0.6);
    border-left: 1px dashed rgba(0, 0, 0, 0.1);
    border-right: 1px dashed rgba(0, 0, 0, 0.1);
    opacity: 0.7;
}

/* Pinned Photos (Images) */
.entry-content img {
    background: #fff;
    padding: 10px 10px 50px 10px;
    /* Polaroid bottom heavy */
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.4);
    transform: rotate(2deg);
    max-width: 100%;
    height: auto;
    display: block;
    margin: 40px auto;
    border: 1px solid #ccc;
    position: relative;
}

/* Hover effect to straighten */
.entry-content img:hover {
    transform: rotate(0deg) scale(1.02);
    transition: transform 0.3s ease;
}

/* Footer Signature */
.doc-footer {
    margin-top: 60px;
    border-top: 1px dashed #999;
    padding-top: 20px;
    text-align: right;
    font-family: 'Dancing Script', cursive;
    /* Handwritten signature font if available, fallback cursive */
    font-size: 1.5rem;
    color: #000080;
    /* Blue Pen */
}


/* =========================================
   MAGAZINE HERO STYLES
   ========================================= */
.magazine-hero-container {
    background-color: #0d0d0d;
    color: #fff;
    padding: 60px 0 40px;
    border-bottom: 5px solid #d00;
}

.hero-branding {
    text-align: center;
    margin-bottom: 50px;
}

.hero-logo {
    font-family: 'Black Ops One', system-ui;
    font-size: 4rem;
    line-height: 1;
    color: #fff;
}

.hero-logo .highlight-text {
    color: #d00;
}

.hero-tagline {
    font-family: 'Courier Prime', monospace;
    letter-spacing: 3px;
    color: #888;
    margin-top: 10px;
}

/* Featured Article */
.hero-main-feature {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    background: #1a1a1a;
    padding: 30px;
    border: 1px solid #333;
}

.hero-image-wrapper img {
    width: 100%;
    height: auto;
    filter: grayscale(100%) contrast(1.2);
    border: 2px solid #fff;
    transition: filter 0.3s;
}

.hero-image-wrapper:hover img {
    filter: grayscale(0%) contrast(1);
}

.hero-content .badget {
    background: #d00;
    color: #fff;
    padding: 2px 8px;
    font-size: 0.8rem;
    font-family: 'Black Ops One';
}

.hero-content h2 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    margin: 15px 0;
}

.hero-content h2 a {
    text-decoration: none;
    color: #fff;
}

.read-more-btn {
    display: inline-block;
    margin-top: 20px;
    color: #d00;
    font-family: 'Courier Prime';
    border-bottom: 1px solid #d00;
    text-decoration: none;
}

/* Category Menu */
.category-menubar ul {
    list-style: none;
    padding: 0;
    text-align: center;
    margin-top: 50px;
    border-top: 1px solid #333;
    padding-top: 20px;
}

.category-menubar li {
    display: inline-block;
    margin: 0 15px;
}

.category-menubar a {
    color: #aaa;
    text-decoration: none;
    font-family: 'Black Ops One';
    font-size: 1.1rem;
    text-transform: uppercase;
    transition: color 0.3s;
}

.category-menubar a:hover {
    color: #fff;
    text-shadow: 0 0 5px #fff;
}

/* Archive Title */
.archive-section-title {
    text-align: center;
    margin: 60px 0 40px;
}

.archive-section-title h3 {
    font-family: 'Black Ops One';
    font-size: 2rem;
    color: #fff;
    margin-bottom: 10px;
}

.title-line {
    width: 100px;
    height: 3px;
    background: #d00;
    margin: 0 auto;
}

/* Newsletter */
.newsletter-section {
    background: #d00;
    color: #fff;
    padding: 60px 0;
    text-align: center;
}

.newsletter-section h2 {
    font-family: 'Black Ops One';
    font-size: 2.5rem;
}

.newsletter-form {
    margin-top: 20px;
}

.newsletter-form input {
    padding: 10px;
    width: 300px;
    border: none;
    font-family: 'Courier Prime';
}

.newsletter-form button {
    padding: 10px 20px;
    background: #000;
    color: #fff;
    border: none;
    font-weight: bold;
    cursor: pointer;
    font-family: 'Black Ops One';
}

/* Social Footer */
.social-footer {
    background: #000;
    color: #666;
    padding: 40px 0;
    text-align: center;
    font-family: 'Courier Prime';
}

.social-icons a {
    color: #fff;
    margin: 0 10px;
    text-decoration: none;
    font-weight: bold;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero-main-feature {
        grid-template-columns: 1fr;
    }

    .hero-logo {
        font-size: 2.5rem;
    }

    .newsletter-form input {
        width: 100%;
        margin-bottom: 10px;
    }

    .container {
        width: 95%;
        padding: 0 10px;
    }

    .document-paper {
        padding: 30px 15px;
        /* Reduced padding */
        margin: 10px auto;
        width: 95%;
        box-sizing: border-box;
        overflow: visible;
        /* Let content expand/wrap */
        height: auto !important;
        /* Force height expansion */
        min-height: 600px;
        /* Keep the look but allow growth */
    }

    .typewriter-text {
        font-size: 1.15rem !important;
        /* Smaller to fit */
        line-height: 1.3;
        overflow-wrap: break-word;
        word-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
        white-space: normal !important;
        width: 100%;
        display: block;
    }

    .stamp {
        font-size: 2rem;
        top: 10px;
        right: 10px;
        opacity: 0.8;
        transform: rotate(-15deg) scale(0.8);
        /* Scale down stamp */
    }

    .hero-logo img {
        max-width: 80% !important;
    }
}

/* Page Transitions */
body {
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================
   HORROR TEXTURES & GRIME OVERLAYS
   ========================================= */

/* DUST & GRIME MIXIN (SVG Data URI) */
.grime-overlay {
    position: relative;
    overflow: hidden;
}

.grime-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    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.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.4'/%3E%3C/svg%3E");
    opacity: 0.6;
    mix-blend-mode: multiply;
    z-index: 5;
}

/* DIRTY FINGERPRINTS (CSS Radial Gradient) */
.fingerprint-overlay {
    position: relative;
}

.fingerprint-overlay::before {
    content: '';
    position: absolute;
    top: 10%;
    right: 5%;
    width: 60px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(50, 30, 20, 0.6), transparent 70%);
    box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.3);
    filter: blur(8px);
    opacity: 0.7;
    transform: rotate(15deg);
    pointer-events: none;
    z-index: 6;
}

/* BLOOD SPLATTER (CSS Radial Gradient) */
.blood-splatter {
    position: relative;
}

.blood-splatter::after {
    content: '';
    position: absolute;
    bottom: 50px;
    right: 40px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle at 50% 50%, #800000 0%, transparent 60%),
        radial-gradient(circle at 30% 60%, #600000 0%, transparent 50%);
    opacity: 0.8;
    mix-blend-mode: multiply;
    pointer-events: none;
    filter: blur(4px) contrast(1.5);
    z-index: 7;
    transform: rotate(45deg);
}

/* Applying Grime to Folders */
.folder-front {
    /* Worn Cardboard Gradient */
    background: linear-gradient(135deg, #d2b48c, #8b4513);
    position: relative;
}

/* Scuff marks */
.folder-front::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='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.2'/%3E%3C/svg%3E");
    opacity: 0.5;
    mix-blend-mode: overlay;
    pointer-events: none;
}

/* Dirt stains */
.folder-front::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(0, 0, 0, 0.4), transparent 40%),
        radial-gradient(circle at 80% 10%, rgba(100, 50, 0, 0.3), transparent 30%);
    pointer-events: none;
    z-index: 10;
}

/* Applying Grime to Photos */
.polaroid {
    background-color: #f0f0f0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.polaroid::before {
    /* Yellowing age effect */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 40%, rgba(189, 149, 39, 0.2) 100%);
    pointer-events: none;
    z-index: 2;
}

/* =========================================
   ANIMATED TV STATIC & TYPEWRITER FX
   ========================================= */



/* ANIMATED STATIC OVERLAY (ZERO LAG - TEXTURE BASED) */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Lightweight 100x100px Noise Texture (Base64) - Tiled */
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyBAMAAADsEZWCAAAAGFBMVEUAAAA5OTkAAABMTExERERmZmYzMzNmZmYAAAB44uW8AAAACHRSTlMzAJmZzMxmZjLIZQAAASFJREFUOMul0c0VwyAMA+CjOEA36AaM0A0YoRswSjfoBo3i/f2q75Q+H4/t/Bw70X+Xv7s/d/9s/t7+2vnj+W/3l+6v3T+bv7e/dv54/tv9pftr98/m7+2vnT+e/3Z/6f7a/bP5+/w/9b/T/13/d/3f9X/X/13/d/3f9X/X/13/d/3f9X/X/13/d/3f9X/X/13/d/3f9X/X/13/d/3f9X/X/13/d/3f9X/X/13/d/3f9X/X/13/d/3f9X/X/13/d/3f9X/X/13/d/3f9X/X/13/d/3y/+L/5f/V/8//r/+f/1//P/+/");
    background-repeat: repeat;
    background-size: 150px 150px;
    opacity: 0.08;
    z-index: 9999;
    pointer-events: none;
    will-change: background-position;
    animation: staticNoise 0.2s steps(4) infinite;
}

@keyframes staticNoise {
    0% {
        background-position: 0 0;
    }

    10% {
        background-position: -10px -10px;
    }

    20% {
        background-position: -20px 20px;
    }

    30% {
        background-position: 10px -20px;
    }

    40% {
        background-position: -10px 30px;
    }

    50% {
        background-position: -20px 10px;
    }

    60% {
        background-position: 30px 0;
    }

    70% {
        background-position: 0 20px;
    }

    80% {
        background-position: -30px 0;
    }

    90% {
        background-position: 20px 10px;
    }

    100% {
        background-position: 10px 0;
    }
}

/* TYPEWRITER EFFECT (No Cursor, One-time) */
.typewriter-text {
    overflow: hidden;
    white-space: nowrap;
    width: 0;
    /* Types out in 3.5s and stays there. No blinking cursor. */
    animation: typing 3.5s steps(40, end) forwards;
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

/* FLICKERING TEXT (Optimized) */
.flicker-text {
    animation: flicker 4s infinite alternate;
    will-change: opacity;
}

@keyframes flicker {

    0%,
    18%,
    22%,
    25%,
    53%,
    57%,
    100% {
        opacity: 1;
        text-shadow: 0 0 5px #fff, 0 0 10px #d00, 0 0 20px #d00;
    }

    20%,
    24%,
    55% {
        opacity: 0.4;
        text-shadow: none;
    }
}

/* CRT SCANLINE EFFECT (More Visible) */
body::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 9998;
    background-size: 100% 3px, 4px 100%;
    pointer-events: none;
    opacity: 0.6;
}

/* =========================================
   RESPONSIVE GRID & UI OVERHAUL
   ========================================= */

/* HERO 1+4 CINEMATIC GRID LAYOUT */
.hero-gallery {
    display: grid;
    /* Main (65%) | Sub (35%) */
    grid-template-columns: 1.8fr 1fr;
    grid-template-rows: 450px;
    /* Cinematic Height */
    gap: 20px;
    margin-bottom: 40px;
}

/* MAIN FEATURE CARD (The "Netflix" Poster) */
.hero-main-feature {
    grid-column: 1 / 2;
    position: relative;
    height: 100%;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid #333;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.hero-main-feature .hero-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-main-feature .hero-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hero-main-feature:hover .hero-image-wrapper img {
    transform: scale(1.08);
}

/* Content Overlay (Bottom Gradient) */
.hero-main-feature .hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 10%, rgba(0, 0, 0, 0.7) 30%, rgba(0, 0, 0, 0) 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 30px;
    box-sizing: border-box;
}

.hero-main-feature .badget {
    display: inline-block;
    background: var(--color-accent);
    color: #fff;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-family: 'Black Ops One';
    margin-bottom: 10px;
    width: fit-content;
}

.hero-main-feature h2 {
    font-size: 2.2rem;
    line-height: 1.1;
    margin: 0 0 10px 0;
    font-family: 'Cinzel', serif;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.hero-main-feature h2 a {
    color: inherit;
    text-decoration: none;
    background-image: linear-gradient(to right, var(--color-accent) 0%, var(--color-accent) 100%);
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: background-size 0.3s;
}

.hero-main-feature:hover h2 a {
    background-size: 100% 2px;
}

.hero-main-feature p {
    color: #ccc;
    font-size: 1rem;
    max-width: 90%;
    margin-bottom: 20px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-main-feature .read-more-btn {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    align-self: flex-start;
}

.hero-main-feature:hover .read-more-btn {
    opacity: 1;
    transform: translateY(0);
}


/* SUB GRID (The "Sidebar" List) */
.hero-sub-grid {
    grid-column: 2 / 3;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
}

.hero-sub-item {
    flex: 1;
    /* Distribute height evenly */
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background: #111;
    padding: 10px;
    border-bottom: 1px solid #333;
    transition: background 0.2s;
    overflow: hidden;
}

.hero-sub-item:hover {
    background: #1a1a1a;
    border-left: 2px solid var(--color-accent);
}

.hero-sub-item img {
    width: 90px;
    height: 100%;
    min-height: 60px;
    object-fit: cover;
    border-radius: 2px;
    filter: sepia(0.2) contrast(1.1);
}

.hero-sub-item .sub-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.hero-sub-item .sub-info h4 {
    font-size: 0.95rem;
    margin: 0 0 5px 0;
    line-height: 1.25;
    color: #e0e0e0;
    font-family: 'Cinzel', serif;
}

.hero-sub-item .sub-info small {
    color: #888;
    font-size: 0.7rem;
    font-family: 'Courier Prime';
    letter-spacing: 1px;
}


/* RESPONSIVE: Tablet & Mobile */
@media (max-width: 900px) {
    .hero-gallery {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        gap: 0;
    }

    /* (Removed facetted-wrapper from media query to enforce global grid) */

    .hero-main-feature h2 {
        font-family: 'Cinzel', serif;
        font-size: 1.8rem;
        margin-bottom: 10px;
        color: #fff;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
        /* Text Overflow Protection */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.2;
    }

    .hero-main-feature p {
        /* Text Overflow Protection */
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 0.95rem;
        line-height: 1.4;
    }

    /* HERO SUB-GRID (Right) - Text Fixes */
    .hero-sub-grid {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 1fr);
        gap: 10px;
        background: #111;
        border: 1px solid #333;
        border-top: none;
        border-radius: 0 0 4px 4px;
    }

    .hero-sub-item {
        display: flex;
        align-items: center;
        background: rgba(10, 10, 10, 0.6);
        border: 1px solid #222;
        padding: 10px;
        transition: all 0.3s;
        overflow: hidden;
        /* Contain text */
        border-bottom: 1px solid #222;
        height: auto;
    }

    .hero-sub-item img {
        width: 80px;
        height: 80px;
    }

    .hero-sub-item h3 {
        margin: 0;
        font-size: 0.9rem;
        color: #ccc;
        font-family: 'Courier Prime';
        /* Text Overflow Protection */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.3;
    }
}

/* EKG / LIFELINE ANIMATION for Faceted Filter */
@keyframes lifeline-pulse {
    0% {
        border-bottom-color: #333;
        box-shadow: 0 1px 0 rgba(0, 0, 0, 0);
    }

    10% {
        border-bottom-color: var(--color-accent);
        box-shadow: 0 2px 10px rgba(255, 0, 0, 0.6);
    }

    20% {
        border-bottom-color: #333;
        box-shadow: 0 1px 0 rgba(0, 0, 0, 0);
    }

    100% {
        border-bottom-color: #333;
        box-shadow: 0 1px 0 rgba(0, 0, 0, 0);
    }
}

@keyframes lifeline-travel {
    0% {
        left: -20%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        left: 120%;
        opacity: 0;
    }
}

/* FACETED SEARCH (Horizontal Chips) - TOP PLACEMENT ADJUSTMENTS */
/* FACETED SEARCH (Global - Grid Layout) */
.facetted-wrapper {
    display: flex;
    flex-wrap: wrap !important;
    justify-content: center;
    gap: 10px;
    padding: 20px 10px;
    margin-bottom: 30px;
    border-bottom: 1px solid #333;
    position: relative;
    overflow: visible;
    white-space: normal;
}

.facet-chip {
    flex: 0 0 auto;
    background: #0a0a0a;
    border: 1px solid #333;
    color: #888;
    padding: 8px 18px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    font-family: 'Courier Prime';
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.facet-chip:hover,
.facet-chip.active {
    border-color: var(--color-accent);
    background: var(--color-accent);
    color: #000;
    box-shadow: 0 0 15px var(--color-accent);
    transform: translateY(-2px);
}

margin-bottom: 25px;
background: rgba(0, 0, 0, 0.2);
/* LIFELINE ANIMATION BASE */
border-bottom: 2px solid #333;
position: relative;
/* Hide scrollbar but keep functionality */
-ms-overflow-style: none;
scrollbar-width: none;
mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

/* The travelling light beam */
.facetted-wrapper::after {
    content: '';
    position: absolute;
    bottom: -2px;
    /* Overlap border */
    left: 0;
    width: 20%;
    /* Length of the "pulse" */
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    z-index: 10;
    animation: lifeline-travel 4s linear infinite;
    pointer-events: none;
}

.facetted-wrapper::-webkit-scrollbar {
    display: none;
}

.facet-chip {
    display: inline-block;
    padding: 8px 18px;
    margin-right: 10px;
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid #444;
    color: #999;
    border-radius: 4px;
    /* More tactical, less pill-shaped */
    font-family: 'Black Ops One', cursive;
    /* More strong/military */
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.facet-chip:hover,
.facet-chip.active {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.4);
    transform: translateY(-2px);
}

/* MOBILE FOOTNAV vs DESKTOP TOPNAV */

/* Desktop Nav Styles */
.desktop-nav {
    display: flex;
    justify-content: center;
    padding: 15px;
    border-bottom: 1px solid #222;
}

.desktop-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 40px;
}

.desktop-nav a {
    color: #999;
    text-decoration: none;
    text-transform: uppercase;
    font-family: 'Cinzel', serif;
    /* Matching Hero */
    letter-spacing: 2px;
    font-size: 0.9rem;
    transition: color 0.3s;
    position: relative;
}

.desktop-nav a:hover {
    color: var(--color-accent);
}

.desktop-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -5px;
    left: 0;
    background-color: var(--color-accent);
    transition: width 0.3s;
}

.desktop-nav a:hover::after {
    width: 100%;
}

/* Mobile Sticky Footer (PREMIUM GLASSMORPHISM) */
.mobile-footnav {
    display: none;
    /* Hidden on Desktop */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.85);
    /* Semi-transparent */
    backdrop-filter: blur(12px);
    /* Blur effect */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10000;
    padding: 12px 0 15px 0;
    /* Extra bottom padding for touch targets */
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.9);
}

.mobile-footnav ul {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    max-width: 600px;
    /* Constrain on tablets */
    margin: 0 auto;
}

.mobile-footnav li {
    flex: 1;
    text-align: center;
}

.mobile-footnav a {
    color: #666;
    text-decoration: none;
    font-size: 0.65rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Courier Prime';
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mobile-footnav i {
    /* Icons */
    font-size: 1.4rem;
    margin-bottom: 6px;
    display: block;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s;
}

.mobile-footnav a:hover,
.mobile-footnav a.active {
    color: #fff;
}

.mobile-footnav a:hover i,
.mobile-footnav a.active i {
    transform: translateY(-4px) scale(1.1);
    filter: drop-shadow(0 0 8px var(--color-accent));
}

/* Media Queries for Nav */
@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }

    .mobile-footnav {
        display: block;
        animation: slideUp 0.5s ease-out;
    }

    body {
        padding-bottom: 80px;
        /* Increased safe space */
    }

    .hero-gallery {
        margin-top: 10px;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    -ms-overflow-style: none;
    scrollbar-width: none;
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

/* The travelling light beam */
.facetted-wrapper::after {
    content: '';
    position: absolute;
    bottom: -2px;
    /* Overlap border */
    left: 0;
    width: 20%;
    /* Length of the "pulse" */
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    z-index: 10;
    animation: lifeline-travel 4s linear infinite;
    pointer-events: none;
}

.facetted-wrapper::-webkit-scrollbar {
    display: none;
}

.facet-chip {
    display: inline-block;
    padding: 8px 18px;
    margin-right: 10px;
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid #444;
    color: #999;
    border-radius: 4px;
    /* More tactical, less pill-shaped */
    font-family: 'Black Ops One', cursive;
    /* More strong/military */
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.facet-chip:hover,
.facet-chip.active {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.4);
    transform: translateY(-2px);
}

/* MOBILE FOOTNAV vs DESKTOP TOPNAV */

/* Desktop Nav Styles */
.desktop-nav {
    display: flex;
    justify-content: center;
    padding: 15px;
    border-bottom: 1px solid #222;
}

.desktop-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 40px;
}

.desktop-nav a {
    color: #999;
    text-decoration: none;
    text-transform: uppercase;
    font-family: 'Cinzel', serif;
    /* Matching Hero */
    letter-spacing: 2px;
    font-size: 0.9rem;
    transition: color 0.3s;
    position: relative;
}

.desktop-nav a:hover {
    color: var(--color-accent);
}

.desktop-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -5px;
    left: 0;
    background-color: var(--color-accent);
    transition: width 0.3s;
}

.desktop-nav a:hover::after {
    width: 100%;
}

/* Mobile Sticky Footer (PREMIUM GLASSMORPHISM) */
.mobile-footnav {
    display: none;
    /* Hidden on Desktop */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.85);
    /* Semi-transparent */
    backdrop-filter: blur(12px);
    /* Blur effect */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10000;
    padding: 12px 0 15px 0;
    /* Extra bottom padding for touch targets */
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.9);
}

.mobile-footnav ul {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    max-width: 600px;
    /* Constrain on tablets */
    margin: 0 auto;
}

.mobile-footnav li {
    flex: 1;
    text-align: center;
}

.mobile-footnav a {
    color: #666;
    text-decoration: none;
    font-size: 0.65rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Courier Prime';
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mobile-footnav i {
    /* Icons */
    font-size: 1.4rem;
    margin-bottom: 6px;
    display: block;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s;
}

.mobile-footnav a:hover,
.mobile-footnav a.active {
    color: #fff;
}

.mobile-footnav a:hover i,
.mobile-footnav a.active i {
    transform: translateY(-4px) scale(1.1);
    filter: drop-shadow(0 0 8px var(--color-accent));
}

/* Media Queries for Nav */
@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }

    .mobile-footnav {
        display: block;
        animation: slideUp 0.5s ease-out;
    }

    body {
        padding-bottom: 80px;
        /* Increased safe space */
    }

    .hero-gallery {
        margin-top: 10px;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* --- DEFAULT GRID / LIST Styles (Moved from Inline) --- */

.archive-grid-card {
    background: #0f0f0f;
    border: 1px solid #222;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.3s;
    overflow: hidden;
    position: relative;
}

.archive-grid-img {
    height: 200px;
    overflow: hidden;
    display: block;
    width: 100%;
}

.archive-grid-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(80%);
    transition: 0.5s;
}

.archive-grid-card:hover .archive-grid-img img {
    filter: grayscale(0%);
    transform: scale(1.1);
}

.archive-grid-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.archive-grid-content h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    margin: 0 0 10px 0;
}

.archive-grid-content h2 a {
    color: #ddd;
    text-decoration: none;
}

.archive-grid-content p {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 15px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-case {
    align-self: flex-start;
    font-family: 'Courier Prime';
    font-size: 0.8rem;
    color: var(--color-accent);
}


/* --- VIEW MODES --- */

.view-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.view-list {
    grid-template-columns: 1fr;
}

.view-list .archive-grid-card {
    flex-direction: row !important;
    height: 180px !important;
}

.view-list .archive-grid-img {
    width: 250px;
    height: 100% !important;
    flex-shrink: 0;
}

/* --- MOBILE OPTIMIZATION --- */
@media (max-width: 768px) {
    .view-list .archive-grid-card {
        height: 120px !important;
        /* Smaller height for mobile */
        margin-bottom: 15px;
    }

    .view-list .archive-grid-img {
        width: 120px !important;
        /* Smaller image */
    }

    .view-list .archive-grid-content h2 {
        font-size: 1rem !important;
        margin-bottom: 5px !important;
    }

    .view-list .archive-grid-content p {
        display: none !important;
        /* Hide excerpt on mobile list to save space */
    }

    .view-list .archive-grid-content .btn-case {
        font-size: 0.7rem !important;
        padding: 2px 5px !important;
    }

    /* Subscription Overlay Fix - CORRECT CLASS */
    .newsletter-section {
        width: 100% !important;
        padding: 40px 10px !important;
        /* Reduced side padding */
        overflow: hidden !important;
        box-sizing: border-box;
    }

    .newsletter-section .container {
        width: 100% !important;
        padding: 0 !important;
        max-width: 100vw;
    }

    .newsletter-section h2 {
        font-size: 1.5rem !important;
        line-height: 1.1;
        word-wrap: break-word;
        padding: 0 10px;
        /* Safety padding */
    }

    .newsletter-section p {
        font-size: 0.9rem !important;
        padding: 0 10px;
    }

    .newsletter-section input[type="email"] {
        font-size: 0.8rem !important;
        /* Prevent text overflow */
        padding: 12px !important;
        width: 90% !important;
        /* Explicitly less than 100% */
        margin: 0 auto 10px auto !important;
        /* Center it */
        display: block;
        max-width: 90vw;
        /* Hard limit */
    }

    .newsletter-section button {
        width: 90% !important;
        margin: 0 auto;
        display: block;
    }
}

/* --- STICKY NAV REFINEMENT --- */
.sticky-nav-wrapper.scrolled {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.8);
    padding: 5px 0;
}

/* Nav Dropdown Interaction */
.desktop-nav .has-dropdown:hover .dropdown-menu {
    display: flex !important;
    animation: fadeIn 0.3s;
}

/* --- ADVANCED FOLDER VIEW (3D + Polaroid + Post-it) --- */

.view-folder {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 40px !important;
    /* Increased spacing */
    padding: 20px;
    perspective: 1000px;
    /* Enable 3D space */
}

/* Base Folder Structure */
.view-folder .archive-grid-card {
    background: #d4b483 !important;
    /* Manila */
    border: 1px solid #c2a17a !important;
    border-radius: 2px 5px 5px 5px;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.4),
        inset 0 0 20px rgba(0, 0, 0, 0.05);
    /* Inner curve depth */
    margin-top: 30px;
    overflow: visible !important;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s;
    transform-style: preserve-3d;
    min-height: 250px;
    /* Ensure space for contents */
}

/* 3D Hover Effect */
.view-folder .archive-grid-card:hover {
    transform: translateY(-5px) rotateX(2deg);
    box-shadow: 10px 10px 25px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

/* Folder Tab */
.view-folder .archive-grid-card::before {
    content: "CASE FILE";
    position: absolute;
    top: -28px;
    left: 0;
    width: 120px;
    height: 30px;
    background: #d4b483;
    border-radius: 8px 8px 0 0;
    border: 1px solid #c2a17a;
    border-bottom: none;
    padding: 6px 0 0 10px;
    font-family: 'Courier Prime', monospace;
    font-size: 0.75rem;
    color: #5d4037;
    font-weight: 800;
    z-index: 1;
    box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.3);
}

/* --- POLAROID PHOTO --- */
.view-folder .archive-grid-img {
    display: block !important;
    width: 150px !important;
    height: 170px !important;
    position: absolute;
    top: 30px;
    left: 20px;
    background: #fff;
    padding: 6px 6px 25px 6px;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
    transform: rotate(-3deg);
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    /* Smoother interaction */
    z-index: 5;
    border: 1px solid #ddd;
    /* No Zoom allowed on image itself */
    pointer-events: none;
}

/* Hover: Bring Photo to Front & Move Right */
.view-folder .archive-grid-card:hover .archive-grid-img {
    transform: rotate(2deg) translateX(80px) translateY(10px);
    z-index: 20;
    /* Highest priority */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.view-folder .archive-grid-img img {
    filter: sepia(30%) contrast(0.9) !important;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 1px solid #eee;
    /* Explicitly prevent zoom */
    transform: none !important;
}

/* --- POST-IT NOTE --- */
.view-folder .archive-grid-content {
    position: absolute;
    top: 40px;
    right: 15px;
    width: 150px;
    background: #fff59d;
    padding: 15px;
    box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.2);
    transform: rotate(2deg);
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 6;
    font-family: 'Indie Flower', 'Courier Prime', cursive;
    color: #333 !important;
    min-height: 160px;
    clip-path: polygon(0 0, 100% 0, 100% 90%, 90% 100%, 0 100%);
}

/* Hover: Move Post-it Left & Back */
.view-folder .archive-grid-card:hover .archive-grid-content {
    transform: rotate(-4deg) translateX(-60px);
    z-index: 5;
    /* Lower than photo */
}

.view-folder h2 {
    font-size: 0.85rem !important;
    line-height: 1.2;
    margin-bottom: 5px !important;
    color: #111 !important;
    /* Force Black for visibility on Post-it */
}

.view-folder h2 a {
    color: #111 !important;
    /* Ensure Link is also black */
}

.view-folder p {
    font-size: 0.65rem !important;
    color: #333 !important;
    /* Darker gray for text */
    line-height: 1.3;
}

.view-folder p {
    font-size: 0.65rem !important;
    color: #444 !important;
    line-height: 1.3;
}

.view-folder .btn-case {
    display: none;
}

/* CATEGORY VARIATION: Dynamic Stamp */
.view-folder .archive-grid-card::after {
    content: attr(data-category);
    /* Shows the actual category name */
    position: absolute;
    color: #b71c1c;
    border: 3px solid #b71c1c;
    padding: 5px 12px;
    transform: rotate(-15deg);
    font-size: 1rem;
    font-family: 'Black Ops One', cursive;
    /* Stencil */
    right: 20px;
    /* Moved to Right to avoid Photo */
    left: auto;
    bottom: 20px;
    /* Moved to bottom */
    top: auto;
    opacity: 0.8;
    background: transparent;
    z-index: 2;
    /* Below Photo (which is 5-20) */
    pointer-events: none;
    mix-blend-mode: multiply;
    text-transform: uppercase;
    max-width: 150px;
    text-align: center;
    line-height: 1.1;
}

/* FULL CLICKABLE FOLDER TRICK */
.view-folder .archive-grid-card {
    cursor: pointer;
}

.view-folder h2 a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 30;
    /* Top most clickable layer */
}

/* Ensure links inside doesn't conflict logic (actually stretched link covers them) */

/* Placeholder for Missing Images in Polaroid */
.view-folder .archive-grid-placeholder-img {
    background: #222;
    width: 100%;
    height: 100%;
}
/* --- VIEW MODES UI --- */
.view-toggles {
    display: flex;
    gap: 10px;
}

.view-toggle-btn {
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid #333;
    color: #888;
    padding: 6px 12px;
    cursor: pointer;
    font-family: 'Courier Prime', monospace;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    border-radius: 3px;
    min-width: 90px;
    justify-content: center;
}

.view-toggle-btn:hover,
.view-toggle-btn.active {
    border-color: var(--color-accent);
    color: var(--color-accent);
    box-shadow: 0 0 10px rgba(183, 28, 28, 0.2);
    transform: translateY(-1px);
    background: rgba(20, 0, 0, 0.8);
}

.view-toggle-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

/* Make sure the active state is visible if JS toggles a class */
.view-toggle-btn.active-view {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: rgba(50, 0, 0, 0.5);
}

/* --- ARCHIVE HEADERS (Responsive Logic) --- */
.archive-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap; 
    gap: 15px;
}

.category-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    margin-top: 50px;
    border-left: 4px solid var(--color-accent);
    padding-left: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

/* Mobile Stack for Headers */
@media (max-width: 768px) {
    .archive-header,
    .category-header-wrapper {
        flex-direction: column;
        align-items: stretch !important;
        text-align: center;
    }

    .archive-header form,
    .category-header-wrapper h3 {
        width: 100%;
        margin-bottom: 10px;
    }

    .view-toggles {
        justify-content: center;
        width: 100%;
        gap: 5px; /* Tighter gap on mobile */
    }
    
    .view-toggle-btn {
        flex: 1; /* Equal width buttons */
        padding: 8px 5px !important;
        font-size: 0.7rem !important;
        min-width: auto !important;
    }

    .search-row {
        width: 100%;
        display: flex;
    }

    .search-row input {
        flex-grow: 1;
        width: 100% !important;
    }
}

/* --- MOBILE FOOTNAV FIX & LAYOUT OVERFLOW --- */
.mobile-footnav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #0a0a0a;
    border-top: 1px solid #333;
    z-index: 99999; /* Super high z-index */
    padding: 10px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.8);
    display: none;
}

.mobile-footnav ul {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mobile-footnav li {
    flex: 1;
    text-align: center;
}

.mobile-footnav a {
    color: #666;
    text-decoration: none;
    font-size: 0.65rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-family: 'Courier Prime', monospace;
    transition: color 0.3s;
}

.mobile-footnav a.active,
.mobile-footnav a:hover {
    color: var(--color-accent);
}

.mobile-footnav svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

/* Force Mobile Styles & prevent overflow */
@media (max-width: 768px) {
    .mobile-footnav {
        display: block !important;
    }

    body {
        padding-bottom: 80px !important; /* Offset for fixed footer */
        overflow-x: hidden !important; /* Force hide horizontal scroll */
        position: relative;
    }

    /* Refine Search Row to prevent overflow */
    .search-row {
        display: flex;
        flex-wrap: nowrap; /* Try to keep inline first */
        gap: 5px;
        width: 100%;
    }

    .search-row input {
        width: auto !important;
        flex: 1 !important; /* Grow to fill space */
        min-width: 0 !important; /* Allow shrinking */
    }

    .search-row button {
        flex-shrink: 0; /* Keep button size */
        width: auto !important;
    }

    /* View Toggles Refinement */
    .view-toggles {
        flex-wrap: wrap;
        width: 100%;
        justify-content: space-between;
    }

    .view-toggle-btn {
        flex: 1;
        min-width: 0 !important; /* Allow shrinking */
        font-size: 0.7rem !important;
        padding: 8px 4px !important;
        white-space: nowrap;
    }
}

/* --- DEFINITIVE MOBILE FOOTNAV LOCK --- */
.mobile-footnav {
    height: 60px !important; /* Force height */
    overflow: hidden !important; /* Clip anything growing */
    box-sizing: border-box !important;
}

.mobile-footnav ul {
    height: 100%;
}

.mobile-footnav li {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-footnav a {
    height: 100%;
    justify-content: center; /* Vertical center content */
    padding: 0 !important;
    margin: 0 !important;
}


/* --- GLOBAL SCROLL FIX --- */
html, body {
    max-width: 100%;
    overflow-x: hidden !important;
}
/* Ensure mobile footnav stays on top */
.mobile-footnav {
    z-index: 999999 !important;
}
/* Ensure switch is above footnav */
.light-switch-container {
    z-index: 1000000 !important;
}


/* --- MOBILE GRID FIX (v57) --- */
@media screen and (max-width: 900px) {
    /* Stack the main gallery container */
    .hero-gallery {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    /* Stack the Main Feature (Image top, Content bottom) */
    .hero-main-feature {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        grid-column: auto !important;
        grid-row: auto !important;
        height: auto !important;
        min-height: auto !important;
        margin-bottom: 20px;
        padding: 15px !important;
    }

    .hero-main-feature .hero-template-columns {
        grid-template-columns: 1fr !important;
    }

    /* Ensure sub-grid is full width */
    .hero-sub-grid {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        grid-column: auto !important;
    }

    .hero-sub-item {
        width: 100% !important;
        box-sizing: border-box;
    }
}


/* --- ROBUST HEADER/HERO FIX (v58) --- */

/* 1. Ensure Navigation doesn't overlap content */
.magazine-hero-container {
    padding-top: 100px !important; /* Push content down below sticky nav */
}

/* 2. Reset Grid for Mobile (Force Stack) */
@media screen and (max-width: 900px) {
    .magazine-hero-container {
        padding-top: 80px !important; /* Slightly less on mobile */
    }

    .hero-gallery {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 3. Main Feature Card Styling on Mobile */
    .hero-main-feature {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        border-bottom: 2px solid #333;
        margin-bottom: 20px;
        padding-bottom: 20px !important;
    }

    .hero-image-wrapper {
        width: 100% !important;
        height: auto !important;
    }

    .hero-image-wrapper img {
        width: 100% !important;
        height: auto !important;
        max-height: 250px; /* Prevent being 0 height */
        object-fit: cover;
    }

    .hero-content {
        padding: 15px !important;
        text-align: left;
    }

    .hero-content h2 {
        font-size: 1.5rem !important; /* Smaller text on mobile */
    }

    /* 4. Sub Grid Styling */
    .hero-sub-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
    }

    .hero-sub-item {
        display: flex !important;
        flex-direction: row !important; /* Keep icon left, text right */
        align-items: center !important;
        width: 100% !important;
    }
}


/* --- HERO MOBILE REFACTOR (v59) --- */
@media screen and (max-width: 900px) {

    /* MASTER CONTAINER: Force vertical stacking */
    .hero-gallery {
        display: block !important; /* Often safer than flex column for simple stacking */
        width: 100% !important;
        margin-top: 20px !important;
        padding: 0 10px !important;
        box-sizing: border-box !important;
    }

    /* MAIN HERO CARD */
    .hero-main-feature {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        border: 1px solid #333 !important;
        margin-bottom: 30px !important; /* Space before sub-items */
        background: #111 !important;
        padding: 0 !important; /* Remove padding so image touches edges */
    }

    /* IMAGE CONTAINER: FORCE VISIBILITY */
    .hero-main-feature .hero-image-wrapper {
        display: block !important;
        width: 100% !important;
        height: 280px !important; /* EXPLICIT HEIGHT FOR HERO FEEL */
        overflow: hidden !important;
        margin: 0 !important;
        border-bottom: 2px solid #d00 !important; /* Visual separator */
    }

    .hero-main-feature .hero-image-wrapper img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important; /* Ensure it fills the box without stretch */
        object-position: center !important;
    }

    /* HERO CONTENT */
    .hero-main-feature .hero-content {
        padding: 20px !important;
    }

    .hero-main-feature h2 {
        font-size: 1.6rem !important;
        margin-top: 10px !important;
        line-height: 1.2 !important;
    }

    .hero-main-feature p {
        font-size: 1rem !important;
        display: block !important; /* Ensure excerpt is visible */
    }

    /* SUB ITEMS */
    .hero-sub-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
    }

    .hero-sub-item {
        display: flex !important;
        width: 100% !important;
        align-items: center !important;
        background: #0a0a0a !important;
        padding: 10px !important;
        border: 1px solid #222 !important;
    }

    .hero-sub-item img {
        width: 80px !important; /* Larger thumbnail for mobile touch */
        height: 80px !important;
        flex-shrink: 0 !important;
        margin-right: 15px !important;
    }
}


/* --- HIDE DUPLICATE FOOTER COPYRIGHT (v63) --- */
/* The theme seems to have a footer in index.php AND footer.php */
/* We will hide the one inside .social-footer if it's redundant, or style it to match */
/* Actually, let's just ensure the footer.php one is the main one */
footer .container p {
    margin: 5px 0;
}

