/**
 * Publications Page Styles
 */

.pubs-page-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px 60px;
}

/* ── Page intro ────────────────────────────────────────────────────────── */

.pubs-intro {
    text-align: center;
    margin-bottom: 40px;
}

.pubs-page-title {
    font-size: 2em;
    font-weight: 700;
    color: #2c5f8d;
    margin: 0 0 10px;
}

.pubs-page-desc {
    font-size: 1em;
    color: #555;
    line-height: 1.65;
    max-width: 720px;
    margin: 0 auto;
}

/* ── The Book ──────────────────────────────────────────────────────────── */

.pubs-book {
    background: #f8f9fa;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    padding: 36px 40px;
    margin-bottom: 56px;
}

.pubs-book-inner {
    display: flex;
    align-items: center;
    gap: 36px;
}

.pubs-book-cover img,
.pubs-book-img2 img {
    max-height: 220px;
    width: auto;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    display: block;
}

.pubs-book-text {
    flex: 1;
}

.pubs-book-title {
    font-size: 1.9em;
    font-weight: 700;
    color: #2c5f8d;
    margin: 0 0 12px;
}

.pubs-book-desc {
    font-size: 1em;
    line-height: 1.65;
    color: #444;
    margin: 0 0 20px;
}

.pubs-book-btn {
    display: inline-block;
    background: #2c5f8d;
    color: #fff;
    padding: 10px 24px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9em;
    text-decoration: none;
    transition: background 0.2s;
}

.pubs-book-btn:hover {
    background: #1e4a70;
    color: #fff;
}

/* ── Section chrome ────────────────────────────────────────────────────── */

.pubs-section {
    margin-bottom: 52px;
}

.pubs-section-header {
    margin-bottom: 18px;
    border-bottom: 2px solid #e0e6ed;
    padding-bottom: 10px;
}

.pubs-section-title {
    font-size: 1.5em;
    font-weight: 700;
    color: #2c5f8d;
    margin: 0 0 4px;
}

.pubs-section-desc {
    font-size: 0.92em;
    color: #666;
    margin: 0;
}

.pubs-browse-all {
    display: inline-block;
    margin-top: 14px;
    font-size: 0.9em;
    font-weight: 600;
    color: #2c5f8d;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.pubs-browse-all:hover {
    border-bottom-color: #2c5f8d;
    color: #2c5f8d;
}

/* ── Recent grid (Yearbooks + Newsletters) ─────────────────────────────── */

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

.pubs-card {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e0e6ed;
    background: #fff;
    transition: box-shadow 0.2s, transform 0.2s;
}

.pubs-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.pubs-card-thumb {
    aspect-ratio: 3/4;
    overflow: hidden;
    background: #f0f4f8;
}

.pubs-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pubs-card-thumb--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    color: #999;
    text-align: center;
    padding: 10px;
}

.pubs-card-label {
    padding: 8px 10px;
    font-size: 0.8em;
    font-weight: 600;
    color: #333;
    text-align: center;
    border-top: 1px solid #eee;
}

/* ── Carousel (Marlinspike + Tech Tips) ────────────────────────────────── */

.pubs-carousel-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pubs-carousel {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0 12px;
    flex: 1;
    /* hide scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.pubs-carousel::-webkit-scrollbar {
    display: none;
}

.pubs-carousel-card {
    flex: 0 0 180px;
    scroll-snap-align: start;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e0e6ed;
    background: #fff;
    transition: box-shadow 0.2s, transform 0.2s;
}

.pubs-carousel-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.pubs-carousel-thumb {
    aspect-ratio: 3/4;
    overflow: hidden;
    background: #f0f4f8;
}

.pubs-carousel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pubs-carousel-thumb--placeholder {
    background: #e8edf2;
}

.pubs-carousel-card-title {
    padding: 8px 10px;
    font-size: 0.78em;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    border-top: 1px solid #eee;
}

.pubs-carousel-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #2c5f8d;
    background: #fff;
    color: #2c5f8d;
    font-size: 1.4em;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    padding: 0;
}

.pubs-carousel-btn:hover {
    background: #2c5f8d;
    color: #fff;
}

.pubs-carousel-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .pubs-book-inner {
        flex-wrap: wrap;
        gap: 24px;
    }

    .pubs-book-img2 {
        display: none;
    }

    .pubs-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 640px) {
    .pubs-page-wrap {
        padding: 20px 15px 40px;
    }

    .pubs-book {
        padding: 24px 20px;
    }

    .pubs-book-cover img {
        max-height: 160px;
    }

    .pubs-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .pubs-carousel-btn {
        display: none;
    }

    .pubs-carousel-card {
        flex: 0 0 140px;
    }
}

@media (max-width: 420px) {
    .pubs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
