﻿/* ===== DGT LIBRARY LIST PAGE ===== */

.dgt-library-page {
    min-height: 100vh;
    background: #1A1510;
    color: #F5F5F0;
    padding: 32px;
}
.library-main {
    padding: 0 !important;
    margin: 0 !important;
    width: 100%;
}

.dgt-library-container {
    max-width: 1280px;
    margin: 0 auto;
}

.dgt-library-header {
    border-bottom: 1px solid rgba(212, 175, 55, 0.35);
    padding-bottom: 24px;
    margin-bottom: 32px;
}

    .dgt-library-header h1 {
        margin: 0;
        font-size: 48px;
        font-weight: 800;
    }

        .dgt-library-header h1 span {
            color: #D4AF37;
        }

    .dgt-library-header p {
        margin-top: 6px;
        color: #b8b8b8;
        font-style: italic;
    }

/* ===== GRID ===== */

.dgt-presentation-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 32px;
}

.dgt-presentation-card {
    display: block;
    background: #2A2420;
    color: #F5F5F0;
    text-decoration: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

    .dgt-presentation-card:hover {
        color: #F5F5F0;
        transform: translateY(-6px);
        box-shadow: 0 12px 28px rgba(212, 175, 55, 0.22);
    }

    .dgt-presentation-card img {
        width: 100%;
        height: 160px;
        object-fit: cover;
        display: block;
    }

.dgt-card-body {
    padding: 18px 12px;
    text-align: center;
}

    .dgt-card-body h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 800;
    }

    .dgt-card-body p {
        margin: 4px 0 0;
        font-size: 13px;
        color: #c9c9c9;
    }

/* ===== RESPONSIVE GRID ===== */

@media (max-width: 1100px) {
    .dgt-presentation-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 800px) {
    .dgt-presentation-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .dgt-library-page {
        padding: 20px;
    }

    .dgt-library-header h1 {
        font-size: 38px;
    }

    .dgt-presentation-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== DETAIL PAGE ===== */

.dgt-library-detail-page {
    min-height: calc(100vh - 120px);
    background: #1A1510;
    color: #F5F5F0;
    display: flex;
    justify-content: center;
    padding: 24px 0;
}

/* Full-width feel with 2mm margins */
.dgt-library-detail-shell {
    width: calc(100% - 4mm);
    max-width: 720px;
    margin: 0 auto;
    border-left: 1px solid rgba(212, 175, 55, 0.25);
    border-right: 1px solid rgba(212, 175, 55, 0.25);
    padding-bottom: 28px;
    position: relative;
}

/* ===== STICKY HEADER ===== */

.dgt-detail-header {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(26, 21, 16, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.12);
}

/* Scroll fade */
.dgt-library-detail-shell::before {
    content: "";
    position: sticky;
    top: 72px;
    display: block;
    height: 28px;
    margin-bottom: -28px;
    z-index: 15;
    pointer-events: none;
    background: linear-gradient( to bottom, rgba(26, 21, 16, 0.95), rgba(26, 21, 16, 0) );
}

/* ===== HEADER ELEMENTS ===== */

.dgt-back-link {
    color: #D4AF37;
    text-decoration: none;
    font-style: italic;
}

    .dgt-back-link:hover {
        color: #F5F5F0;
    }

.dgt-bookmark-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 55, 0.35);
    background: transparent;
    color: #D4AF37;
}

/* ===== IMAGE ===== */

.dgt-detail-image-wrap {
    margin: 0 24px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    padding: 4px;
    background: #2A2420;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

    .dgt-detail-image-wrap:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    }

.dgt-detail-image {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
}

/* ===== AUDIO ===== */

.dgt-audio-box {
    margin: 16px 24px 0;
}

.dgt-audio {
    width: 100%;
    filter: sepia(0.3) hue-rotate(10deg) brightness(0.95);
}

/* ===== CONTENT ===== */

.dgt-detail-content {
    padding: 24px 24px 0;
}

.dgt-chapter-label {
    color: #D4AF37;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.08em;
}

.dgt-detail-content h1 {
    margin-top: 8px;
    margin-bottom: 8px;
    font-size: 34px;
    font-weight: 800;
    color: #F5F5F0;
}

.dgt-subtitle {
    color: #D4AF37;
    font-style: italic;
    font-size: 18px;
}

.dgt-detail-content hr {
    border-color: rgba(212, 175, 55, 0.25);
    margin: 20px 0;
}

.dgt-description {
    color: #c9c9c9;
    font-size: 14px;
    line-height: 1.6;
}

/* ===== META ===== */

.dgt-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    padding: 24px;
}

.dgt-meta-card {
    background: #2A2420;
    padding: 16px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

    .dgt-meta-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    }

.dgt-meta-label {
    color: #b8b8b8;
    font-size: 12px;
}

.dgt-meta-value {
    margin-top: 8px;
    color: #F5F5F0;
    font-weight: 600;
}

/* ===== VIDEO ===== */

.dgt-video-box {
    position: relative;
    margin: 16px 24px 0;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.35);
    background: #000;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

    .dgt-video-box:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    }

    .dgt-video-box iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

/* ===== MOBILE POLISH ===== */

@media (max-width: 576px) {

    .dgt-library-detail-shell {
        width: calc(100% - 4mm);
        max-width: none;
    }

    .dgt-detail-header {
        padding: 18px;
    }

    .dgt-library-detail-shell::before {
        top: 70px;
        height: 24px;
        margin-bottom: -24px;
    }

    .dgt-detail-image-wrap {
        margin: 0 18px;
    }

    .dgt-detail-image {
        height: auto;
        max-height: 420px;
    }

    .dgt-audio-box {
        margin: 16px 18px 0;
    }

    .dgt-detail-content {
        padding: 24px 18px 0;
    }

    .dgt-meta-grid {
        padding: 24px 18px;
        gap: 14px;
    }
}
/* ===== ADVANCED MOBILE POLISH ===== */

/* iOS-style compact sticky header */
@media (max-width: 576px) {
    .dgt-detail-header {
        min-height: 64px;
        padding: 12px 18px;
        transition: padding 0.25s ease, background 0.25s ease;
    }

    .dgt-back-link {
        font-size: 18px;
    }

    .dgt-bookmark-btn {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }
}

/* Immersive media treatment */
.dgt-detail-image-wrap {
    border-radius: 10px;
    overflow: hidden;
}

.dgt-detail-image {
    border-radius: 6px;
}

.dgt-audio-box {
    background: rgba(42, 36, 32, 0.85);
    border-radius: 12px;
    padding: 8px;
    border: 1px solid rgba(212, 175, 55, 0.18);
}

.dgt-audio {
    display: block;
    border-radius: 999px;
}

/* Full-width immersive media on mobile */
@media (max-width: 576px) {
    .dgt-detail-image-wrap {
        margin-left: 12px;
        margin-right: 12px;
        padding: 3px;
    }

    .dgt-audio-box {
        margin-left: 12px;
        margin-right: 12px;
    }

    .dgt-video-box {
        margin-left: 12px;
        margin-right: 12px;
        border-radius: 10px;
    }
}

/* Stronger cinematic detail image on larger screens */
@media (min-width: 768px) {
    .dgt-detail-image {
        height: 360px;
    }
}

/* =========================================
   GLOBAL DARK BLEED FIX (LIBRARY ONLY)
   ========================================= */

/* Force full page dark */
html,
body.theme-library,
body:has(.dgt-library-page) {
    background: #140f0b !important;
}

    /* Kill Bootstrap white containers */
    body.theme-library .container,
    body.theme-library .container-fluid,
    body:has(.dgt-library-page) .container,
    body:has(.dgt-library-page) .container-fluid {
        background: transparent !important;
    }

    /* Ensure main fills screen */
    body.theme-library main,
    body:has(.dgt-library-page) main {
        background: transparent !important;
        min-height: calc(100vh - 120px);
    }

    /* FOOTER FIX (this is your main issue) */
    body.theme-library .footer,
    body:has(.dgt-library-page) .footer {
        background: #140f0b !important;
        color: #b8b2a8 !important;
        border-top: 1px solid rgba(212, 175, 55, 0.2) !important;
    }

        /* Remove light footer override from site.css */
        body.theme-library .footer * {
            background: transparent !important;
        }

/* ===== LIBRARY DETAIL: DOCUMENT + QR LAYOUT ===== */

.dgt-evidence-media-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 20px;
    align-items: start;
    margin: 0 24px;
}

.dgt-evidence-main-image-wrap,
.dgt-evidence-qr-wrap {
    background: #2A2420;
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 10px;
    padding: 4px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

    .dgt-evidence-main-image-wrap:hover,
    .dgt-evidence-qr-wrap:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 24px rgba(212, 175, 55, 0.18);
    }

.dgt-evidence-main-image {
    width: 100%;
    max-height: 680px;
    object-fit: contain;
    display: block;
    background: #fff;
    border-radius: 6px;
}

.dgt-evidence-qr-image {
    width: 100%;
    height: auto;
    display: block;
    background: #fff;
    border-radius: 6px;
}

@media (max-width: 576px) {
    .dgt-evidence-media-grid {
        grid-template-columns: 1fr;
        margin: 0 12px;
        gap: 14px;
    }

    .dgt-evidence-qr-wrap {
        max-width: 180px;
        margin-left: auto;
        margin-right: auto;
    }

    .dgt-evidence-main-image {
        max-height: none;
    }
}

.dgt-pdf-viewer-wrap {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.75);
    border-radius: 10px;
    background: #111;
}

.dgt-pdf-viewer {
    width: 100%;
    max-width: 100%;
    height: 78vh;
    min-height: 620px;
    border: 0;
    display: block;
}

@media (max-width: 768px) {
    .dgt-pdf-viewer-wrap {
        margin-inline: auto;
    }

    .dgt-pdf-viewer {
        width: 100%;
        height: 70vh;
        min-height: 520px;
    }
}

.dgt-pdf-actions {
    margin: 0 0 14px 0;
}

.dgt-pdf-open-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid rgba(212, 175, 55, 0.8);
    border-radius: 999px;
    color: #f5d76e;
    text-decoration: none;
    font-weight: 700;
    background: rgba(212, 175, 55, 0.08);
}

    .dgt-pdf-open-btn:hover {
        color: #fff2a8;
        box-shadow: 0 0 16px rgba(212, 175, 55, 0.35);
    }
