/* ── News & Events (index) ──────────────────────────────────────────────────
   Section header plus two framed cards: Newsletters (blue) and Event of the Day
   (amber). The frame artwork (tab, icon, waves) is a PNG from
   assets/News & Events; the card keeps the PNG's aspect ratio and everything
   inside is positioned in percentages and sized in cqw, so the layout scales
   as one unit from desktop down to phones. */

/* Extra room under the cards so they don't crowd the wave that opens the
   Animation Studio section below. */
#news-events-section {
    padding-bottom: 3.5rem;
}

@media (min-width: 640px) {
    #news-events-section {
        padding-bottom: 5rem;
    }
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.ne-eyebrow-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1.1rem;
    border-radius: 9999px;
    background: #D6E8FB;
    color: #173764;
    font-size: var(--fs-eyebrow);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-eyebrow);
    position: relative;
}

.ne-eyebrow-pill::before,
.ne-eyebrow-pill::after {
    content: "";
    position: absolute;
    top: 50%;
    width: clamp(40px, 9vw, 110px);
    height: 2px;
    background: #E2474B;
}

.ne-eyebrow-pill::before { right: calc(100% + 0.5rem); }
.ne-eyebrow-pill::after { left: calc(100% + 0.5rem); }

.ne-eyebrow-pill svg { color: #1E5CA3; }

#news-events-section .ne-title {
    font-weight: 700;
    color: #111827;
}

#news-events-section .ne-title .title-accent { color: #E0242B; }

.ne-lead {
    font-size: var(--fs-lead);
    line-height: var(--lh-body);
    color: #111827;
}

.ne-title-rule {
    display: block;
    width: 88px;
    height: 2px;
    margin: 0.9rem auto 0;
    background: #E2474B;
}

/* ── Cards ──────────────────────────────────────────────────────────────── */
.ne-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
}

@media (min-width: 768px) {
    .ne-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.5rem;
    }
}

.ne-card {
    --ne-tab-left: 28%;
    --ne-tab-width: 50%;
    position: relative;
    container-type: inline-size;
    aspect-ratio: 1374 / 1145;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    min-width: 0;
}

.ne-card--news {
    --ne-tab-left: 29%;
    --ne-tab-width: 48%;
    background-image: url("/assets/News & Events/Newsletters.png");
}

.ne-card--event {
    --ne-tab-left: 32%;
    --ne-tab-width: 48%;
    background-image: url("/assets/News & Events/Latest Events.png");
    /* The amber artwork's frame is a little larger than the blue one's; scale and
       shift it so both frames land on the same box. */
    background-size: 98.64% 94.48%;
    background-position: 82.1% -15.9%;
}

.ne-card--event .ne-card__tab { top: 6.7%; }

.ne-card--news .ne-card__tab { top: 6.2%; }

.ne-card__tab {
    position: absolute;
    top: 9%;
    left: var(--ne-tab-left);
    width: var(--ne-tab-width);
    height: 15%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-size: clamp(14px, 5.2cqw, 28px);
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.ne-card--event .ne-card__tab {
    color: #1B1464;
    text-shadow: none;
}

.ne-card__body {
    position: absolute;
    inset: 31% 9% 22% 9%;
    display: flex;
    align-items: stretch;
    gap: 5%;
}

.ne-card__art {
    position: relative;
    flex: 0 0 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.ne-card__copy {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3cqw;
    text-align: center;
    padding-left: 3cqw;
    border-left: 1px solid rgba(60, 60, 90, 0.22);
}

.ne-card__title {
    margin: 0;
    max-width: 100%;
    font-size: clamp(12px, 4.2cqw, 24px);
    text-transform: capitalize;
    font-weight: 700;
    line-height: 1.2;
    color: #1B1B2F;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ne-card__date {
    display: flex;
    align-items: center;
    gap: 0.4em;
    margin: 0;
    font-size: clamp(10px, 3cqw, 16px);
    font-weight: 500;
    color: #333;
}

.ne-card__date[hidden] { display: none; }

.ne-card__date svg {
    flex: none;
    width: 1.3em;
    height: 1.3em;
    color: #444;
}

.ne-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    border-radius: 9999px;
    padding: 0.55em 1.5em;
    font-size: clamp(10px, 3cqw, 15px);
    font-weight: var(--fw-semibold);
    line-height: 1.2;
    white-space: nowrap;
    color: #fff;
    transition: gap 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.ne-btn:hover {
    gap: 0.7em;
    transform: translateY(-2px);
    color: #fff;
}

.ne-btn--blue {
    background-color: #0B3C91;
    box-shadow: 0 10px 20px -10px rgba(11, 60, 145, 0.65);
}

.ne-btn--blue:hover { background-color: #082D6E; }

.ne-btn--red {
    background-color: #D91E1E;
    box-shadow: 0 10px 20px -10px rgba(217, 30, 30, 0.6);
}

.ne-btn--red:hover { background-color: #B91818; }

/* ── Thumbnail deck (newsletters + event posters) ───────────────────────── */
.ne-deck {
    position: relative;
    height: 100%;
    max-width: 78%;
    aspect-ratio: 1000 / 1401;
}

/* Newsletters: two issues stacked. The back one is a whole page, upper left; the
   front one is a smaller, rounded top-of-page clip overlapping it at lower right
   (a lone issue gets a copy behind it). */
.ne-card--news .ne-card__art { flex-basis: 42%; overflow: visible; }

.ne-deck--paper {
    height: 100%;
    max-width: 100%;
    aspect-ratio: 0.93;
}

.ne-card--news .ne-deck--paper .ne-poster {
    inset: auto;
    border: 0;
    border-radius: 3px;
    background: #fff;
    box-shadow: 0 12px 18px -8px rgba(15, 40, 90, 0.5);
    transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1), left 0.55s ease, top 0.55s ease, width 0.55s ease, height 0.55s ease, opacity 0.4s ease, visibility 0.4s;
}

.ne-card--news .ne-deck--paper .ne-poster img {
    object-fit: cover;
    object-position: top center;
}

/* Front clip: wide crop with rounded corners. Same look before the script runs
   (first slide) and after (is-active). */
.ne-card--news .ne-deck--paper .ne-poster:first-child,
.ne-card--news .ne-deck--paper.is-ready .ne-poster.is-active {
    z-index: 3;
    left: 27%;
    top: 49%;
    width: 73%;
    height: 51%;
    border-radius: 9px;
    transform: rotate(4deg);
}

/* Back page: the whole page. */
.ne-card--news .ne-deck--paper.is-ready .ne-poster.is-next,
.ne-card--news .ne-deck--paper .ne-poster.ne-poster--ghost,
.ne-card--news .ne-deck--paper.is-ready .ne-poster.ne-poster--ghost {
    z-index: 2;
    opacity: 1;
    visibility: visible;
    filter: none;
    left: 0;
    top: 0;
    width: 76%;
    height: 100%;
    border-radius: 3px;
    transform: rotate(-4deg);
}

.ne-poster {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border: 3px solid #fff;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 28px -14px rgba(15, 40, 90, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, visibility 0.4s;
}

.ne-poster img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Before the script runs (or without it) the first slide still shows. */
.ne-poster:first-child,
.ne-poster.is-active {
    z-index: 3;
    opacity: 1;
    visibility: visible;
    transform: none;
}

.ne-deck.is-ready .ne-poster:not(.is-active) {
    opacity: 0;
    visibility: hidden;
}

.ne-deck.is-ready .ne-poster.is-next {
    z-index: 2;
    opacity: 1;
    visibility: visible;
    transform: translateX(26%) rotate(5deg) scale(0.9);
    filter: brightness(0.94);
}

.ne-deck.is-ready .ne-poster.is-prev {
    z-index: 1;
    transform: translateX(-16%) rotate(-6deg) scale(0.88);
}

.ne-nav {
    position: absolute;
    top: 50%;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(26px, 7cqw, 40px);
    height: clamp(26px, 7cqw, 40px);
    border-radius: 9999px;
    background: #fff;
    color: #1E3A8A;
    box-shadow: 0 8px 18px -8px rgba(15, 40, 90, 0.5);
    transform: translateY(-50%);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ne-nav svg { width: 55%; height: 55%; }

.ne-nav:hover {
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 12px 24px -10px rgba(15, 40, 90, 0.55);
}

.ne-nav--prev { left: -4%; }
.ne-nav--next { right: -4%; }

.ne-nav[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
    .ne-poster { transition: none; }
}

/* Keep the header text inside the viewport at every width. */
#news-events-section .section-title > span {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* ── Newsletter flipbook popup (js/modules/newsletter-viewer.js) ─────────── */
html.nlv-open { overflow: hidden; }

.nlv {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.nlv[hidden] { display: none; }
.nlv.is-open { opacity: 1; }

.nlv__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 14, 32, 0.82);
    backdrop-filter: blur(6px);
}

.nlv__panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: transparent;
    overflow: hidden;
    pointer-events: none; /* clicks on empty space reach the backdrop and close */
    transform: translateY(14px) scale(0.98);
    transition: transform 0.3s ease;
}
.nlv.is-open .nlv__panel { transform: none; }

.nlv__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px 6px 22px;
    background: transparent;
    pointer-events: auto;
}
.nlv__heading { min-width: 0; flex: 1; }
.nlv__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nlv__date { font-size: 0.8rem; color: rgba(255, 255, 255, 0.7); }

.nlv__download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: linear-gradient(to right, #2F7FF5, #1E6FE0);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.nlv__download:hover { filter: brightness(1.08); color: #fff; }

.nlv__close {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: none;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
}
.nlv__close:hover { background: rgba(255, 255, 255, 0.26); }

.nlv__stage {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 72px;
}
.nlv__book-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* A turned page lies off to the left of the book; hide it as the phone screen edge does. */
.nlv__book { margin: 0 auto; pointer-events: auto; clip-path: inset(-100vh -100vw -100vh 0); }
.nlv__book .stf__parent, .nlv-page { box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.6); }

.nlv-page {
    background: #fff;
    overflow: hidden;
}
.nlv-page canvas {
    display: block;
    width: 100%;
    height: 100%;
}
/* Shimmer placeholder until pdf.js has drawn the page. */
.nlv-page:not(.is-rendered) {
    background: linear-gradient(110deg, #fff 30%, #EEF3FB 50%, #fff 70%) 0 0 / 300% 100%;
    animation: nlv-shimmer 1.4s linear infinite;
}
@keyframes nlv-shimmer { to { background-position: -150% 0; } }

.nlv__turn {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-top: -23px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #1E6FE0;
    box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.15s ease, opacity 0.15s ease;
}
.nlv__turn:hover:not(:disabled) { transform: scale(1.08); }
.nlv__turn:disabled { opacity: 0.35; cursor: default; }
.nlv__turn--prev { left: 12px; }
.nlv__turn--next { right: 12px; }

.nlv__status {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #fff;
    font-weight: 500;
    pointer-events: auto;
    text-align: center;
}
.nlv__status[hidden] { display: none; }
.nlv__spinner {
    width: 38px;
    height: 38px;
    border: 4px solid #CFE0F9;
    border-top-color: #2F7FF5;
    border-radius: 50%;
    animation: nlv-spin 0.8s linear infinite;
}
@keyframes nlv-spin { to { transform: rotate(360deg); } }
.nlv__fallback {
    padding: 8px 16px;
    border-radius: 999px;
    background: #2F7FF5;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}

.nlv__foot {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 40px;
    padding: 4px 22px 10px;
    pointer-events: auto;
}
.nlv__pages {
    flex: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}
.nlv__shelf {
    display: flex;
    gap: 10px;
    margin-left: auto;
    overflow-x: auto;
    padding: 4px 2px;
}
.nlv__shelf-item {
    flex: none;
    width: 44px;
    height: 60px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.7;
    box-shadow: 0 4px 10px -6px rgba(18, 48, 92, 0.5);
    transition: opacity 0.15s ease, border-color 0.15s ease;
}
.nlv__shelf-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nlv__shelf-item:hover,
.nlv__shelf-item.is-current { opacity: 1; border-color: #2F7FF5; }

.nlv button:focus-visible,
.nlv a:focus-visible { outline: 3px solid #F6A33B; outline-offset: 2px; }

@media (max-width: 640px) {
    .nlv__head { padding: 10px 10px 10px 16px; }
    .nlv__download span { display: none; }
    .nlv__download { padding: 9px; }
    .nlv__stage { padding: 0 4px 56px; }
    .nlv__turn { top: auto; bottom: 6px; margin-top: 0; width: 42px; height: 42px; }
    .nlv__turn--prev { left: calc(50% - 52px); }
    .nlv__turn--next { right: calc(50% - 52px); }
    .nlv__foot { flex-wrap: wrap; justify-content: center; padding: 6px 12px 12px; }
    .nlv__shelf { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .nlv, .nlv__panel { transition: none; }
    .nlv-page:not(.is-rendered), .nlv__spinner { animation: none; }
}

/* Event poster popup (js/modules/event-poster-viewer.js) reuses .nlv. */
.npv__img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.6);
    pointer-events: auto;
}
.npv .nlv__stage { padding: 0 72px 8px; }
@media (max-width: 640px) {
    .npv .nlv__stage { padding: 0 4px 56px; }
}
