/* Desktop-only sizing and layout isolation (>= 1121px). */
html {
    font-size: 18px;
}

body {
    line-height: 1.58;
    -webkit-text-size-adjust: 100%;
    overflow-x: clip;
}

.site-shell {
    width: min(1300px, calc(100% - 1.6rem));
    margin: 1rem auto 1.95rem;
    border-radius: 28px;
}

.container {
    width: min(1180px, calc(100% - 2.2rem));
    min-width: 0;
}

.site-main {
    padding: 1.25rem 0 2.3rem;
}

.navbar {
    padding: 1.45rem 0;
}

.nav-wrapper,
.nav-wrapper-home {
    grid-template-columns: minmax(0, 500px) minmax(0, 1fr) auto;
    gap: 1rem;
    min-height: 96px;
    min-width: 0;
}

.logo {
    gap: 1.35rem;
}

.hamburger {
    display: none !important;
}

.logo-image {
    width: clamp(300px, 29vw, 500px);
    max-height: 136px;
}

.logo-mark {
    width: 3.6rem;
    height: 3.6rem;
    font-size: 1.55rem;
}

.logo-name {
    font-size: 1.85rem;
}

.logo-tag {
    font-size: 0.82rem;
    letter-spacing: 0.08em;
}

.nav-menu {
    position: static;
    display: flex !important;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: none;
    background: transparent;
    scrollbar-width: thin;
    min-width: 0;
}

.nav-menu li {
    width: auto;
}

.nav-menu a,
.dropbtn {
    min-height: 60px;
    padding: 0.72rem 0.9rem;
    border-radius: 16px;
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0.015em;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1.2;
}

.nav-menu .nav-icon {
    display: none;
}

.dropdown-content {
    min-width: 320px;
    max-height: 460px;
    overflow-y: auto;
}

.dropdown-content a {
    font-size: 0.95rem;
    padding: 0.74rem 0.86rem;
}

.nav-tools {
    gap: 0.58rem;
}

.language-switcher select,
.theme-toggle {
    min-height: 3.1rem;
    border-radius: 16px;
    font-size: 1rem;
}

.theme-toggle {
    width: 3.1rem;
    height: 3.1rem;
}

.search-form {
    max-width: 760px;
}

.search-form input,
.search-form button {
    height: 3rem;
}

p,
li,
label,
input,
select,
textarea,
.text-muted {
    font-size: 1.02rem;
}

.page-subtitle,
.archive-date-subtitle,
.newsletter-note,
.social-note,
.pdf-mobile-hint,
.advertise-note,
.live-widgets-meta {
    font-size: 0.95rem;
    line-height: 1.5;
}

.page-header h1,
.admin-header h1,
.archive-header h1,
.category-header h1,
.search-header h1,
.pdf-library-header h1,
.contact-section h1,
.achievements-page .page-header h1,
.advertise-page .page-header h1,
.about-page .page-header h1 {
    font-size: clamp(1.95rem, 2.8vw, 2.65rem);
    line-height: 1.07;
}

.content-wrapper,
.content-wrapper.home-layout {
    grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
    gap: 1rem;
    min-width: 0;
}

.archive-wrapper {
    grid-template-columns: minmax(290px, 0.86fr) minmax(0, 2fr);
    gap: 1rem;
}

.stats-grid,
.achievements-grid,
.advertise-grid,
.admin-action-grid,
.live-widgets-grid {
    gap: 0.9rem;
}

.achievements-grid,
.advertise-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.about-page .values-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.86rem;
}

.live-widgets-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.main-content,
.sidebar,
.archive-main,
.archive-sidebar,
.page-content,
.contact-section,
.about-page,
.advertise-page,
.admin-section {
    padding: 1rem;
    min-width: 0;
}

.article-card,
.widget,
.archive-section,
.search-result,
.pdf-card,
.stat-box,
.stat-card,
.archive-pdf-item,
.archive-article-item,
.contact-form,
.article-form,
.category-form,
.admin-form,
.date-picker-box,
.newspaper-card,
.about-section,
.values-grid .value-item {
    padding: 0.92rem;
}

.widget h3,
.live-widget-card h3,
.admin-action-card h3,
.stat-card h3,
.stat-box h4,
.archive-section h3,
.about-page .about-section h2 {
    font-size: 1.18rem;
    line-height: 1.25;
}

.widget-list li {
    padding: 0.53rem 0;
}

.article-content h3,
.archive-article-content h4,
.result-title,
.contact-section h2 {
    font-size: 1.28rem;
    line-height: 1.28;
}

.article-meta span,
.archive-article-meta span,
.result-meta span,
.pdf-stats,
.download-count,
.upload-date,
.stat-label,
.newspaper-share-label {
    font-size: 0.95rem;
}

.btn,
.btn-primary,
.btn-secondary,
.btn-download,
.btn-view,
.btn-edit,
.btn-delete,
.btn-danger,
.btn-small {
    min-height: 2.9rem;
    font-size: 0.98rem;
}

.admin-table th,
.admin-table td {
    font-size: 0.9rem;
    padding: 0.68rem 0.74rem;
}

.hero-banner {
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr);
    gap: 1rem;
    padding: 1.14rem;
}

.hero-content h2 {
    font-size: clamp(2.3rem, 4.7vw, 4.5rem);
}

.hero-lead {
    max-width: 680px;
    font-size: 1.05rem;
}

.hero-actions {
    gap: 0.56rem;
}

.hero-chip {
    font-size: 0.9rem;
}

.home-gallery {
    grid-auto-rows: clamp(190px, 19vw, 252px);
}

.todays-newspaper-section {
    padding: 1rem;
}

.newspaper-actions,
.pdf-footer,
.share-buttons {
    gap: 0.5rem;
}

.pdf-viewer-wrapper {
    min-height: 72vh;
}

.newspaper-pdf-frame-full {
    min-height: 66vh;
    height: clamp(560px, 72vh, 980px);
}

.home-paper-flipper {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.paper-flip-inner {
    min-height: 520px;
}

.paper-preview-shell {
    min-height: 430px;
}

.paper-preview-frame {
    min-height: 400px;
}

.about-content {
    gap: 0.9rem;
}

.about-page .about-section p,
.contact-form label,
.archive-date-subtitle,
.archive-search-form input,
.archive-search-form button {
    font-size: 1rem;
}

.archive-article-item {
    grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
}

.footer-content {
    gap: 1rem;
}

.admin-fab {
    right: 1.1rem;
    bottom: 1rem;
}

/* Contrast reinforcement for light theme (prevents pale text on pale panels). */
body:not(.dark-mode) .footer-section,
body:not(.dark-mode) .footer-bottom,
body:not(.dark-mode) .live-widgets-section,
body:not(.dark-mode) .live-widget-card {
    color: #1f2f42;
}

body:not(.dark-mode) .footer-section p,
body:not(.dark-mode) .footer-section li,
body:not(.dark-mode) .footer-bottom p,
body:not(.dark-mode) .footer-section a,
body:not(.dark-mode) .text-muted,
body:not(.dark-mode) .muted-inline,
body:not(.dark-mode) .newsletter-note,
body:not(.dark-mode) .social-note,
body:not(.dark-mode) .live-widgets-meta,
body:not(.dark-mode) .live-widget-loading,
body:not(.dark-mode) .live-widget-empty,
body:not(.dark-mode) .live-widget-error,
body:not(.dark-mode) .live-weather-condition,
body:not(.dark-mode) .live-weather-meta,
body:not(.dark-mode) .live-quote-name {
    color: #3a4c62;
}

body:not(.dark-mode) .footer-section h3,
body:not(.dark-mode) .live-widgets-head h2,
body:not(.dark-mode) .live-widget-card h3,
body:not(.dark-mode) .live-weather-location,
body:not(.dark-mode) .live-weather-temp,
body:not(.dark-mode) .live-quote-symbol,
body:not(.dark-mode) .live-quote-price {
    color: #1f2f42;
}

@media (min-width: 1500px) {
    .site-shell {
        width: min(1380px, calc(100% - 2rem));
    }

    .container {
        width: min(1240px, calc(100% - 2.6rem));
    }
}

@media (max-width: 1360px) {
    .nav-wrapper,
    .nav-wrapper-home {
        grid-template-columns: minmax(0, 410px) minmax(0, 1fr) auto;
        gap: 0.82rem;
        min-height: 86px;
    }

    .logo-image {
        width: clamp(250px, 24vw, 380px);
        max-height: 116px;
    }

    .nav-menu a,
    .dropbtn {
        min-height: 54px;
        padding: 0.62rem 0.78rem;
        font-size: 0.92rem;
        border-radius: 13px;
    }

    .language-switcher select,
    .theme-toggle {
        min-height: 2.8rem;
        font-size: 0.92rem;
    }

    .theme-toggle {
        width: 2.8rem;
        height: 2.8rem;
    }
}
