/* =======================================================
   PUBLICATIONS.CSS — Dedicated Publication Directory, Search, Grid & Paper Reader
   Pure High-Contrast Brutalist Paper Architecture
   ======================================================= */

.publication-template {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(16px, 4vw, 40px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 1 0 auto;
}

/* --- HEADER FORMAT (MATCHES PUBLICATIONS & ABOUT US) --- */
.publication-header-wrap {
    width: 100%;
    margin-bottom: 30px;
    box-sizing: border-box;
}

/* --- TOPIC INTRO / FEATURED SECTION BOX (JOURNEYS) --- */
.publication-intro-box {
    width: 100%;
    max-width: 900px;
    margin: 0 auto 40px auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(32px, 4vw, 42px) clamp(20px, 3.5vw, 35px);
    background: #ffffff;
    border: 4px solid #000000;
    border-radius: 16px;
    box-shadow: 6px 6px 0px #000000;
    box-sizing: border-box;
}

.journeys-intro-title {
    font-family: 'Arial Black', Impact, sans-serif;
    font-size: clamp(1.3rem, 2.3vw, 1.85rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 14px 0;
    color: #000000;
    line-height: 1.25;
}

.journeys-intro-desc {
    font-family: sans-serif;
    font-size: clamp(0.95rem, 1.15vw, 1.08rem);
    line-height: 1.55;
    color: #222222;
    font-weight: 600;
    max-width: 750px;
    margin: 0 auto;
}

/* --- DEDICATED PUBLICATION BOOK CARDS (NEO-BRUTALIST BOOK SPINE VIBE) --- */
.publication-book-card {
    border: 5px solid #000000;
    border-left: 20px solid #000000; /* Thick left book spine */
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 6px 6px 0px #000000;
    cursor: pointer;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.publication-book-card:hover {
    transform: translateY(-8px);
    box-shadow: 10px 10px 0px #000000;
}

.publication-book-card:focus-visible {
    outline: 4px solid #000000;
    outline-offset: 4px;
}

/* Book Cover Window (Displays Title placed in center middle, no thumbnail, no border) */
.book-cover-window {
    width: 100%;
    margin: 16px 0 10px 0;
    min-height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    box-sizing: border-box;
    text-align: center;
    border: none;
    background: transparent;
    box-shadow: none;
}

.book-cover-title {
    font-family: 'Arial Black', Gadget, Impact, sans-serif;
    font-size: clamp(1.2rem, 1.9vw, 1.55rem);
    font-weight: 900;
    line-height: 1.22;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    word-break: break-word;
}

/* Book Details Body */
.book-details-body {
    padding: 4px 16px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    box-sizing: border-box;
}

.book-meta {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: #444444;
    margin-bottom: 12px;
}

/* Journeys Quote Field */
.book-journey-quote {
    font-family: 'Georgia', serif;
    font-style: italic;
    font-size: 0.92rem;
    line-height: 1.45;
    color: #111111;
    background: #f6f6f6;
    border-left: 4px solid #000000;
    padding: 10px 14px;
    margin: 0 0 14px 0;
    border-radius: 0 8px 8px 0;
    box-sizing: border-box;
}

/* Action Buttons: Read Paper & Open PDF */
.book-card-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    align-items: center;
}

.book-action-read {
    flex: 1;
    background: #000000;
    color: #ffffff;
    border: 3px solid #000000;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
    font-family: 'Arial Black', sans-serif;
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 2px 2px 0px #000000;
}

.book-action-read:hover {
    background: #ffffff;
    color: #000000;
}

.book-action-open {
    background: #ffffff;
    color: #000000;
    border: 3px solid #000000;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
    font-family: 'Arial Black', sans-serif;
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 2px 2px 0px #000000;
    white-space: nowrap;
}

.book-action-open:hover {
    background: #000000;
    color: #ffffff;
}

/* --- 3x1 ITEMS GRID --- */
.publication-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
    width: 100%;
    margin-bottom: 40px;
    box-sizing: border-box;
}

/* --- INTUITIVE PAGE NAVIGATOR --- */
.publication-pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 0 auto 35px auto;
    width: 100%;
    flex-wrap: wrap;
    box-sizing: border-box;
}

.pagination-btn {
    background: #000000;
    color: #ffffff;
    border: 4px solid #000000;
    border-radius: 50px;
    padding: 12px 24px;
    font-family: 'Arial Black', Gadget, sans-serif;
    font-size: 0.9rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 4px 4px 0px #000000;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.pagination-btn:hover:not(:disabled) {
    background: #ffffff;
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 6px 6px 0px #000000;
}

.pagination-btn:disabled {
    background: #ffffff;
    color: #000000;
    border: 4px solid #000000;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.28;
    transform: none;
}

.pagination-info {
    font-family: 'Arial Black', Gadget, sans-serif;
    font-size: 0.92rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #000000;
    padding: 10px 20px;
    border: 3px solid #000000;
    border-radius: 50px;
    background: #ffffff;
    box-shadow: 3px 3px 0px #000000;
    white-space: nowrap;
    user-select: none;
}

/* --- EMPTY SEARCH STATE --- */
.publication-empty-state {
    grid-column: 1 / -1;
    border: 4px dashed #000000;
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: #ffffff;
    box-sizing: border-box;
}

.empty-state-title {
    font-family: 'Arial Black', Gadget, sans-serif;
    font-size: 1.25rem;
    font-weight: 900;
    text-transform: uppercase;
    margin: 0;
}

.empty-state-desc {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #444;
    margin: 0;
}

/* Bottom Nav Button */
.publication-footer-nav {
    margin-top: 20px;
    margin-bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* =======================================================
   DISTRACTION-FREE IN-PAGE PDF READER VIEW
   Keeps site header banner and footer fully visible!
   ======================================================= */
.publication-reader-view {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 10px;
    box-sizing: border-box;
}

/* Top Action: Open PDF Black Pill button above reader */
.reader-top-action {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.reader-open-pdf-pill {
    background: #000000;
    color: #ffffff;
    border: 4px solid #000000;
    border-radius: 50px;
    padding: 12px 28px;
    font-family: 'Arial Black', Gadget, sans-serif;
    font-size: 0.95rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    cursor: pointer;
    box-shadow: 4px 4px 0px #000000;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reader-open-pdf-pill:hover {
    background: #ffffff;
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 6px 6px 0px #000000;
}

/* Fitted PDF Paper Stage: No borders, pure white */
.reader-paper-wrap {
    position: relative;
    background: #ffffff;
    width: 100%;
    max-width: 840px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.reader-paper-wrap canvas {
    width: 100%;
    height: auto;
    display: block;
    background: #ffffff;
    border: none;
}

.zl-reader-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.zl-reader-loading-text {
    font-family: 'Arial Black', sans-serif;
    font-size: 1rem;
    font-weight: 900;
    color: #000000;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

/* Page Navigator directly under the paper */
.reader-pagination {
    margin-top: 32px;
    margin-bottom: 24px;
}

/* Go Back button under the page navigator */
.reader-footer-nav {
    margin-top: 10px;
    margin-bottom: 30px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.reader-footer-nav .goback-btn-black {
    white-space: nowrap !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* =======================================================
   RESPONSIVE OVERRIDES (TABLET & MOBILE)
   ======================================================= */
@media (max-width: 1024px) {
    .publication-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 640px) {
    .publication-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .publication-pagination-bar {
        gap: 10px;
    }

    .pagination-btn {
        padding: 10px 18px;
        font-size: 0.8rem;
    }

    .pagination-info {
        font-size: 0.8rem;
        padding: 8px 14px;
    }

    /* Mobile Reader: Flush with screen sides for vertical scrolling */
    .publication-reader-view {
        padding-top: 0;
    }

    .reader-paper-wrap {
        width: 100vw;
        max-width: 100vw;
        margin-left: -16px;
        margin-right: -16px;
    }

    .reader-paper-wrap canvas {
        width: 100vw;
    }

    .reader-open-pdf-pill {
        padding: 10px 22px;
        font-size: 0.85rem;
    }
}
