/* ============================================================
   Press Gallery 61 — Stylesheet
   ============================================================ */

.pg61-wrap {
    position: relative;
    width: 100%;
    height: 720px;
    overflow: hidden;
    background: #0c0906;
    font-family: 'Georgia', serif;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.9s;
}
.pg61-wrap.night { background: #060402; }

/* ── Canvas ─────────────────────────────────────────────── */
.pg61-canvas-host {
    position: absolute; inset: 0; z-index: 1;
}
.pg61-canvas-host canvas {
    display: block; width: 100% !important; height: 100% !important;
}

/* ── Sheets overlay ─────────────────────────────────────── */
.pg61-sheets-overlay {
    position: absolute; inset: 0; z-index: 2; pointer-events: none;
}

/* ── Individual sheet ───────────────────────────────────── */
.pg61-sheet {
    position: absolute;
    pointer-events: all;
    cursor: pointer;
    transform-origin: top center;
    will-change: transform, top, opacity;
    transition: box-shadow 0.2s;
}
.pg61-sheet-paper {
    position: relative;
    background: #f0e8d0;
    border-radius: 1px;
    overflow: hidden;
    box-shadow:
        2px 3px 0 rgba(0,0,0,0.25),
        4px 6px 12px rgba(0,0,0,0.5),
        inset 0 0 30px rgba(0,0,0,0.06);
}
/* Worn paper edges */
.pg61-sheet-paper::before {
    content: '';
    position: absolute; inset: 0; z-index: 5;
    background:
        linear-gradient(to right,  rgba(0,0,0,0.08) 0%, transparent 4%, transparent 96%, rgba(0,0,0,0.08) 100%),
        linear-gradient(to bottom, rgba(0,0,0,0.06) 0%, transparent 3%, transparent 97%, rgba(0,0,0,0.06) 100%);
    pointer-events: none;
    border-radius: 1px;
}
/* Ink age overlay — wet=dark tint, dry=faded */
.pg61-sheet-paper::after {
    content: '';
    position: absolute; inset: 0; z-index: 4;
    pointer-events: none;
    border-radius: 1px;
    /* set via JS inline style */
}
.pg61-sheet img {
    display: block; width: 100%; height: 100%;
    object-fit: cover;
    mix-blend-mode: multiply;
    opacity: 0.88;
}
/* Printed title bar at bottom of sheet */
.pg61-sheet-title {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 6;
    background: rgba(240,232,208,0.92);
    padding: 4px 6px 3px;
    border-top: 1px solid rgba(0,0,0,0.15);
    font-size: 10px; letter-spacing: 1.5px; color: #1a1208;
    text-transform: uppercase; text-align: center;
    font-family: 'Georgia', serif;
    line-height: 1.2;
}
.pg61-sheet-subtitle {
    font-size: 8px; color: #4a3820; letter-spacing: 1px;
    display: block; margin-top: 1px; opacity: 0.75;
}
/* Hover lift */
.pg61-sheet:hover .pg61-sheet-paper {
    box-shadow:
        2px 3px 0 rgba(0,0,0,0.2),
        6px 10px 24px rgba(0,0,0,0.55),
        0 0 0 1px rgba(200,160,80,0.3);
    transform: translateY(-3px) rotate(-0.3deg);
}

/* Fresh ink shimmer — applied via JS class */
.pg61-sheet.fresh-ink .pg61-sheet-paper {
    box-shadow:
        2px 3px 0 rgba(0,0,0,0.3),
        4px 6px 16px rgba(0,0,0,0.6),
        0 0 20px rgba(0,0,0,0.4);
}

/* ── Lever ──────────────────────────────────────────────── */
.pg61-lever-wrap {
    position: absolute;
    right: 22px; top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex; flex-direction: column; align-items: center; gap: 0;
    cursor: pointer; touch-action: manipulation;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.8));
}
.pg61-lever-track {
    width: 14px; height: 180px;
    background: linear-gradient(to bottom, #2a1808, #4a2e10, #2a1808);
    border: 1px solid #6a3e18; border-radius: 7px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8), 0 0 14px rgba(0,0,0,0.6);
    position: relative;
}
.pg61-lever-arm {
    position: absolute;
    left: 50%; top: 20%;
    transform: translate(-50%, 0) rotate(0deg);
    transform-origin: 50% 0%;
    width: 10px; height: 120px;
    background: linear-gradient(to right, #4a2e10, #8a5e28, #4a2e10);
    border-radius: 5px;
    transition: transform 0.05s;
    will-change: transform;
}
.pg61-lever-knob {
    position: absolute; bottom: -14px; left: 50%;
    transform: translateX(-50%);
    width: 28px; height: 28px;
    background: radial-gradient(circle at 35% 35%, #e8c060 0%, #a07828 40%, #4a2e08 100%);
    border-radius: 50%; border: 2px solid #7a5018;
    box-shadow: 0 2px 10px rgba(0,0,0,0.8), 0 0 4px rgba(220,180,60,0.3);
}
.pg61-lever-label {
    font-size: 9px; letter-spacing: 3px; color: #8a6030;
    text-transform: uppercase; margin-top: 8px;
}

/* Lever pulled state (JS toggles class) */
.pg61-lever-wrap.pulled .pg61-lever-arm {
    transform: translate(-50%, 0) rotate(35deg);
}

/* ── HUD ────────────────────────────────────────────────── */
.pg61-hud {
    position: absolute; bottom: 16px; left: 16px;
    z-index: 10; display: flex; flex-direction: column; gap: 6px;
}
.pg61-hud-row { display: flex; align-items: center; gap: 8px; }
.pg61-hud-label {
    font-size: 9px; letter-spacing: 2.5px; color: #c0a060; text-transform: uppercase;
    min-width: 68px;
}
.pg61-hud-bar {
    width: 100px; height: 7px;
    background: #120a03; border: 1px solid #5a4010; border-radius: 4px;
    overflow: hidden; box-shadow: inset 0 1px 4px rgba(0,0,0,0.9);
}
.pg61-hud-fill {
    height: 100%; width: 0%;
    background: linear-gradient(to right, #1a0a00, #3a1800, #8a3800, #c06010);
    border-radius: 4px; transition: width 0.1s ease-out;
    box-shadow: 0 0 6px rgba(180,90,20,0.7);
}
.pg61-hud-count {
    font-size: 15px; color: #c0a060; font-weight: bold;
    font-variant-numeric: tabular-nums; letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(200,160,60,0.5);
}

/* ── Night toggle ───────────────────────────────────────── */
.pg61-night-btn {
    position: absolute; top: 14px; right: 14px; z-index: 10;
    width: 30px; height: 30px;
    background: #1a0e06; border: 1px solid #5a4010; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 16px; line-height: 1;
    box-shadow: 0 1px 6px rgba(0,0,0,0.8); transition: background 0.2s;
}
.pg61-night-btn:hover { background: #3a1c08; box-shadow: 0 0 10px rgba(255,200,80,0.3); }

/* ── Lightbox ───────────────────────────────────────────── */
.pg61-lb-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(2,1,0,0.96); z-index: 9998;
    cursor: pointer; backdrop-filter: blur(6px);
}
.pg61-lightbox {
    display: none; position: fixed; top: 50%; left: 50%;
    transform: translate(-50%,-50%) scale(0.93) rotate(-0.5deg);
    z-index: 9999; max-width: 88vw; text-align: center;
    opacity: 0; transition: opacity 0.3s, transform 0.3s;
}
.pg61-lightbox.open {
    display: block; opacity: 1; transform: translate(-50%,-50%) scale(1) rotate(0deg);
}
.pg61-lb-backdrop.open { display: block; }

.pg61-lb-sheet {
    display: inline-block;
    background: #f0e8d0;
    border-radius: 1px;
    overflow: hidden;
    box-shadow:
        4px 6px 0 rgba(0,0,0,0.3),
        8px 12px 40px rgba(0,0,0,0.95),
        inset 0 0 40px rgba(0,0,0,0.06);
    position: relative;
}
.pg61-lb-sheet::before {
    content: '';
    position: absolute; inset: 0; z-index: 5;
    background:
        linear-gradient(to right,  rgba(0,0,0,0.1) 0%, transparent 5%, transparent 95%, rgba(0,0,0,0.1) 100%),
        linear-gradient(to bottom, rgba(0,0,0,0.08) 0%, transparent 4%, transparent 96%, rgba(0,0,0,0.08) 100%);
    pointer-events: none;
}
.pg61-lb-img {
    max-width: 100%; max-height: 65vh; object-fit: contain; display: block;
    mix-blend-mode: multiply; opacity: 0.9;
}
.pg61-lb-title {
    padding: 8px 16px 2px;
    font-size: 14px; letter-spacing: 3px; color: #1a1208;
    text-transform: uppercase; font-family: 'Georgia', serif;
}
.pg61-lb-subtitle {
    padding: 0 16px 10px;
    font-size: 11px; color: #4a3820; letter-spacing: 1.5px; font-style: italic;
}
.pg61-lb-link {
    display: inline-block; margin-top: 12px;
    color: #c0a040; font-size: 12px; letter-spacing: 1.5px;
    text-decoration: none; border-bottom: 1px solid #7a6020;
    transition: color 0.2s;
}
.pg61-lb-link:hover { color: #ffe090; }
.pg61-lb-link[href='#'] { display: none; }
.pg61-lb-close {
    position: absolute; top: -14px; right: -14px;
    width: 30px; height: 30px;
    background: #4a3010; border: 2px solid #c0a040; color: #c0a040;
    border-radius: 50%; cursor: pointer; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    z-index: 10000; transition: background 0.2s;
}
.pg61-lb-close:hover { background: #7a1800; }

/* ── Night overrides ────────────────────────────────────── */
.pg61-wrap.night .pg61-hud-label    { color: #7a5820; }
.pg61-wrap.night .pg61-hud-fill     { box-shadow: 0 0 10px rgba(200,100,20,0.9); }
.pg61-wrap.night .pg61-sheet-paper  { box-shadow: 2px 3px 0 rgba(0,0,0,0.4), 4px 6px 20px rgba(0,0,0,0.8), 0 0 15px rgba(220,160,60,0.08); }

/* ── Responsive ─────────────────────────────────────────── */
@media(max-width:768px){
    .pg61-wrap { height:520px; }
    .pg61-lever-track { height:140px; }
    .pg61-lever-arm { height:90px; }
    .pg61-hud-bar { width:72px; }
}
@media(max-width:480px){
    .pg61-wrap { height:430px; }
    .pg61-lever-wrap { right:10px; }
}
