

:root {
    --primary-blue: #002855;
    --accent-yellow: #FFC400;
    --background-gray: #FFFFFF;
    --white: #FFFFFF;
    --text-dark: #1E293B;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--background-gray);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Header Styles */
.main-header {
    background-color: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 1rem 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-container img {
    height: 45px;
    width: auto;
    display: block;
}

.logo-text {
    display: none;
    /* Hide old text logo */
}

.logo-xd {
    background: var(--accent-yellow);
    color: var(--primary-blue);
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.search-bar {
    flex: 0 1 500px;
    position: relative;
    margin: 0 2rem;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    z-index: 1;
}

.search-bar input {
    width: 100%;
    padding: 0.8rem 3rem 0.8rem 3rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    outline: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.search-bar input:focus {
    border-color: var(--primary-blue);
}

.search-clear {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s ease;
    text-decoration: none;
}

.search-clear:hover {
    color: var(--primary-blue);
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.mobile-header-actions {
    display: none;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--primary-blue);
    font-size: 1.25rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.icon-btn:hover {
    transform: scale(1.1);
}

/* Keep the category-filter hover surface circular instead of square. */
#filterBtn {
    border-radius: 50%;
}

/* Filter Popover Styles */
.filter-dropdown-container {
    position: relative;
    display: inline-block;
}

.filter-popover {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: var(--white);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 1.5rem;
    min-width: 250px;
    z-index: 2000;
    border: 1px solid var(--border-color);
    animation: slideIn 0.3s ease-out;
}

.filter-popover.show {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-popover-content label {
    display: block;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-popover-content select {
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--background-gray);
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    outline: none;
}

.filter-popover-content select:focus {
    border-color: var(--primary-blue);
}

.filter-popover::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 15px;
    width: 12px;
    height: 12px;
    background: var(--white);
    transform: rotate(45deg);
    border-top: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
}


/* News Feed Grid */
.news-container {
    max-width: 1500px;
    margin: 3rem auto;
    padding: 0 5%;
}

.home-title {
    font-size: 3.15rem;
    font-weight: 800;
    color: var(--primary-blue);
    line-height: 1.25;
    letter-spacing: -0.03em;
    margin: 0 0 1.75rem;
}

.news-grid {
    margin: -0.75rem;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.news-grid.ready {
    opacity: 1;
}

/* Spinner Loader */
.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 100px 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 40, 85, 0.1);
    border-top: 5px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.news-item {
    width: 25%;
    /* 4 columns on desktop */
    padding: 0.75rem;
    float: left;
}

/* Card Styles */
.card-link {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px;
}

.card-link:hover {
    transform: translateY(-8px);
}

.news-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.card-link:hover .news-card {
    box-shadow: var(--shadow-hover);
}

/* Responsive Layouts */
@media (max-width: 1400px) {
    .news-item {
        width: 33.333%;
    }
}

@media (max-width: 900px) {
    .news-item {
        width: 50%;
    }
}

@media (max-width: 600px) {
    .news-item {
        width: 100%;
    }
}



.card-image-wrapper {
    position: relative;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    overflow: hidden;
}

.card-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .card-image-wrapper img {
    transform: scale(1.05);
}

.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 0.8rem;
    line-height: 1.3;
}

.card-excerpt {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    overflow: hidden;
}

/* Pinterest Style Tweaks */
.news-card {
    height: auto;
    display: block;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.empty-news {
    width: 100%;
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.empty-news h1 {
    color: var(--primary-blue);
    margin-bottom: 0.8rem;
}

.empty-news a {
    color: #3b82f6;
    font-weight: 600;
}

.infinite-sentinel {
    height: 1px;
}

.infinite-loader {
    /* Always reserve vertical space so show/hide does not shift scroll anchoring. */
    display: block;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    text-align: center;
    padding: 2rem 0 3rem;
    min-height: 6.5rem;
    color: var(--text-muted);
    overflow-anchor: none;
}

.infinite-loader.show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.infinite-loader .spinner {
    margin: 0 auto 0.8rem;
}

.card-image-wrapper {
    padding-top: 0;
    /* Let image define height */
    height: auto;
}

.card-image-wrapper img {
    position: relative;
    display: block;
}

/* Mobile Menu Button - Hidden on Desktop */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-blue);
    cursor: pointer;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .main-header {
        flex-direction: row;
        padding: 0.75rem 5%;
        gap: 0;
    }

    .logo-container img {
        height: 35px;
    }

    .search-bar {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        margin: 0;
        padding: 1rem 5%;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }

    .search-bar input {
        padding-left: 2.5rem;
        padding-right: 2.5rem;
    }

    .search-icon {
        left: 1rem;
    }

    .search-clear {
        right: 1rem;
    }

    .search-bar.show {
        display: block;
    }

    .user-actions {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        padding: 1rem;
        border-radius: 0 0 15px 15px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        gap: 0.5rem;
    }

    .user-actions.show {
        display: flex;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .mobile-header-actions {
        display: flex;
        align-items: center;
        gap: 1rem;
        margin-left: auto;
    }

    .news-container {
        margin-top: 1rem;
        padding: 0 5%;
    }

    .home-title {
        font-size: 2.45rem;
        margin-bottom: 1.1rem;
    }
}
/* Text branding until the supplied logo is configured. */
.brand-wordmark { display:block; color:var(--primary-blue); font-weight:700; font-size:1.85rem; letter-spacing:-.055em; white-space:nowrap; }
.publication-nav { display:flex; align-items:center; gap:2rem; padding:1rem 5%; border-bottom:1px solid var(--border-color); background:white; }
.publication-nav a, .publication-footer a { color:var(--primary-blue); text-decoration:none; }
.publication-nav a:hover, .publication-footer a:hover { text-decoration:underline; }
.publication-nav .rss-subscribe { margin-left:auto; font-size:.95rem; font-weight:600; }
.home-intro { max-width:720px; color:var(--text-muted); font-size:1.1rem; margin:.7rem 0 1.5rem; }
.topic-nav { display:flex; flex-wrap:wrap; gap:.6rem; margin:0 0 2rem; }
.topic-nav a { padding:.35rem .8rem; border:1px solid var(--border-color); border-radius:4px; color:var(--primary-blue); text-decoration:none; font-size:.9rem; background:#fff; }
.topic-nav a:hover { border-color:var(--primary-blue); }
.publication-footer { padding:2rem 5%; border-top:1px solid var(--border-color); color:var(--text-muted); font-size:.95rem; }
.media-section { background:#fff; padding:2rem; margin:2rem 0; border:1px solid var(--border-color); border-radius:12px; }
.media-section h2 { color:var(--primary-blue); margin-bottom:.6rem; }
.media-section p { color:var(--text-muted); max-width:650px; }
.media-links { display:flex; flex-wrap:wrap; gap:1rem; margin-top:1rem; }
.media-links a { color:var(--primary-blue); }
@media (max-width:600px) { .brand-wordmark { font-size:1.55rem; } .publication-nav { gap:1rem; flex-wrap:wrap; font-size:.95rem; } .publication-nav .rss-subscribe { margin-left:0; } .home-intro { font-size:1rem; } .media-section { padding:1.4rem; } }
.logo-container img { height:76px; width:76px; object-fit:contain; }
.main-header {
    background:rgba(255,255,255,.72);
    backdrop-filter:blur(16px) saturate(112%);
    -webkit-backdrop-filter:blur(16px) saturate(112%);
}
.publication-nav { background:#fff; }
.home-title { font-weight:600; letter-spacing:-.03em; }
.media-hub { display:grid; grid-template-columns:1fr 1fr; align-items:start; gap:2rem; margin-top:3rem; border-top:2px solid var(--primary-blue); padding-top:2rem; }
.media-section { min-width:0; margin:0; padding:1.5rem; scroll-margin-top:130px; }
.section-heading { display:flex; gap:1rem; align-items:center; justify-content:space-between; margin-bottom:1rem; }
.section-heading a { color:var(--primary-blue); font-size:.9rem; white-space:nowrap; }
.section-kicker { font-size:.7rem; letter-spacing:.14em; font-weight:700; }
.section-heading h2 { margin:0; font-size:1.8rem; }
.podcast-platform-links { display:flex; align-items:center; gap:.25rem; }
.section-heading .podcast-platform-link, .section-heading .youtube-channel-link { display:flex; align-items:center; justify-content:center; flex:0 0 38px; width:38px; min-height:38px; border-radius:6px; }
.podcast-platform-link img, .youtube-channel-link img { display:block; width:28px; height:28px; object-fit:contain; }
.section-heading .podcast-platform-link:hover, .section-heading .youtube-channel-link:hover { background:rgba(0,40,85,.05); }
.section-heading .podcast-platform-link:focus-visible, .section-heading .youtube-channel-link:focus-visible { outline:2px solid var(--primary-blue); outline-offset:2px; }
.spotify-player { width:100%; border:0; border-radius:12px; }
.episode, .video { padding:1.2rem 0; border-top:1px solid var(--border-color); }
.episode h3, .video h3 { font-size:1.05rem; line-height:1.4; font-weight:600; margin-bottom:.8rem; }
.episode audio { display:block; width:100%; height:42px; }
.media-date { font-size:.78rem; margin:.4rem 0; color:var(--text-muted); }
.video iframe { display:block; width:100%; aspect-ratio:16/9; border:0; border-radius:8px; }
.media-status, .media-note { font-size:.88rem; margin:1rem 0; }
@media (max-width:780px) { .media-hub { grid-template-columns:1fr; gap:1.5rem; } .logo-container img { height:62px; width:62px; } }
/* Compact news cards: stable JS column masonry (no reflow on infinite scroll). */
.news-grid {
    display: flex;
    align-items: flex-start;
    gap: 1.35rem;
    margin: 0;
    opacity: 0;
    overflow-anchor: none;
}
.news-grid.ready {
    opacity: 1;
}
/* Before JS builds .news-col, keep a readable multi-column fallback (no-JS / first paint). */
.news-grid:not(:has(> .news-col)) {
    display: block;
    column-count: 4;
    column-gap: 1.35rem;
}
.news-grid:not(:has(> .news-col)) .news-item {
    display: inline-block;
    width: 100%;
    margin: 0 0 1.35rem;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    vertical-align: top;
}
@media (max-width: 1100px) {
    .news-grid:not(:has(> .news-col)) { column-count: 3; }
}
@media (max-width: 900px) {
    .news-grid:not(:has(> .news-col)) { column-count: 2; column-gap: 1.15rem; }
}
@media (max-width: 600px) {
    .news-grid:not(:has(> .news-col)) { column-count: 1; column-gap: 0; }
}
.news-grid .news-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
    overflow-anchor: none;
}
.news-grid .news-item {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
    min-width: 0;
    float: none;
    break-inside: auto;
    overflow-anchor: none;
}
.news-grid .card-link {
    border-radius: 18px;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.news-grid .card-link:hover {
    transform: translateY(-3px);
}
.news-grid .news-card {
    height: auto;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    background: var(--white);
    border: 1px solid rgba(0, 40, 85, 0.12);
    box-shadow: 0 1px 2px rgba(0, 40, 85, 0.04), 0 10px 28px -8px rgba(0, 40, 85, 0.14);
    transition: box-shadow 0.28s ease, transform 0.28s ease;
}
.news-grid .card-link:hover .news-card {
    box-shadow: 0 2px 4px rgba(0, 40, 85, 0.06), 0 18px 36px -10px rgba(0, 40, 85, 0.2);
}
/* Soft skeleton while images decode — no fixed aspect crop. */
.news-grid .card-image-wrapper {
    position: relative;
    height: auto;
    padding: 0;
    aspect-ratio: auto;
    overflow: hidden;
    min-height: 7.5rem;
    background: linear-gradient(180deg, #eef2f6 0%, #e6ebf1 100%);
}
.news-grid .card-image-wrapper img {
    position: static;
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: unset;
    vertical-align: top;
    transition: opacity 0.35s ease-out, transform 0.45s ease;
}
/* Only JS-managed pending images fade in; cached/no-JS images stay visible. */
.news-grid img[data-news-image].news-image-pending {
    opacity: 0;
}
.news-grid img[data-news-image].news-image-pending.news-image-loaded,
.news-grid img[data-news-image]:not(.news-image-pending) {
    opacity: 1;
}
img[data-news-image].news-image-pending {
    opacity: 0;
    transition: opacity 0.35s ease-out, transform 0.45s ease;
}
img[data-news-image].news-image-pending.news-image-loaded {
    opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
    .news-grid .card-link,
    .news-grid .card-link:hover,
    .news-grid .news-card,
    .news-grid .card-image-wrapper img,
    img[data-news-image].news-image-pending {
        transition: none;
        transform: none;
    }
    img[data-news-image].news-image-pending {
        opacity: 1;
    }
}
.news-grid .card-content {
    padding: 1.05rem 1.1rem 1.15rem;
}
.news-grid .card-date {
    font-size: 0.75rem;
    margin-bottom: 0.4rem;
}
.news-grid .card-title {
    font-size: 1.0625rem;
    line-height: 1.35;
    margin-bottom: 0.55rem;
}
.news-grid .card-excerpt {
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}
.load-more-btn {
    display: block;
    margin: 2rem auto;
    padding: 0.7rem 1.5rem;
    border: 1px solid var(--primary-blue);
    color: var(--primary-blue);
    border-radius: 6px;
    background: transparent;
    font: inherit;
    cursor: pointer;
}
.load-more-btn[hidden] { display: none; }
#newsLoadError { text-align: center; color: #8b2b27; }
@media (max-width: 900px) {
    .news-grid { gap: 1.15rem; }
    .news-grid .news-col { gap: 1.15rem; }
}
@media (max-width: 600px) {
    .news-grid { gap: 1rem; }
    .news-grid .news-col { gap: 1rem; }
    .news-grid .card-title { font-size: 1.125rem; }
}

.spotify-details summary { cursor:pointer; color:var(--primary-blue); padding:.7rem 0 1rem; font-size:.95rem; }
.video-play { position:relative; display:block; width:100%; padding:0; border:0; border-radius:8px; overflow:hidden; cursor:pointer; aspect-ratio:16/9; background:var(--primary-blue); }
.video-play img { width:100%; height:100%; object-fit:cover; display:block; }
.video-play-label { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); background:var(--accent-yellow); color:#001b36; padding:.6rem 1rem; border-radius:6px; font-weight:700; white-space:nowrap; }
.video-external { color:var(--primary-blue); font-size:.85rem; }
/* Separate, directly addressable sections on a white publication canvas. */
.section-tabs { display:flex; gap:.4rem; padding:.3rem; background:#f2f4f7; border:1px solid #e4e8ed; border-radius:14px; }
.publication-nav .section-tab { display:flex; align-items:center; justify-content:center; min-height:44px; padding:.55rem 1.5rem; border-radius:10px; font-weight:600; text-decoration:none; color:#4b5d70; }
.publication-nav .section-tab.active { color:#002855; background:#ffc400; box-shadow:0 2px 5px #00285512; }
.publication-nav .section-tab:hover { background:#fff; color:#002855; text-decoration:none; }
.publication-nav .section-tab.active:hover { background:#ffc400; }
.media-page .media-hub { display:block; border:0; margin-top:1.5rem; padding:0; }
.media-page .media-section { padding:0; border:0; border-radius:0; background:transparent; }
.media-page .section-heading { padding-bottom:1rem; border-bottom:1px solid var(--border-color); }
.media-page .section-heading h2 { display:none; }
.media-page .episode-list, .media-page .video-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1.5rem; }
.media-page .episode, .media-page .video { min-width:0; border:1px solid var(--border-color); border-radius:12px; padding:1.25rem; }
.media-page .episode { display:flex; flex-direction:column; gap:.3rem; }
.media-page .episode audio { margin-top:auto; }
.media-page .video-external { margin-left:1rem; }
.media-page .spotify-details { margin-bottom:1.5rem; max-width:740px; }
.media-page .media-links { margin-top:1.5rem; }
@media (max-width:700px) { .media-page .episode-list, .media-page .video-list { grid-template-columns:1fr; } .publication-nav { align-items:flex-start; gap:.75rem; } .section-tabs { width:100%; } .publication-nav .section-tab { flex:1; padding:.5rem .75rem; } }

/* A slim bar with a white-rimmed logo hanging below its lower edge. */
.main-header {
    height:76px;
    padding:12px 5%;
    overflow:visible;
}
.main-header .logo-container {
    position:relative;
    z-index:1;
    align-self:flex-start;
    flex:0 0 92px;
    width:92px;
    height:52px;
}
.main-header .logo-container > a {
    position:absolute;
    top:0;
    left:0;
    display:block;
    padding:4px;
    border-radius:50%;
    background:#fff;
    box-shadow:0 5px 10px -3px rgba(0,40,85,.2);
}
.main-header .logo-container img { display:block; width:84px; height:84px; }
.main-header + .publication-nav { padding-top:.35rem; }
@media (max-width:780px) {
    .main-header { height:64px; }
    .main-header .logo-container { flex-basis:76px; width:76px; height:40px; }
    .main-header .logo-container img { width:68px; height:68px; }
    .main-header + .publication-nav { padding-top:.35rem; }
}
@media (max-width:768px) {
    .main-header .search-bar { top:calc(100% + 28px); }
}

/* Desktop keeps the section navigation in the header; mobile gets its own scrollable block below it. */
.desktop-publication-nav {
    position:absolute;
    left:50%;
    top:50%;
    display:block;
    width:min(56vw,600px);
    margin:0;
    padding:0;
    border:0;
    background:transparent;
    transform:translate(-50%,-50%);
}
.desktop-publication-nav .section-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); width:100%; }
.desktop-publication-nav .section-tab { min-height:38px; padding:.45rem .7rem; font-size:.88rem; }
.mobile-publication-nav { display:none; }

.media-search-summary { grid-column:1 / -1; color:var(--text-muted); font-size:.95rem; }
.header-actions { display:flex; align-items:center; gap:1rem; margin-left:auto; }
.header-actions .icon-btn { display:flex; align-items:center; justify-content:center; width:32px; height:36px; }
.search-dialog {
    position:fixed; inset:0; width:min(560px,calc(100% - 32px)); max-height:calc(100% - 40px);
    margin:auto; padding:2rem; border:1px solid #e2e8f0; border-radius:20px;
    color:var(--text-dark); background:#fff; box-shadow:0 16px 60px #00285526;
}
.search-dialog::backdrop { background:rgba(16,34,54,.18); backdrop-filter:blur(9px); -webkit-backdrop-filter:blur(9px); }
.search-dialog h2 { color:var(--primary-blue); font-size:1.4rem; margin:0 2rem 1.4rem 0; }
.search-dialog-close { position:absolute; right:1rem; top:.65rem; width:36px; height:36px; border:0; background:none; color:var(--primary-blue); font-size:1.8rem; cursor:pointer; }
.dialog-search-form { display:flex; gap:.65rem; }
.dialog-search-form input { min-width:0; flex:1; padding:.85rem 1rem; font:inherit; border:1px solid #b8c5d2; border-radius:10px; }
.dialog-search-form input:focus { outline:2px solid var(--primary-blue); outline-offset:2px; }
.live-search-results { list-style:none; padding:0; margin:1rem 0; max-height:45vh; overflow:auto; }
.live-search-results li { padding:.8rem 0; border-bottom:1px solid var(--border-color); }
.live-search-results a { color:var(--primary-blue); font-weight:700; line-height:1.4; }
.live-search-results a:focus-visible { outline:2px solid currentColor; outline-offset:3px; }
.live-search-results p { margin:.4rem 0 0; font-size:.9rem; line-height:1.45; color:var(--text-gray); }
#liveSearchStatus { margin:1rem 0 .5rem; font-size:.9rem; }
.load-more-btn { width:max-content; text-decoration:none; }
.load-more-btn[aria-disabled="true"] { opacity:.6; }
.search-submit { padding:.75rem 1rem; font:inherit; font-weight:600; color:var(--primary-blue); border:0; border-radius:10px; background:var(--accent-yellow); cursor:pointer; }
.dialog-clear { display:inline-block; margin-top:1rem; color:var(--primary-blue); }
.visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@media (max-width:780px) {
    .desktop-publication-nav { display:none; }
    .mobile-publication-nav { display:flex; justify-content:center; width:calc(100% - 2rem); margin:.65rem auto 0; padding:0; border:0; border-radius:0; background:transparent; }
    .mobile-publication-nav .section-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); width:100%; gap:.25rem; padding:.3rem; }
    .mobile-publication-nav .section-tab { min-height:42px; padding:.5rem .35rem; font-size:.82rem; white-space:nowrap; }
    .header-actions { gap:.4rem; }
    .header-actions .icon-btn { width:24px; height:36px; font-size:1.1rem; }
}
@media (max-width:360px) {
    .publication-header { padding-left:8px; padding-right:8px; }
    .mobile-publication-nav { width:calc(100% - 1rem); }
    .mobile-publication-nav .section-tab { font-size:.74rem; padding:.45rem .2rem; }
    .header-actions { gap:.2rem; }
    .search-dialog { padding:1.5rem 1rem; }
    .dialog-search-form { flex-direction:column; }
}

.publication-header ~ .news-container { margin-top:3rem; }

/* A focused invitation to the WhatsApp community. */
.community-container { max-width:820px; margin:3rem auto; padding:0 5%; }
.community-card { padding:clamp(2rem,6vw,4rem); border:1px solid var(--border-color); border-radius:24px; background:var(--white); box-shadow:var(--shadow-soft); text-align:center; }
.community-kicker { margin:0 0 .75rem; color:var(--primary-blue); font-size:.75rem; font-weight:700; letter-spacing:.14em; }
.community-card h1 { margin:0; color:var(--primary-blue); font-size:clamp(2rem,5vw,3.1rem); line-height:1.15; }
.community-card > p:not(.community-kicker):not(.community-note) { max-width:620px; margin:1.1rem auto 0; color:var(--text-muted); font-size:1.08rem; line-height:1.7; }
.whatsapp-community-button { display:inline-flex; align-items:center; justify-content:center; gap:.7rem; min-height:54px; margin:2rem auto 0; padding:.8rem 1.2rem; border-radius:12px; color:#062d1a; background:#25d366; box-shadow:0 8px 18px #25d36640; font-weight:700; line-height:1.35; text-align:center; text-decoration:none; }
.whatsapp-community-button:hover { background:#1fbd59; color:#062d1a; }
.whatsapp-community-button:focus-visible { outline:3px solid var(--primary-blue); outline-offset:3px; }
.whatsapp-community-button i { font-size:1.45rem; }
.community-note { margin:1rem 0 0; color:var(--text-muted); font-size:.9rem; }
@media (max-width:600px) { .community-container { margin:2rem auto; padding:0 1rem; } .community-card { padding:2rem 1.25rem; border-radius:18px; } .whatsapp-community-button { width:100%; } }

/* Attribution stays within the compact image area. */
