/* Final responsive consistency layer loaded last.
   This neutralizes layout conflicts from earlier stylesheet passes. */

:root {
    --oe-shell-width-desktop: 1320px;
    --oe-shell-width-mobile-gap: 0.56rem;
    --oe-shell-radius-desktop: 28px;
    --oe-shell-radius-mobile: 18px;
    --app-vh: 1vh;
}

@supports (height: 100dvh) {
    :root {
        --app-vh: 1dvh;
    }
}

html {
    font-size: clamp(17px, calc(18px * var(--oe-ui-scale, 1)), 26px);
}

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

@supports (overflow: clip) {
    body {
        overflow-x: clip;
    }
}

.site-shell {
    width: min(var(--oe-shell-width-desktop), calc(100% - 1.45rem));
    margin: 0.95rem auto 1.8rem;
    border-radius: var(--oe-shell-radius-desktop);
}

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

.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.table-wrap table,
.table-wrap .admin-table {
    width: 100%;
    min-width: 640px;
}

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

.site-main {
    padding: 1.08rem 0 2.1rem;
}

.site-header {
    position: relative;
    z-index: 100;
}

.navbar {
    padding: 1.2rem 0;
}

.nav-wrapper,
.nav-wrapper-home {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 470px) minmax(0, 1fr) auto;
    align-items: center;
    min-height: 96px;
    gap: 0.92rem;
    min-width: 0;
}

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

.logo-image {
    width: clamp(300px, 30vw, 510px) !important;
    max-width: 100%;
    max-height: 132px !important;
    height: auto;
    object-fit: contain;
}

.hamburger {
    display: none !important;
}

.nav-menu {
    position: static;
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    max-height: none;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    min-width: 0;
}

.nav-menu li {
    width: auto;
}

.nav-menu a,
.dropbtn {
    min-height: 58px;
    padding: 0.68rem 0.88rem;
    border-radius: 14px;
    font-size: 0.96rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.015em;
    text-transform: uppercase;
    white-space: nowrap;
}

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

.dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 300px;
    max-height: min(60vh, 450px);
    overflow-y: auto;
    padding: 0.4rem;
    z-index: 360;
}

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

.nav-tools {
    justify-self: end;
    gap: 0.56rem;
}

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

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

@media (min-width: 1121px) and (max-width: 1440px) {
    .nav-wrapper,
    .nav-wrapper-home {
        grid-template-columns: minmax(0, 400px) minmax(0, 1fr) auto;
        align-items: start;
        row-gap: 0.28rem;
    }

    .nav-menu {
        flex-wrap: wrap;
        row-gap: 0.3rem;
    }

    .nav-menu a,
    .dropbtn {
        min-height: 48px;
        padding: 0.52rem 0.68rem;
        font-size: 0.84rem;
    }
}

.search-bar {
    padding: 0.58rem 0 0.86rem;
}

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

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

.content-wrapper,
.content-wrapper.home-layout,
.archive-wrapper,
.stats-grid,
.achievements-grid,
.advertise-grid,
.admin-action-grid,
.live-widgets-grid,
.about-page .values-grid {
    gap: 0.92rem;
    min-width: 0;
}

.content-wrapper,
.archive-wrapper {
    align-items: start;
}

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

.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 {
    min-width: 0;
    padding: 0.88rem;
}

.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.9vw, 2.7rem);
    line-height: 1.08;
}

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

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

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

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

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

.hero-content {
    min-width: 0;
}

.hero-content h2 {
    font-size: clamp(2.3rem, 4.8vw, 4.45rem);
    line-height: 0.94;
}

.hero-lead {
    max-width: 64ch;
    font-size: 1.02rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hero-actions .btn-primary,
.hero-actions .btn-secondary {
    width: auto;
}

.home-gallery {
    grid-auto-rows: clamp(188px, 18.8vw, 250px);
}

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

.home-paper-flipper {
    max-width: min(860px, 100%);
    margin-left: auto;
    margin-right: auto;
}

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

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

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

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

.newspaper-pdf-frame-compact {
    min-height: 430px;
    height: min(calc(var(--app-vh, 1vh) * 68), 760px);
}

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

.premium-pdf-host .ppv-stage {
    height: min(calc(var(--app-vh, 1vh) * 72), 980px);
    max-height: min(calc(var(--app-vh, 1vh) * 72), 980px);
}

.premium-pdf-host .ppv-toolbar {
    gap: 0.56rem;
}

.share-buttons,
.newspaper-share-buttons {
    gap: 0.48rem;
}

.footer-content {
    gap: 0.95rem;
}

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;
}

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

@media (max-width: 1120px) {
    html {
        font-size: clamp(16px, calc(17px * var(--oe-ui-scale, 1)), 23px);
    }

    .site-shell {
        width: calc(100% - var(--oe-shell-width-mobile-gap));
        margin: 0.25rem auto 1rem;
        border-radius: var(--oe-shell-radius-mobile);
    }

    .container {
        width: calc(100% - 0.86rem);
    }

    .site-main {
        padding: 0.84rem 0 calc(1.15rem + env(safe-area-inset-bottom));
    }

    .navbar {
        padding: 1rem 0;
    }

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

    .logo-image {
        width: clamp(185px, 56vw, 300px) !important;
        max-height: 88px !important;
    }

    .hamburger {
        display: inline-flex !important;
        order: 3;
        min-width: 56px;
        min-height: 56px;
        border-radius: 14px;
    }

    .nav-tools {
        order: 2;
    }

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

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

    .nav-menu {
        display: none !important;
        position: fixed;
        top: var(--menu-top, 104px);
        left: max(8px, env(safe-area-inset-left));
        right: max(8px, env(safe-area-inset-right));
        bottom: max(8px, env(safe-area-inset-bottom));
        z-index: 280;
        margin: 0;
        width: auto;
        max-height: none;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        flex-direction: column;
        align-items: stretch;
        gap: 0.36rem;
        padding: 0.72rem;
        border: 1px solid var(--tm-line-strong, #cfd8e3);
        border-radius: 18px;
        background: color-mix(in srgb, #ffffff 94%, var(--tm-shell, #e7eef7) 6%);
        box-shadow: 0 16px 34px rgba(16, 27, 39, 0.22);
    }

    body.dark-mode .nav-menu {
        background: rgba(20, 30, 41, 0.96);
    }

    .nav-menu.active {
        display: flex !important;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a,
    .dropbtn {
        width: 100%;
        min-height: 58px;
        padding: 0.68rem 0.84rem;
        border-radius: 12px;
        font-size: 1rem;
        font-weight: 700;
        text-transform: none;
        white-space: normal;
        letter-spacing: 0.01em;
        justify-content: flex-start;
    }

    .nav-menu .nav-icon {
        display: inline-flex;
        width: 1.06rem;
        color: var(--tm-text-soft, #566a80);
    }

    .table-wrap table,
    .table-wrap .admin-table {
        min-width: 560px;
    }

    .dropdown-content {
        display: none;
        position: static;
        width: 100%;
        margin-top: 0.28rem;
        max-height: min(42vh, 320px);
        border-radius: 10px;
        box-shadow: none;
    }

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

    .dropdown-content a {
        font-size: 0.93rem;
        line-height: 1.3;
        padding: 0.64rem 0.7rem;
    }

    body.menu-open .site-header::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(14, 22, 32, 0.24);
        backdrop-filter: blur(2px);
        z-index: 275;
        pointer-events: auto;
    }

    .search-form {
        grid-template-columns: 1fr;
        margin: 0;
    }

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

    .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.7rem, 6.3vw, 2.25rem);
    }

    .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;
        gap: 0.76rem;
    }

    .main-content,
    .sidebar,
    .archive-main,
    .archive-sidebar,
    .page-content,
    .contact-section,
    .about-page,
    .advertise-page,
    .admin-section {
        padding: 0.82rem;
    }

    .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.78rem;
    }

    .archive-article-item {
        grid-template-columns: 1fr;
    }

    .footer-section p,
    .footer-section li,
    .contact-section p,
    .about-section p,
    .widget p,
    .pdf-info p {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .archive-pdf-item img,
    .archive-article-image img,
    .about-page img,
    .contact-section img,
    .home-gallery img,
    .odisha-glance-spotlight img,
    .heritage-card img {
        max-width: 100%;
        height: auto;
    }

    .hero-banner {
        grid-template-columns: 1fr;
        gap: 0.78rem;
        padding: 0.92rem;
    }

    .hero-content h2 {
        font-size: clamp(1.95rem, 9.8vw, 3rem);
        line-height: 0.95;
    }

    .hero-lead {
        font-size: 1rem;
        margin-bottom: 0.72rem;
        max-width: none;
    }

    .hero-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.48rem;
    }

    .hero-actions .btn-primary,
    .hero-actions .btn-secondary {
        width: 100%;
        text-align: center;
    }

    .home-gallery {
        grid-auto-rows: 172px;
    }

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

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

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

    .paper-preview-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.44rem;
    }

    .newspaper-actions,
    .pdf-footer,
    .share-buttons,
    .admin-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.45rem;
    }

    .newspaper-actions a,
    .pdf-footer a,
    .share-btn,
    .admin-actions a,
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-edit,
    .btn-delete,
    .btn-danger,
    .btn-download,
    .btn-view,
    .btn-small {
        width: 100%;
        min-height: 3rem;
    }

    .share-buttons,
    .newspaper-share-buttons {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .share-buttons h4 {
        grid-column: 1 / -1;
    }

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

    .newspaper-pdf-frame-compact,
    .newspaper-pdf-frame-full {
        width: 100%;
        min-height: 430px;
        height: min(calc(var(--app-vh, 1vh) * 74), 680px);
    }

    .premium-pdf-host .ppv-toolbar {
        grid-template-columns: 1fr;
        gap: 0.46rem;
    }

    .premium-pdf-host .ppv-controls {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 0.14rem;
    }

    .premium-pdf-host .ppv-controls::-webkit-scrollbar {
        display: none;
    }

    .premium-pdf-host .ppv-body {
        grid-template-columns: 1fr;
    }

    .premium-pdf-host .ppv-thumbs {
        display: none;
    }

    .premium-pdf-host .ppv-stage {
        height: min(calc(var(--app-vh, 1vh) * 70), 760px);
        max-height: min(calc(var(--app-vh, 1vh) * 70), 760px);
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 0.68rem;
    }

    .admin-fab {
        right: max(10px, env(safe-area-inset-right));
        bottom: max(10px, env(safe-area-inset-bottom));
    }

    body.menu-open {
        overflow: hidden;
        overscroll-behavior: none;
    }
}

@media (max-width: 900px) {
    .language-switcher {
        display: inline-flex;
    }

    .language-switcher select {
        min-width: 4.4rem;
        min-height: 2.5rem;
        font-size: 0.84rem;
        padding: 0 0.46rem;
    }

    .logo-image {
        width: clamp(170px, 58vw, 250px) !important;
        max-height: 78px !important;
    }
}

@media (max-width: 767px) {
    input,
    select,
    textarea,
    button {
        font-size: 16px;
    }
}

@media (max-width: 560px) {
    .site-shell {
        width: calc(100% - 0.4rem);
        margin-top: 0.18rem;
        border-radius: 14px;
    }

    .container {
        width: calc(100% - 0.68rem);
    }

    .nav-wrapper,
    .nav-wrapper-home {
        gap: 0.42rem;
        min-height: 68px;
    }

    .theme-toggle {
        width: 2.45rem;
        height: 2.45rem;
        min-height: 2.45rem;
        font-size: 0.92rem;
    }

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

    .logo-image {
        width: clamp(142px, 58vw, 210px) !important;
        max-height: 64px !important;
    }

    .nav-menu a,
    .dropbtn {
        min-height: 56px;
        font-size: 0.98rem;
        padding: 0.64rem 0.74rem;
    }

    .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.5rem, 8.2vw, 1.95rem);
    }

    .hero-content h2 {
        font-size: clamp(1.72rem, 10.5vw, 2.45rem);
    }

    .hero-lead {
        font-size: 0.98rem;
    }

    .search-bar {
        padding: 0.5rem 0 0.7rem;
    }

    .search-form {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.42rem;
    }

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

    .home-gallery {
        grid-auto-rows: 156px;
    }

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

    .paper-preview-actions {
        grid-template-columns: 1fr;
    }

    .newspaper-pdf-frame-compact,
    .newspaper-pdf-frame-full {
        min-height: 390px;
    }

    .share-buttons,
    .newspaper-share-buttons {
        grid-template-columns: 1fr;
    }
}
