/* Stability batch (final override layer).
   Purpose: deterministic rendering across Safari, Chrome, Edge and common mobile breakpoints. */

:root {
    --oe-stability-menu-z: 2450;
}

/* Normalize tablet and phone typography to a readable default. */
@media (max-width: 1120px) {
    html {
        font-size: 16px !important;
    }
}

@media (max-width: 767px) {
    html {
        font-size: 15px !important;
    }
}

/* Global light-mode backdrop: soft golden tone across all pages. */
body:not(.dark-mode) {
    --surface: #f6edcf;
    --surface-soft: #fbf4dc;
    --surface-muted: #f1e4bd;
    --line: #ddcca0;
    --line-strong: #cdb984;
    background:
        radial-gradient(1200px 760px at 8% 8%, rgba(243, 214, 139, 0.26), transparent 58%),
        radial-gradient(1200px 840px at 92% 90%, rgba(224, 186, 108, 0.2), transparent 66%),
        #f8efd2 !important;
}

body:not(.dark-mode)::before {
    background: repeating-linear-gradient(
        90deg,
        rgba(214, 183, 114, 0.11) 0,
        rgba(214, 183, 114, 0.11) 1px,
        transparent 1px,
        transparent 24px
    );
    mix-blend-mode: normal;
    opacity: 0.2;
}

body:not(.dark-mode) .site-shell {
    border-color: #d8c89d;
}

html,
body {
    overflow-x: clip;
}

img,
video,
canvas,
iframe {
    max-width: 100%;
    height: auto;
}

.site-shell,
.container,
.site-main,
.main-content,
.sidebar,
.archive-main,
.archive-sidebar,
.page-content,
.contact-section,
.about-page,
.advertise-page,
.admin-section,
.content-wrapper,
.archive-wrapper,
.nav-wrapper,
.nav-wrapper-home {
    min-width: 0;
}

.site-header,
.navbar {
    isolation: isolate;
}

.logo,
.logo-with-image {
    min-width: 0;
    max-width: 100%;
}

.logo picture {
    display: block;
    width: 100%;
}

.logo-image {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* Lock premium PDF stage height to the configured variable across all downstream CSS layers. */
.premium-pdf-host .ppv-stage {
    height: var(--ppv-stage-height) !important;
    max-height: var(--ppv-stage-height) !important;
}

/* Premium masthead: keep full-width logo while utility controls remain top-right. */
.nav-wrapper-home .logo {
    width: 100%;
    justify-self: stretch;
    justify-content: center;
}

.nav-wrapper-home .logo-image {
    width: min(100%, 1460px) !important;
    max-width: 100% !important;
    max-height: none !important;
    height: auto;
    object-fit: contain;
    object-position: center;
    filter: none !important;
    image-rendering: auto !important;
}

@media (min-width: 1121px) {
    .nav-wrapper-home {
        grid-template-columns: minmax(0, 1fr) auto !important;
        grid-template-areas:
            "logo logo"
            "menu tools";
        column-gap: 0.74rem !important;
        row-gap: 0.58rem !important;
        min-height: auto !important;
    }

    .nav-wrapper-home .logo {
        grid-area: logo;
        margin: 0;
    }

.nav-wrapper-home .nav-menu {
        grid-area: menu;
        justify-content: flex-end !important;
        width: 100%;
        display: flex !important;
        flex-wrap: wrap !important;
        overflow: visible !important;
        white-space: normal;
        row-gap: 0.42rem;
        column-gap: 0.4rem;
        align-content: flex-start;
        margin-top: 0 !important;
    }

    .nav-wrapper-home .nav-tools {
        grid-area: tools;
        justify-self: end !important;
        align-self: start;
        white-space: nowrap;
        margin-top: 0.08rem;
    }

    .nav-wrapper-home .nav-menu a,
    .nav-wrapper-home .dropbtn {
        min-height: 50px;
        padding: 0.56rem 0.72rem;
        font-size: 0.9rem;
    }
}

.nav-menu a,
.dropbtn {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Keep search row stable even when stale markup/styles are cached. */
.search-form {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center;
    gap: 0.56rem;
}

.search-form input {
    min-width: 0;
}

.search-form button {
    min-width: 6.8rem;
    white-space: nowrap;
}

.search-form > label {
    display: none !important;
}

/* Cross-browser form control normalization for visual parity. */
button,
input,
select,
textarea {
    -webkit-appearance: none;
    appearance: none;
    border-radius: 12px;
}

input[type="checkbox"],
input[type="radio"] {
    -webkit-appearance: auto;
    appearance: auto;
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
    display: none;
}

.language-switcher-form {
    position: relative;
}

.language-switcher-form::after {
    content: "▾";
    position: absolute;
    right: 0.58rem;
    top: 50%;
    transform: translateY(-52%);
    pointer-events: none;
    font-size: 0.68rem;
    color: var(--text-soft, #5a6e84);
}

.language-switcher select {
    padding-right: 1.45rem !important;
}

/* Avoid Safari default markers affecting dashboard details layout. */
summary {
    list-style: none;
}

summary::-webkit-details-marker {
    display: none;
}

details > summary::marker {
    content: "";
}

/* Force readable contrast on gradient header/hero surfaces. */
:is(.archive-header, .search-header, .category-header, .pdf-library-header, .page-header, .admin-header) {
    border-color: #c8d4e2 !important;
    background: linear-gradient(156deg, #ffffff, #edf3fa) !important;
    color: #13283d !important;
}

:is(.archive-header, .search-header, .category-header, .pdf-library-header, .page-header, .admin-header) :is(h1, h2, h3) {
    color: #13283d !important;
}

:is(.archive-header, .search-header, .category-header, .pdf-library-header, .page-header, .admin-header) :is(p, .page-subtitle, .archive-date-subtitle) {
    color: #2f4d68 !important;
}

/* Keep table header text readable on accent/dark header backgrounds site-wide. */
body:not(.dark-mode) .admin-table thead th,
body:not(.dark-mode) .admin-table th {
    color: #edf5ff !important;
}

.editorials-page .editorials-hero {
    border-color: #bfd0e1 !important;
    background: linear-gradient(156deg, #f7fbff, #eaf2fb) !important;
    color: #13283d !important;
}

.editorials-page .editorials-hero :is(h1, h2, h3) {
    color: #13283d !important;
}

.editorials-page .editorials-hero :is(p, .page-subtitle) {
    color: #2f4d68 !important;
    font-weight: 600;
}

.editorials-page .editorials-hero .editorials-hero-actions {
    margin-top: 0.62rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

@media (max-width: 900px) {
    .editorials-page .editorials-hero .editorials-hero-actions {
        justify-content: flex-start;
    }
}

body.dark-mode :is(.archive-header, .search-header, .category-header, .pdf-library-header, .page-header, .admin-header),
body.dark-mode .editorials-page .editorials-hero {
    border-color: #475e76 !important;
    background: linear-gradient(160deg, #1e2b3a, #172331) !important;
    color: #edf4ff !important;
}

body.dark-mode :is(.archive-header, .search-header, .category-header, .pdf-library-header, .page-header, .admin-header) :is(h1, h2, h3),
body.dark-mode .editorials-page .editorials-hero :is(h1, h2, h3) {
    color: #edf4ff !important;
}

body.dark-mode :is(.archive-header, .search-header, .category-header, .pdf-library-header, .page-header, .admin-header) :is(p, .page-subtitle, .archive-date-subtitle),
body.dark-mode .editorials-page .editorials-hero :is(p, .page-subtitle) {
    color: #cbdbef !important;
}

/* Contact form bot trap field guard (if present in cached templates). */
.contact-form .field-trap,
.contact-form [name="company"] {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Mobile/tablet stability */
@media (max-width: 1120px) {
    .site-header,
    .navbar,
    .nav-wrapper,
    .nav-wrapper-home {
        overflow: visible !important;
    }

    .nav-wrapper,
    .nav-wrapper-home {
        grid-template-columns: minmax(0, 1fr) auto auto !important;
        gap: 0.45rem !important;
        min-height: 72px;
    }

    .nav-wrapper-home {
        grid-template-columns: minmax(0, 1fr) auto auto !important;
        grid-template-areas: none !important;
        row-gap: 0 !important;
    }

    .nav-wrapper-home .logo {
        grid-area: auto;
        align-self: center;
    }

    .nav-wrapper-home .hamburger {
        grid-area: auto;
        justify-self: end;
    }

    body.home-page .nav-wrapper-home {
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-areas:
            "logo"
            "menu"
            "tools";
        row-gap: 0.42rem !important;
        align-items: start;
    }

    body.home-page .nav-wrapper-home .logo {
        grid-area: logo;
        justify-self: center;
        width: 100%;
        max-width: 100%;
    }

    body.home-page .nav-wrapper-home .hamburger {
        display: none !important;
    }

    body.home-page .nav-wrapper-home .nav-menu {
        grid-area: menu;
        position: static !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        z-index: auto !important;
        width: 100% !important;
        max-height: none !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        transform: none !important;
        transition: none !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: stretch !important;
        justify-content: center !important;
        overflow: visible !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        margin: 0 !important;
        padding: 0.24rem 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        gap: 0.34rem 0.34rem !important;
        align-content: flex-start;
    }

    body.home-page .nav-wrapper-home .nav-menu li {
        display: block !important;
        flex: 0 0 auto;
        width: auto;
    }

    body.home-page .nav-wrapper-home .nav-menu a,
    body.home-page .nav-wrapper-home .dropbtn {
        width: auto !important;
        min-height: 40px;
        padding: 8px 10px !important;
        font-size: clamp(12px, 2.7vw, 15px) !important;
        line-height: 1.2 !important;
        white-space: normal;
        text-align: center;
    }

    body.home-page .nav-wrapper-home .nav-tools {
        grid-area: tools;
        width: 100%;
        justify-self: end !important;
        justify-content: flex-end !important;
        padding-top: 0;
        margin-top: 0.04rem;
    }

    body.home-page.menu-open .site-header::before {
        display: none !important;
    }

    .nav-tools {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        min-width: 0;
        position: relative;
        z-index: calc(var(--oe-stability-menu-z) + 2);
    }

    .nav-wrapper-home .nav-tools {
        grid-area: auto;
        justify-self: end;
        width: auto;
        justify-content: flex-end;
        padding-top: 0;
    }

    .nav-wrapper-home .logo-image {
        width: 100% !important;
        max-height: clamp(108px, 26vw, 220px) !important;
    }

    .language-switcher,
    .language-switcher-form {
        display: inline-flex;
        align-items: center;
    }

    .language-switcher select {
        min-width: 4.2rem;
        max-width: 6.1rem;
        min-height: 2.32rem;
        font-size: 0.82rem;
        padding: 0 1.28rem 0 0.48rem !important;
    }

    .language-switcher-submit {
        display: none !important;
    }

    .language-switcher-form::after {
        right: 0.44rem;
        font-size: 0.62rem;
    }

    .theme-toggle {
        width: 2.34rem !important;
        height: 2.34rem !important;
        min-height: 2.34rem !important;
        flex: 0 0 auto;
    }

    .hamburger {
        display: inline-flex !important;
        position: relative;
        z-index: calc(var(--oe-stability-menu-z) + 3);
        min-width: 46px;
        min-height: 46px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        pointer-events: auto;
        cursor: pointer;
    }

    .nav-menu {
        display: none !important;
        position: fixed !important;
        top: var(--menu-top, 84px) !important;
        left: max(8px, env(safe-area-inset-left)) !important;
        right: max(8px, env(safe-area-inset-right)) !important;
        bottom: max(8px, env(safe-area-inset-bottom)) !important;
        z-index: var(--oe-stability-menu-z) !important;
        max-height: calc((var(--app-vh, 1vh) * 100) - var(--menu-top, 84px) - max(8px, env(safe-area-inset-bottom)));
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        border-radius: 16px;
        border: 1px solid #cfd8e3;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 18px 34px rgba(15, 24, 36, 0.24);
        padding: 0.66rem;
        gap: 0.36rem;
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transform: translate3d(0, -8px, 0);
        transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
    }

    .nav-menu {
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        overflow-x: hidden !important;
    }

    body.dark-mode .nav-menu {
        border-color: #496079;
        background: rgba(20, 29, 40, 0.97);
    }

    .nav-menu.active,
    body.menu-open .nav-menu {
        display: flex !important;
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        transform: translate3d(0, 0, 0);
        transition-delay: 0s;
    }

    .nav-menu li,
    .nav-menu.active > li,
    body.menu-open .nav-menu > li,
    body.motion-rich .nav-menu.active > li,
    body.perf-lite .nav-menu.active > li {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        animation: none !important;
        pointer-events: auto !important;
    }

    body.menu-open .site-shell {
        overflow: visible !important;
    }

    .nav-menu a,
    .dropbtn {
        width: 100%;
        min-height: 50px;
        padding: 0.55rem 0.68rem;
        border-radius: 12px;
        font-size: 0.94rem;
        line-height: 1.25;
        text-transform: none;
    }

    .dropdown-content {
        position: static !important;
        max-height: 46vh;
        overflow-y: auto;
        margin-top: 0.26rem;
        display: none;
    }

    .dropdown.active .dropdown-content {
        display: block;
    }

    body.menu-open .site-header::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(10, 16, 24, 0.28);
        -webkit-backdrop-filter: blur(2px);
        backdrop-filter: blur(2px);
        z-index: calc(var(--oe-stability-menu-z) - 1);
        pointer-events: none;
    }

    .search-form {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .search-form input,
    .search-form button {
        width: 100%;
        min-width: 0;
        min-height: 2.76rem;
    }

    .archive-wrapper,
    .content-wrapper,
    .content-wrapper.home-layout {
        grid-template-columns: 1fr !important;
    }

    .footer-content {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 599px) {
    .logo-image {
        width: clamp(142px, 52vw, 220px) !important;
        max-height: 72px !important;
    }

    .nav-wrapper-home .logo-image {
        width: 100% !important;
        max-height: clamp(92px, 28vw, 176px) !important;
    }

    .nav-tools {
        gap: 0.32rem;
    }

    .language-switcher select {
        min-width: 4rem;
        max-width: 5.1rem;
        min-height: 2.18rem;
        font-size: 0.76rem;
        padding-right: 1.08rem !important;
    }

    .theme-toggle {
        width: 2.14rem !important;
        height: 2.14rem !important;
        min-height: 2.14rem !important;
        font-size: 0.84rem;
    }

    .hamburger {
        min-width: 44px;
        min-height: 44px;
    }

    .nav-menu {
        border-radius: 14px;
        top: var(--menu-top, 78px) !important;
        padding: 0.54rem;
    }

    .nav-menu a,
    .dropbtn {
        min-height: 46px;
        font-size: 0.9rem;
        padding: 0.5rem 0.6rem;
    }
}

/* Unified dark-mode tuning (desktop + mobile) */
body.dark-mode {
    color-scheme: dark;
    --oe-dark-bg: #0b131c;
    --oe-dark-bg-2: #101b27;
    --oe-dark-shell: #172332;
    --oe-dark-panel: #1b2a3a;
    --oe-dark-panel-soft: #213244;
    --oe-dark-line: #49617a;
    --oe-dark-line-strong: #6181a2;
    --oe-dark-text: #edf4fd;
    --oe-dark-text-soft: #c6d5e6;
    --oe-dark-accent: #8db3d5;
    --oe-dark-accent-strong: #b9d3ea;
    background:
        radial-gradient(1200px 760px at 8% 8%, rgba(121, 155, 189, 0.2), transparent 62%),
        radial-gradient(1100px 840px at 94% 90%, rgba(88, 117, 147, 0.22), transparent 68%),
        linear-gradient(180deg, var(--oe-dark-bg), var(--oe-dark-bg-2));
    color: var(--oe-dark-text);
}

body.dark-mode::before {
    opacity: 0.11;
    mix-blend-mode: normal;
}

body.dark-mode .site-shell {
    border-color: var(--oe-dark-line);
    background: linear-gradient(160deg, #1a2736, #15212e);
    box-shadow: 0 34px 84px rgba(2, 8, 16, 0.62);
}

body.dark-mode .site-shell::before {
    background:
        linear-gradient(150deg, rgba(153, 185, 215, 0.08), transparent 30%),
        radial-gradient(860px 360px at -12% -6%, rgba(104, 135, 166, 0.18), transparent 66%);
}

body.dark-mode .navbar,
body.dark-mode .search-bar {
    border-bottom-color: var(--oe-dark-line);
    background: color-mix(in srgb, #162331 90%, #1d2f43 10%);
}

body.dark-mode :is(
    .main-content, .sidebar, .widget, .archive-section, .search-result, .pdf-card,
    .page-content, .admin-section, .contact-form, .article-form, .category-form, .admin-form,
    .archive-main, .archive-sidebar, .date-picker-box, .newspaper-card, .about-section,
    .values-grid .value-item, .todays-newspaper-section, .article-full, .archive-pdf-item,
    .archive-article-item, .stat-card, .stat-box, .achievements-page, .advertise-page,
    .page-header, .archive-header, .search-header, .category-header, .pdf-library-header, .admin-header,
    .live-widgets-section, .live-widget-card
) {
    border-color: var(--oe-dark-line);
    background: linear-gradient(162deg, var(--oe-dark-panel), #172637);
    box-shadow: 0 10px 24px rgba(1, 8, 16, 0.4);
}

body.dark-mode :is(
    h1, h2, h3, h4, h5, h6, .section-title, .stat-number, .stat-value,
    .live-weather-location, .live-weather-temp, .live-quote-symbol, .live-quote-price,
    .paper-title, .pdf-info h4
) {
    color: var(--oe-dark-text);
}

body.dark-mode :is(
    p, li, small, label, .text-muted, .muted-inline, .page-subtitle, .archive-date-subtitle,
    .newsletter-note, .social-note, .advertise-note, .pdf-mobile-hint, .paper-subtitle,
    .paper-description, .paper-preview-hint, .live-widgets-meta, .live-widget-loading,
    .live-widget-empty, .live-widget-error, .live-weather-condition, .live-weather-meta, .live-quote-name
) {
    color: var(--oe-dark-text-soft);
}

body.dark-mode :is(
    input[type="text"], input[type="email"], input[type="search"], input[type="date"],
    input[type="number"], input[type="password"], textarea, select
) {
    border-color: var(--oe-dark-line);
    background: #162433;
    color: var(--oe-dark-text);
}

body.dark-mode :is(input, textarea)::placeholder {
    color: #95adc6;
    opacity: 1;
}

body.dark-mode :is(
    .btn-secondary, .btn-view, .btn-edit, .btn-small,
    .newspaper-actions a:not(:first-child), .share-btn, .social-links a,
    .paper-mini-btn, .quick-date-btn, .date-link, .pagination a
) {
    border-color: var(--oe-dark-line);
    background: linear-gradient(165deg, #243649, #1f3042);
    color: #e8f2fc;
}

body.dark-mode :is(
    .btn-secondary:hover, .btn-view:hover, .btn-edit:hover, .btn-small:hover,
    .newspaper-actions a:not(:first-child):hover, .share-btn:hover, .social-links a:hover,
    .paper-mini-btn:hover, .quick-date-btn:hover, .date-link:hover, .pagination a:hover
) {
    border-color: var(--oe-dark-line-strong);
    background: linear-gradient(150deg, #2f455d, #273b52);
    color: #ffffff;
}

body.dark-mode :is(.btn-primary, .btn-download, button.btn-primary, .search-form button) {
    border-color: transparent;
    background: linear-gradient(142deg, #7ea7cb, #5f8db6);
    color: #f4faff;
}

body.dark-mode .nav-menu {
    border-color: var(--oe-dark-line) !important;
    background: rgba(20, 31, 44, 0.98) !important;
}

body.dark-mode .nav-menu a,
body.dark-mode .dropbtn {
    color: #dceaf8;
}

body.dark-mode .nav-menu a:hover,
body.dark-mode .dropbtn:hover,
body.dark-mode .nav-menu a.is-current,
body.dark-mode .dropdown.active > .dropbtn {
    border-color: var(--oe-dark-line) !important;
    background: #2a3d52 !important;
    color: #ffffff;
}

body.dark-mode .dropdown-content {
    border-color: var(--oe-dark-line) !important;
    background: linear-gradient(165deg, #213245, #1b2b3d) !important;
}

body.dark-mode :is(.language-switcher select, .theme-toggle, .hamburger) {
    border-color: var(--oe-dark-line) !important;
    background: linear-gradient(160deg, #243548, #1f3041) !important;
    color: #e6f2ff;
}

body.dark-mode .hamburger span {
    background: #dfebf8 !important;
}

body.dark-mode .footer {
    border-top-color: #41586f;
    background:
        linear-gradient(180deg, rgba(18, 28, 39, 0.98), rgba(14, 21, 30, 0.98)),
        #101922;
}

body.dark-mode .footer-section {
    border-color: rgba(90, 114, 138, 0.32);
}

body.dark-mode .footer-section a,
body.dark-mode .footer-bottom a {
    color: #dceaf8;
}

body.dark-mode .footer-section a:hover,
body.dark-mode .footer-bottom a:hover {
    color: #ffffff;
}

body.dark-mode a:focus-visible,
body.dark-mode button:focus-visible,
body.dark-mode input:focus-visible,
body.dark-mode select:focus-visible,
body.dark-mode textarea:focus-visible {
    box-shadow: 0 0 0 3px rgba(145, 183, 214, 0.4);
    border-color: #84adcf;
}

@media (min-width: 1121px) {
    body.dark-mode .site-shell {
        box-shadow: 0 40px 96px rgba(2, 8, 16, 0.7);
    }

    body.dark-mode :is(.main-content, .sidebar, .widget, .article-card, .archive-pdf-item, .archive-article-item, .live-widget-card) {
        box-shadow: 0 14px 30px rgba(2, 9, 18, 0.42);
    }
}

@media (max-width: 1120px) {
    body.dark-mode .site-shell {
        background: #15212e;
        box-shadow: 0 20px 48px rgba(2, 8, 15, 0.54);
    }

    body.dark-mode .nav-menu {
        background: #172636 !important;
        box-shadow: 0 18px 38px rgba(2, 8, 16, 0.58) !important;
    }

    body.dark-mode .search-form input,
    body.dark-mode .search-form button {
        border-color: var(--oe-dark-line);
    }
}

@media (max-width: 599px) {
    body.dark-mode .site-shell {
        border-color: #3f556c;
    }

    body.dark-mode .nav-menu a,
    body.dark-mode .dropbtn {
        color: #e7f3ff;
    }
}

/* Mobile-first priority mode for touch-heavy audiences. */
body.mobile-priority {
    --oe-mobile-tap-min: 46px;
}

html.mobile-priority {
    font-size: var(--ui-root-mobile, 18px) !important;
}

body.mobile-priority:not(.admin-page) {
    line-height: 1.56;
    -webkit-text-size-adjust: 100%;
    overflow-x: clip;
}

body.mobile-priority:not(.admin-page) .site-shell {
    width: calc(100% - 0.56rem) !important;
    margin: 0.24rem auto 1rem !important;
    border-radius: 16px !important;
    box-shadow: 0 11px 28px rgba(22, 34, 47, 0.13) !important;
}

body.mobile-priority:not(.admin-page) .container {
    width: calc(100% - 0.86rem) !important;
    min-width: 0 !important;
}

body.mobile-priority:not(.admin-page) .site-main {
    padding: 0.84rem 0 calc(4.2rem + env(safe-area-inset-bottom)) !important;
}

body.mobile-priority:not(.admin-page) .navbar {
    padding: 1.25rem 0 !important;
}

body.mobile-priority:not(.admin-page) .nav-wrapper,
body.mobile-priority:not(.admin-page) .nav-wrapper-home {
    grid-template-columns: minmax(0, 1fr) auto auto !important;
    gap: 0.52rem !important;
    min-height: 84px !important;
    align-items: center !important;
    min-width: 0 !important;
}

body.mobile-priority:not(.admin-page) .logo {
    min-width: 0 !important;
    gap: 0.8rem !important;
}

body.mobile-priority:not(.admin-page) .logo-image {
    width: clamp(185px, 56vw, 300px) !important;
    max-height: 88px !important;
}

body.mobile-priority:not(.admin-page) .logo-mark {
    width: 2.9rem !important;
    height: 2.9rem !important;
    font-size: 1.2rem !important;
}

body.mobile-priority:not(.admin-page) .logo-name {
    font-size: 1.45rem !important;
}

body.mobile-priority:not(.admin-page) .logo-tag {
    font-size: 0.8rem !important;
    letter-spacing: 0.09em !important;
}

body.mobile-priority:not(.admin-page) .hamburger {
    display: inline-flex !important;
    min-width: 58px !important;
    min-height: 58px !important;
    justify-content: center !important;
    border-radius: 16px !important;
}

body.mobile-priority:not(.admin-page) .nav-tools {
    justify-self: end !important;
    gap: 0.62rem !important;
}

body.mobile-priority:not(.admin-page) .theme-toggle {
    width: 2.85rem !important;
    height: 2.85rem !important;
    font-size: 1rem !important;
    border-radius: 16px !important;
}

body.mobile-priority:not(.admin-page) .language-switcher select {
    min-height: 2.85rem !important;
    font-size: 1rem !important;
    border-radius: 16px !important;
    padding: 0 0.62rem !important;
}

body.mobile-priority:not(.admin-page) .nav-menu {
    display: none;
    position: absolute !important;
    top: var(--menu-top, calc(100% + 0.78rem)) !important;
    left: max(8px, env(safe-area-inset-left)) !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    z-index: 230 !important;
    margin: 0 !important;
    width: auto !important;
    max-height: min(78vh, calc((var(--app-vh, 1vh) * 100) - 154px - env(safe-area-inset-bottom))) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.4rem !important;
    padding: 0.74rem !important;
    border: 1px solid var(--tm-line-strong, var(--line-strong, #bdbfc4)) !important;
    border-radius: 20px !important;
    background: color-mix(in srgb, #ffffff 94%, var(--tm-shell, var(--surface, #ececef)) 6%) !important;
    box-shadow: 0 16px 34px rgba(16, 27, 39, 0.22) !important;
}

body.mobile-priority:not(.admin-page) .nav-menu.active {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
}

body.mobile-priority:not(.admin-page) .nav-menu li {
    width: 100% !important;
}

body.mobile-priority:not(.admin-page) .nav-menu a,
body.mobile-priority:not(.admin-page) .dropbtn {
    width: 100% !important;
    min-height: 60px !important;
    padding: 0.72rem 0.86rem !important;
    border-radius: 14px !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em !important;
    line-height: 1.24 !important;
    text-transform: none !important;
    white-space: normal !important;
    justify-content: flex-start !important;
}

body.mobile-priority:not(.admin-page) .nav-menu .nav-icon {
    display: inline-flex !important;
    width: 1.1rem !important;
    font-size: 0.96rem !important;
    color: var(--tm-text-soft, var(--text-soft, #5a5b5f)) !important;
}

body.mobile-priority:not(.admin-page) .dropdown-content {
    position: static !important;
    width: 100% !important;
    min-width: 0 !important;
    margin-top: 0.28rem !important;
    border-radius: 10px !important;
    max-height: min(42vh, 320px) !important;
    overflow-y: auto !important;
    box-shadow: none !important;
}

body.mobile-priority:not(.admin-page) .dropdown-content a {
    font-size: 0.94rem !important;
    line-height: 1.3 !important;
    padding: 0.7rem 0.74rem !important;
}

body.mobile-priority:not(.admin-page).menu-open .site-header::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 35, 0.24);
    backdrop-filter: blur(2px);
    z-index: 225;
    pointer-events: none;
}

body.mobile-priority:not(.admin-page) .search-form {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
    margin: 0 !important;
}

body.mobile-priority:not(.admin-page) .search-form input,
body.mobile-priority:not(.admin-page) .search-form button {
    width: 100% !important;
    height: 2.9rem !important;
}

body.mobile-priority:not(.admin-page) :is(
    .content-wrapper,
    .content-wrapper.home-layout,
    .archive-wrapper,
    .stats-grid,
    .achievements-grid,
    .advertise-grid,
    .admin-action-grid,
    .live-widgets-grid,
    .about-page .values-grid
) {
    grid-template-columns: 1fr !important;
    gap: 0.76rem !important;
    min-width: 0 !important;
}

body.mobile-priority:not(.admin-page) :is(
    .main-content,
    .sidebar,
    .archive-main,
    .archive-sidebar,
    .page-content,
    .contact-section,
    .about-page,
    .advertise-page
) {
    padding: 0.82rem !important;
    min-width: 0 !important;
}

body.mobile-priority:not(.admin-page) :is(
    .article-card,
    .widget,
    .archive-section,
    .search-result,
    .pdf-card,
    .stat-box,
    .stat-card,
    .archive-pdf-item,
    .archive-article-item,
    .contact-form,
    .date-picker-box,
    .newspaper-card,
    .about-section,
    .values-grid .value-item
) {
    padding: 0.78rem !important;
}

body.mobile-priority:not(.admin-page) .date-input-group,
body.mobile-priority:not(.admin-page) .archive-article-item,
body.mobile-priority:not(.admin-page) .hero-banner,
body.mobile-priority:not(.admin-page) .hero-actions {
    grid-template-columns: 1fr !important;
}

body.mobile-priority:not(.admin-page) .hero-banner {
    gap: 0.78rem !important;
    padding: 0.92rem !important;
}

body.mobile-priority:not(.admin-page) .hero-content h2 {
    font-size: clamp(1.95rem, 9.8vw, 3rem) !important;
    line-height: 0.95 !important;
}

body.mobile-priority:not(.admin-page) .hero-actions {
    display: grid !important;
    gap: 0.48rem !important;
}

body.mobile-priority:not(.admin-page) .hero-actions .btn-primary,
body.mobile-priority:not(.admin-page) .hero-actions .btn-secondary {
    width: 100% !important;
    text-align: center !important;
}

body.mobile-priority:not(.admin-page) :is(.archive-search-box form, .archive-search-box div) {
    display: grid !important;
    gap: 0.5rem !important;
}

body.mobile-priority:not(.admin-page) :is(.newspaper-actions, .pdf-footer, .share-buttons, .admin-actions) {
    flex-direction: column !important;
}

@media (max-width: 900px) {
    body.mobile-priority .site-main {
        padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
    }

    body.mobile-priority :is(
        .btn-primary, .btn-secondary, .btn-view, .btn-download, .btn-edit,
        .share-btn, .paper-mini-btn, .quick-date-btn, .pagination a
    ) {
        min-height: var(--oe-mobile-tap-min);
    }

    body.mobile-priority .newspaper-share-buttons {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.42rem;
    }

    body.mobile-priority .newspaper-share-buttons .share-btn {
        width: 100%;
        justify-content: center;
        margin: 0;
    }

    body.mobile-priority .epaper-ad-slot {
        min-height: 72px;
        padding: 0.34rem;
    }

    body.mobile-priority .epaper-ad-slot.is-filled {
        min-height: 0;
    }

    body.mobile-priority .epaper-ad-media img {
        width: 100%;
        max-height: none;
        object-fit: contain;
    }

    body.mobile-priority .pdf-viewer-toolbar {
        gap: 0.46rem;
    }

    body.mobile-priority .pdf-viewer-wrapper {
        padding: 0.42rem;
        border-radius: 12px;
    }

    body.mobile-priority .live-widgets-grid {
        gap: 0.56rem;
    }

    body.mobile-priority :is(
        .todays-newspaper-section, .live-widgets-section, .article-card,
        .archive-pdf-item, .archive-article-item, .widget, .about-section,
        .page-content, .stat-card, .stat-box
    ) {
        content-visibility: auto;
        contain-intrinsic-size: 380px;
    }
}

@media (max-width: 560px) {
    body.mobile-priority .newspaper-share-buttons {
        grid-template-columns: minmax(0, 1fr);
    }

    body.mobile-priority :is(
        .btn-primary, .btn-secondary, .btn-view, .btn-download, .btn-edit, .share-btn
    ) {
        font-size: 0.9rem;
    }

    body.mobile-priority .pdf-viewer-wrapper {
        padding: 0.34rem;
    }
}

body.dark-mode.mobile-priority .newspaper-share-buttons .share-btn {
    border-color: var(--oe-dark-line);
    background: linear-gradient(165deg, #243649, #1f3042);
    color: #e8f2fc;
}

/* Prevent cropped/zoomed logo-like images in Odisha spotlight (desktop + mobile). */
.odisha-glance-spotlight-media {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(160deg, #f5ecd1, #efe2bf) !important;
}

.odisha-glance-spotlight-media img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    transform: none !important;
    background: transparent !important;
}

/* Fallback visuals on Odisha glance page should never crop. */
.odisha-glance-page img.ogl-image-fallback {
    object-fit: contain !important;
    object-position: center center !important;
    background: linear-gradient(160deg, #f5ecd1, #efe2bf) !important;
}

/* Disable motion zoom for the spotlight media card to avoid false "zoom" effect. */
body.motion-rich .odisha-glance-spotlight-media img,
body.motion-rich .odisha-glance-spotlight:hover .odisha-glance-spotlight-media img {
    --media-scale: 1 !important;
    --media-pan-x: 0px !important;
    --media-pan-y: 0px !important;
    transform: none !important;
}

/* Smoothness pass: remove expensive compositing on low-end/mobile and keep interactions fluid. */
body.perf-lite :is(.hero-banner, .todays-newspaper-section, .article-full, .archive-main, .archive-sidebar, .navbar),
body.mobile-priority :is(.hero-banner, .todays-newspaper-section, .article-full, .archive-main, .archive-sidebar, .navbar) {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

body.perf-lite :is(
    .article-card, .widget, .archive-pdf-item, .archive-article-item, .pdf-card, .search-result,
    .stat-card, .stat-box, .live-widget-card, .heritage-card
) {
    will-change: auto !important;
    transform-style: flat !important;
}

body.perf-lite .site-shell,
body.mobile-priority .site-shell {
    transform: translateZ(0);
    backface-visibility: hidden;
}

body.page-leaving .site-shell,
body.page-leaving .page-transition-curtain {
    contain: paint;
}
