:root {
    --magazine-primary: var(--primary, #13C5DD);
    --magazine-secondary: var(--secondary, #354F8E);
    --magazine-light: var(--light, #EFF5F9);
    --magazine-dark: var(--dark, #1D2A4D);
}

.latest-edition {
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, .06);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 18px 46px rgba(29, 42, 77, .11);
}

.latest-cover-column {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 480px;
    padding: 42px;
    background:
        radial-gradient(circle at 20% 15%, rgba(19, 197, 221, .32), transparent 34%),
        linear-gradient(145deg, #17233f, #263a69);
}

.magazine-cover {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #fff;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(0, 0, 0, .20)),
        linear-gradient(145deg, #13C5DD 0%, #354F8E 58%, #1D2A4D 100%);
    box-shadow: 0 20px 40px rgba(0, 0, 0, .32);
}

.magazine-cover::before {
    position: absolute;
    content: "";
    width: 230px;
    height: 230px;
    top: 22%;
    right: -110px;
    border: 34px solid rgba(255, 255, 255, .11);
    border-radius: 50%;
}

.magazine-cover::after {
    position: absolute;
    content: "";
    width: 150px;
    height: 150px;
    bottom: -70px;
    left: -55px;
    border: 24px solid rgba(255, 255, 255, .09);
    border-radius: 50%;
}

.magazine-cover-large {
    width: min(310px, 100%);
    min-height: 405px;
    padding: 30px 26px;
    border-radius: 5px 14px 14px 5px;
    transform: perspective(900px) rotateY(5deg);
}

.magazine-cover-large::selection,
.magazine-cover-small::selection {
    background: transparent;
}

.magazine-cover-small {
    min-height: 310px;
    padding: 23px 20px;
    border-radius: 12px 12px 0 0;
    box-shadow: none;
}

.cover-brand {
    position: relative;
    z-index: 1;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .22em;
}

.cover-line {
    position: relative;
    z-index: 1;
    width: 48px;
    height: 4px;
    margin: 13px 0 24px;
    border-radius: 3px;
    background: #fff;
}

.cover-topic {
    position: relative;
    z-index: 1;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .28em;
    opacity: .82;
}

.cover-title {
    position: relative;
    z-index: 1;
    max-width: 95%;
    font-family: "Jost", sans-serif;
    font-size: 31px;
    font-weight: 800;
    line-height: 1.08;
    text-shadow: 0 3px 12px rgba(0, 0, 0, .18);
}

.magazine-cover-small .cover-title {
    font-size: 23px;
}

.cover-edition {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding-top: 30px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
}

.latest-edition-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    height: 100%;
    min-height: 480px;
    padding: 48px 52px;
}

.edition-kicker {
    display: inline-flex;
    align-items: center;
    margin-bottom: 14px;
    color: var(--magazine-primary);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.latest-edition-copy h2 {
    margin-bottom: 10px;
    color: var(--magazine-dark);
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 800;
    line-height: 1.08;
}

.edition-date {
    color: var(--magazine-secondary);
    font-weight: 700;
}

.edition-summary {
    max-width: 660px;
    margin: 10px 0 24px;
    color: #647089;
    font-size: 16px;
    line-height: 1.75;
}

.viewer-privacy-note {
    margin: 15px 0 0;
    color: #788399;
    font-size: 12px;
}

.section-heading {
    max-width: 760px;
}

.archive-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, .07);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(29, 42, 77, .07);
    transition: transform .25s ease, box-shadow .25s ease;
}

.archive-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 38px rgba(29, 42, 77, .14);
}

.archive-card-body {
    padding: 22px;
}

.archive-date {
    color: var(--magazine-primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.archive-card-body h3 {
    margin-bottom: 10px;
    color: var(--magazine-dark);
    font-size: 19px;
    font-weight: 800;
}

.archive-card-body p {
    color: #6c768c;
    font-size: 14px;
}

.archive-card-body a {
    color: var(--magazine-secondary);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.empty-magazine {
    max-width: 680px;
    margin: 0 auto;
    padding: 70px 24px;
    border: 1px dashed rgba(19, 197, 221, .45);
    border-radius: 20px;
    background: var(--magazine-light);
}

.empty-magazine-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 86px;
    height: 86px;
    margin-bottom: 20px;
    border-radius: 26px;
    color: #fff;
    background: var(--magazine-primary);
    font-size: 37px;
}

.empty-magazine h2 {
    color: var(--magazine-dark);
    font-weight: 800;
}

.magazine-detail-header {
    color: #fff;
    background:
        radial-gradient(circle at 85% 10%, rgba(19, 197, 221, .35), transparent 28%),
        linear-gradient(120deg, #1D2A4D, #354F8E);
}

.magazine-detail-header h1 {
    margin: 0 0 8px;
    color: #fff;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 800;
}

.magazine-detail-header p {
    margin: 0;
    color: rgba(255, 255, 255, .75);
    font-weight: 700;
}

.magazine-breadcrumb {
    margin-bottom: 18px;
}

.magazine-breadcrumb a {
    color: rgba(255, 255, 255, .82);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.magazine-breadcrumb a:hover {
    color: #fff;
}

.magazine-reader-section {
    min-height: 70vh;
    background: #e9eef4;
}

.magazine-viewer {
    width: min(1500px, 100%);
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, .16);
    border-radius: 16px;
    background: #172033;
    box-shadow: 0 18px 50px rgba(15, 25, 45, .23);
}

.viewer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 10px 16px;
    color: #fff;
    background: #1D2A4D;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.viewer-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .17);
    border-radius: 10px;
    color: #fff;
    background: rgba(255, 255, 255, .07);
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.viewer-button:hover:not(:disabled) {
    border-color: var(--magazine-primary);
    color: #fff;
    background: rgba(19, 197, 221, .22);
    transform: translateY(-1px);
}

.viewer-button:focus-visible {
    outline: 3px solid rgba(19, 197, 221, .35);
    outline-offset: 2px;
}

.viewer-button:disabled {
    cursor: not-allowed;
    opacity: .36;
}

.page-indicator,
.zoom-indicator {
    min-width: 118px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
}

.zoom-indicator {
    min-width: 50px;
}

.fullscreen-button {
    margin-left: 5px;
}

.book-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 72vh;
    max-height: calc(100vh - 145px);
    padding: 28px;
    overflow: auto;
    background:
        radial-gradient(circle at center, rgba(77, 98, 137, .42), transparent 58%),
        #111827;
    perspective: 1800px;
    overscroll-behavior: contain;
}

.book-stage:focus {
    outline: none;
}

.book-pages {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: max-content;
    min-width: 100%;
    gap: 5px;
    transform-style: preserve-3d;
}

.book-pages.has-spread::after {
    position: absolute;
    content: "";
    top: 0;
    bottom: 25px;
    left: 50%;
    z-index: 5;
    width: 12px;
    pointer-events: none;
    transform: translateX(-50%);
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, .22),
        rgba(255, 255, 255, .14),
        rgba(0, 0, 0, .18)
    );
}

.pdf-page-shell {
    position: relative;
    flex: 0 0 auto;
    padding-bottom: 25px;
    transform-origin: center;
    transition: opacity .22s ease, transform .28s ease;
}

.pdf-page-shell canvas {
    display: block;
    max-width: none;
    border-radius: 2px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .38);
    user-select: none;
    -webkit-user-drag: none;
}

.pdf-page-shell:first-child canvas {
    border-radius: 4px 1px 1px 4px;
}

.pdf-page-shell:last-child canvas {
    border-radius: 1px 4px 4px 1px;
}

.pdf-page-shell.is-cover canvas {
    border-radius: 5px;
    box-shadow: 0 16px 38px rgba(0, 0, 0, .46);
}

.rendered-page-number {
    position: absolute;
    right: 0;
    bottom: 2px;
    left: 0;
    color: rgba(255, 255, 255, .68);
    text-align: center;
    font-size: 11px;
    font-weight: 700;
}

.book-pages.turning-next .pdf-page-shell {
    opacity: .22;
    transform: rotateY(-7deg) translateX(-12px);
}

.book-pages.turning-previous .pdf-page-shell {
    opacity: .22;
    transform: rotateY(7deg) translateX(12px);
}

.viewer-loader,
.viewer-error {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 30px;
    color: #fff;
    text-align: center;
    background: rgba(17, 24, 39, .93);
}

.viewer-loader small,
.viewer-error span {
    color: rgba(255, 255, 255, .68);
}

.viewer-spinner {
    width: 46px;
    height: 46px;
    margin-bottom: 8px;
    border: 4px solid rgba(255, 255, 255, .18);
    border-top-color: var(--magazine-primary);
    border-radius: 50%;
    animation: magazine-spin .8s linear infinite;
}

.viewer-error i {
    margin-bottom: 8px;
    color: #ffc107;
    font-size: 40px;
}

.viewer-error[hidden],
.viewer-loader[hidden] {
    display: none;
}

.viewer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 50px;
    padding: 10px 18px;
    color: rgba(255, 255, 255, .72);
    background: #1D2A4D;
    border-top: 1px solid rgba(255, 255, 255, .09);
    font-size: 12px;
}

.viewer-help {
    text-align: right;
}

.magazine-viewer:fullscreen {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
}

.magazine-viewer:fullscreen .book-stage {
    min-height: calc(100vh - 114px);
    max-height: calc(100vh - 114px);
}

.viewer-print-warning {
    display: none;
}

@keyframes magazine-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 991.98px) {
    .latest-cover-column {
        min-height: auto;
        padding: 36px 24px;
    }

    .latest-edition-copy {
        min-height: auto;
        padding: 40px 32px;
    }
}

@media (max-width: 820px) {
    .book-stage {
        min-height: 67vh;
        padding: 16px 10px;
    }

    .book-pages {
        gap: 0;
    }

    .book-pages.has-spread::after {
        display: none;
    }

    .viewer-help {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .latest-edition-copy {
        padding: 34px 23px;
    }

    .magazine-cover-large {
        min-height: 370px;
    }

    .viewer-toolbar {
        align-items: stretch;
        flex-direction: column;
        padding: 9px 10px;
    }

    .toolbar-group {
        justify-content: center;
    }

    .toolbar-navigation {
        order: 1;
    }

    .toolbar-zoom {
        order: 2;
    }

    .viewer-button {
        width: 38px;
        height: 38px;
    }

    .book-stage {
        max-height: calc(100vh - 205px);
    }

    .viewer-footer {
        justify-content: center;
        text-align: center;
    }

    .magazine-viewer:fullscreen .book-stage {
        min-height: calc(100vh - 164px);
        max-height: calc(100vh - 164px);
    }
}

@media print {
    body * {
        visibility: hidden !important;
    }

    .viewer-print-warning,
    .viewer-print-warning * {
        visibility: visible !important;
    }

    .viewer-print-warning {
        position: fixed;
        display: block;
        inset: 40% 10% auto;
        padding: 30px;
        border: 2px solid #1D2A4D;
        color: #1D2A4D;
        text-align: center;
        font-size: 20px;
        font-weight: 800;
    }
}

