
/* ==========================================
   MAGAZINE LISTING PAGE
   ========================================== */

.magazine-listing-page {
    min-height: 55vh;
    background: #f5f7fb;
}

.magazine-listing-page .section {
    padding-top: 70px !important;
    padding-bottom: 90px !important;
}

.magazine-listing-page h1 {
    color: #142747;
    font-size: clamp(30px, 4vw, 42px);
    letter-spacing: -0.5px;
}

.magazine-listing-page .text-muted {
    color: #68778d !important;
}

/* ==========================================
   MAGAZINE EMPTY STATE
   ========================================== */

.magazine-empty-state {
    max-width: 850px;
    margin: 0 auto;
    padding: 48px 24px;
    background: #fff;
    border: 1px solid #e1e7f0;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(20, 39, 71, 0.04);
}

.magazine-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    color: #174a91;
    background: #edf4ff;
    border-radius: 50%;
    font-size: 30px;
}

.magazine-empty-state h2 {
    color: #142747;
}

.magazine-empty-state p {
    margin-top: 12px;
    line-height: 1.8;
}

/* ==========================================
   MAGAZINE LISTING — COVER-ONLY CARDS
   Cover source dimensions: 2480 × 3508 px
   ========================================== */

.magazine-listing-page .magazine-grid {
    align-items: stretch;
}

.magazine-listing-page .magazine-card {
    height: 100%;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(25, 55, 90, 0.10);
    border-radius: 8px;
    box-shadow: 0 5px 18px rgba(20, 42, 70, 0.07);
    transition:
            transform 0.25s ease,
            box-shadow 0.25s ease,
            border-color 0.25s ease;
}

/* Entire cover area is clickable */
.magazine-listing-page .magazine-cover-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 2480 / 3508;
    overflow: hidden;
    background: #f4f7fb;
    text-decoration: none;
}

/* Preserve the complete cover without cropping */
.magazine-listing-page .magazine-cover {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.45s ease;
    transform-origin: center;
}

/* Placeholder when a published record has no cover image */
.magazine-listing-page .magazine-cover-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 100%;
    color: #73849b;
    background: #f4f7fb;
    font-size: 0.95rem;
}

.magazine-listing-page .magazine-cover-placeholder i {
    font-size: 2rem;
}

/* Lift the card and zoom the cover inside its clipped container */
@media (hover: hover) {
    .magazine-listing-page .magazine-card:hover {
        transform: translateY(-4px);
        border-color: rgba(25, 55, 90, 0.22);
        box-shadow: 0 12px 28px rgba(20, 42, 70, 0.13);
    }

    .magazine-listing-page .magazine-cover-link:hover .magazine-cover {
        transform: scale(1.06);
    }
}

/* Keyboard focus */
.magazine-listing-page .magazine-cover-link:focus-visible {
    outline: 3px solid #3157bd;
    outline-offset: -3px;
}

/* ==========================================
   MAGAZINE DETAIL PAGE
   ========================================== */

.magazine-detail-page {
    background: #fff;
}

.magazine-back-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #52647c;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.magazine-back-link:hover {
    color: #087eaa;
}

/* Magazine detail cover */
.magazine-detail-cover {
    overflow: hidden;
    width: 100%;
    background: #f2f5fa;
    border: 1px solid #e5eaf2;
    border-radius: 10px;
}

.magazine-detail-cover-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.magazine-detail-cover-placeholder {
    display: flex;
    min-height: 350px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #60718b;
}

.magazine-detail-cover-placeholder i {
    font-size: 48px;
}

/* Detail content */
.magazine-detail-content {
    padding: 8px 0;
}

.magazine-detail-eyebrow {
    margin-bottom: 14px;
    color: #087eaa;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
}

.magazine-detail-title {
    margin-bottom: 18px;
    color: #172b4d;
    font-size: clamp(27px, 3vw, 40px);
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.magazine-detail-issue {
    color: #52647c;
    font-size: 14px;
}

.magazine-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 22px;
    margin: 22px 0;
    color: #64748b;
    font-size: 14px;
}

.magazine-detail-meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.magazine-detail-description {
    margin: 0 0 28px;
    color: #52647c;
    font-size: 16px;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

/* Read Digital button */
.magazine-digital-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 22px;
    color: #fff;
    background: #087eaa;
    border: 1px solid #087eaa;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.magazine-digital-button:hover {
    color: #fff;
    background: #075d7e;
    border-color: #075d7e;
    transform: translateY(-2px);
}

.magazine-pdf-unavailable {
    padding: 14px 16px;
    color: #64748b;
    background: #f5f7fa;
    border-radius: 6px;
    font-size: 14px;
}

/* ==========================================
   RESPONSIVE STYLES
   ========================================== */

@media (max-width: 767.98px) {
    .magazine-listing-page .section {
        padding-top: 45px !important;
        padding-bottom: 55px !important;
    }

    .magazine-empty-state {
        padding: 35px 18px;
    }

    .magazine-detail-cover {
        max-width: 420px;
        margin: 0 auto;
    }

    .magazine-detail-content {
        padding-top: 0;
    }

    .magazine-detail-description {
        font-size: 15px;
    }

    .magazine-digital-button {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .magazine-listing-page .magazine-grid {
        row-gap: 1rem;
    }

    .magazine-listing-page .magazine-card {
        border-radius: 6px;
    }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    .magazine-listing-page .magazine-card,
    .magazine-listing-page .magazine-cover,
    .magazine-digital-button {
        transition: none;
    }

    .magazine-listing-page .magazine-card:hover,
    .magazine-digital-button:hover {
        transform: none;
    }
}


/* ==========================================
   BREADCRUMB BAR (list, detail and digital pages)
   ========================================== */

.magazine-breadcrumb-bar {
    padding: 10px 0;
    background: #f3f3f3;
}

.magazine-breadcrumb-bar .breadcrumb {
    margin: 0;
    padding: 0;
    background: transparent;
    font-size: .95rem;
}

.magazine-breadcrumb-bar .breadcrumb-item a {
    color: #1596b0;
    text-decoration: none;
}

.magazine-breadcrumb-bar .breadcrumb-item a:hover {
    text-decoration: underline;
}

.magazine-breadcrumb-bar .breadcrumb-item.active {
    color: #172b4d;
}

/* ==========================================
   READ DIGITAL BUTTON — attention animation
   A light wave sweeps across it, then it shakes (every 3s).
   Not applied to the outline back button; skipped entirely
   when the visitor prefers reduced motion.
   ========================================== */

@media (prefers-reduced-motion: no-preference) {
    .magazine-digital-button:not(.magazine-back-button) {
        position: relative;
        overflow: hidden;
        animation: magazine-button-shake 3s ease-in-out infinite;
    }

    .magazine-digital-button:not(.magazine-back-button)::after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 40%;
        height: 100%;
        background: linear-gradient(
                100deg,
                transparent,
                rgba(255, 255, 255, .45),
                transparent
        );
        transform: translateX(-150%) skewX(-20deg);
        animation: magazine-button-shine 3s ease-in-out infinite;
        pointer-events: none;
    }

    /* Stop shaking while the visitor is pointing at it */
    .magazine-digital-button:not(.magazine-back-button):hover {
        animation: none;
    }
}

@keyframes magazine-button-shine {
    0%        { transform: translateX(-150%) skewX(-20deg); }
    40%, 100% { transform: translateX(350%) skewX(-20deg); }
}

@keyframes magazine-button-shake {
    0%, 70%, 100% { transform: translateX(0); }
    74%, 82%, 90% { transform: translateX(-5px); }
    78%, 86%, 94% { transform: translateX(5px); }
}