﻿:root {
    --ink: #1a1a1a;
    --muted: #666;
    --line: #d6d6d6;
    --soft: #f4f4f4;
    --paper-bg: #dcdcdc;
    --white: #fff;
    --brand: #c40000;
    --brand-dark: #8a0000;
    --header: #202020;
    --shadow: 0 8px 22px rgba(0, 0, 0, .15);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    color: var(--ink);
    background: #ececec;
    font-family: Arial, "Noto Sans Devanagari", "Mangal", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1240px, calc(100% - 24px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    color: #fff;
    background: var(--header);
    box-shadow: 0 3px 14px rgba(0, 0, 0, .22);
}

.utility-row {
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    font-size: 13px;
    color: #efefef;
    border-bottom: 1px solid rgba(255, 255, 255, .13);
}

.header-grid {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--brand);
    border-radius: 4px;
    font-size: 24px;
    font-weight: 900;
}

.brand strong {
    display: block;
    font-family: Georgia, "Noto Serif Devanagari", serif;
    font-size: 26px;
    line-height: 1;
}

.brand small {
    color: #dcdcdc;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
}

.main-nav a {
    padding: 8px 10px;
    border-radius: 4px;
}

.main-nav a:hover {
    background: var(--brand);
}

.edition-bar {
    color: #fff;
    background: var(--brand);
    border-bottom: 3px solid var(--brand-dark);
}

.edition-grid {
    min-height: 74px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 10px 0;
}

.eyebrow {
    margin: 0 0 3px;
    color: #ffe4e4;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-family: Georgia, "Noto Serif Devanagari", serif;
    font-size: 32px;
    line-height: 1.1;
}

.edition-panel {
    display: grid;
    grid-template-columns: 135px 155px 105px 128px;
    gap: 8px;
    align-items: end;
    padding: 10px;
    color: var(--ink);
    background: #fff;
    border-radius: 5px;
    box-shadow: var(--shadow);
}

.edition-panel label,
.upload-grid label,
.file-field {
    display: grid;
    gap: 5px;
    font-size: 13px;
    font-weight: 800;
}

.edition-panel select,
.edition-panel input,
.edition-panel button,
.upload-grid input,
.upload-grid select,
.file-field input,
.article-input input,
.article-input textarea {
    width: 100%;
    min-height: 36px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 4px;
    font: inherit;
}

.edition-panel button,
.tool-buttons button,
.save-button,
.toolbar-link,
.upload-link,
.button-link {
    border: 0;
    color: #fff;
    background: var(--brand);
    border-radius: 4px;
    font-weight: 800;
    cursor: pointer;
}

.edition-panel button:hover,
.tool-buttons button:hover,
.save-button:hover,
.toolbar-link:hover,
.upload-link:hover,
.button-link:hover {
    background: var(--brand-dark);
}

.ticker {
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.ticker-inner {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.ticker strong {
    padding: 5px 9px;
    color: #fff;
    background: var(--brand);
    border-radius: 4px;
}

.epaper-layout {
    width: calc(100vw - 12px);
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-areas:
        "pages pages"
        "paper news";
    gap: 10px;
    margin: 0 6px;
    padding: 10px 0 24px;
}

.sidebar,
.viewer-shell,
.news-panel,
.archives,
.article-box,
.upload-box {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 5px;
}

.sidebar {
    grid-area: pages;
    padding: 9px;
}

.section-title {
    display: grid;
    gap: 3px;
    margin-bottom: 10px;
}

.sidebar .section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.section-title span,
.muted,
.thumb small,
.news-card span,
.site-footer p {
    color: var(--muted);
}

.section-title strong {
    font-size: 18px;
}

.page-list {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.thumb {
    min-width: 118px;
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 6px;
    align-items: center;
    padding: 7px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 4px;
    font-size: 13px;
}

.thumb.active {
    border-color: var(--brand);
    box-shadow: inset 3px 0 0 var(--brand);
}

.thumb:hover {
    border-color: var(--brand);
}

.thumb span:not(.mini-paper),
.thumb small {
    grid-column: 2;
}

.mini-paper {
    grid-row: 1 / span 2;
    width: 22px;
    height: 30px;
    display: grid;
    gap: 2px;
    padding: 4px;
    background: #fffdf8;
    border: 1px solid #bdbdbd;
}

.mini-paper i {
    display: block;
    background: #aaa;
}

.upload-link,
.button-link {
    display: inline-flex;
    justify-content: center;
    margin-top: 9px;
    padding: 9px 11px;
}

.viewer-shell {
    grid-area: paper;
    min-width: 0;
    overflow: hidden;
}

.viewer-toolbar {
    position: sticky;
    top: 90px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    background: #fafafa;
    border-bottom: 1px solid var(--line);
}

.viewer-toolbar strong {
    display: block;
}

.tool-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.tool-buttons button,
.toolbar-link {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
}

.paper-stage {
    min-height: calc(100vh - 150px);
    padding: 10px;
    overflow: auto;
    background: var(--paper-bg);
}

.uploaded-paper {
    width: min(100%, 1320px);
    min-height: 78vh;
    margin: 0 auto;
    transform-origin: top center;
    background: #fff;
    border: 1px solid #aaa;
    box-shadow: var(--shadow);
    transition: transform .15s ease;
}

.paper-image {
    display: block;
    width: 100%;
    height: auto;
}

.paper-pdf {
    display: block;
    width: 100%;
    min-height: calc(100vh - 170px);
    border: 0;
}

.empty-paper {
    min-height: 520px;
    display: grid;
    place-content: center;
    gap: 12px;
    padding: 28px;
    text-align: center;
}

.news-panel {
    grid-area: news;
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 102px);
    overflow: auto;
    padding: 10px;
}

.news-panel .section-title strong {
    color: var(--brand-dark);
}

.news-list {
    display: grid;
    gap: 9px;
}

.news-card {
    display: grid;
    gap: 5px;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-left: 4px solid var(--brand);
    border-radius: 4px;
}

.news-card:hover {
    border-color: var(--brand);
    box-shadow: 0 4px 12px rgba(196, 0, 0, .12);
}

.news-card strong {
    color: var(--brand-dark);
    font-size: 16px;
    line-height: 1.35;
}

.news-card span {
    font-size: 14px;
    line-height: 1.45;
}

.archives {
    padding: 18px;
    margin-bottom: 28px;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 9px;
}

.archive-grid a {
    display: grid;
    gap: 5px;
    padding: 11px;
    background: #f8f8f8;
    border: 1px solid var(--line);
    border-radius: 4px;
}

.archive-grid a:hover {
    border-color: var(--brand);
}

.site-footer {
    padding: 24px 0;
    color: #fff;
    background: var(--header);
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

.footer-grid p {
    max-width: 580px;
}

.footer-grid div:last-child {
    display: grid;
    gap: 8px;
}

.article-page,
.upload-page {
    padding: 26px 0 40px;
}

.article-box,
.upload-box {
    max-width: 920px;
    margin: 0 auto;
    padding: 22px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.article-meta span {
    padding: 6px 10px;
    color: #fff;
    background: var(--brand);
    border-radius: 4px;
    font-size: 13px;
    font-weight: 800;
}

.article-box h1 {
    color: var(--ink);
    font-size: 36px;
}

.article-summary {
    color: var(--brand-dark);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.55;
}

.article-body {
    white-space: pre-line;
    font-family: Georgia, "Noto Serif Devanagari", serif;
    font-size: 18px;
    line-height: 1.8;
}

.upload-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.file-field,
.compact-title,
.article-inputs,
.save-button {
    margin-top: 18px;
}

.article-inputs {
    display: grid;
    gap: 14px;
}

.article-input {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
    background: #fafafa;
    border: 1px solid var(--line);
    border-radius: 5px;
}

.article-input textarea {
    grid-column: 1 / -1;
}

.save-button {
    min-height: 42px;
    padding: 0 18px;
    font: inherit;
}

.status-message {
    display: block;
    margin-bottom: 12px;
    font-weight: 800;
}

.status-message.error {
    color: var(--brand-dark);
}

.status-message.success {
    color: #167a31;
}

@media (min-width: 1600px) {
    .epaper-layout {
        grid-template-columns: minmax(0, 1fr) 320px;
    }

    .uploaded-paper {
        width: min(100%, 1500px);
    }
}

@media (max-width: 1100px) {
    .edition-grid,
    .epaper-layout {
        grid-template-columns: 1fr;
    }

    .epaper-layout {
        grid-template-areas:
            "pages"
            "news"
            "paper";
    }

    .edition-panel,
    .upload-grid {
        grid-template-columns: repeat(2, 1fr);
        width: 100%;
    }

    .news-panel,
    .viewer-toolbar {
        position: static;
        max-height: none;
    }

    .news-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .archive-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 700px) {
    .utility-row,
    .header-grid,
    .viewer-toolbar,
    .footer-grid {
        align-items: flex-start;
        flex-direction: column;
    }

    .main-nav,
    .tool-buttons {
        flex-wrap: wrap;
    }

    .edition-panel,
    .news-list,
    .upload-grid,
    .article-input,
    .archive-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 28px;
    }

    .paper-stage {
        padding: 6px;
    }

    .article-box h1 {
        font-size: 30px;
    }
}

@media print {
    .site-header,
    .edition-bar,
    .ticker,
    .sidebar,
    .viewer-toolbar,
    .archives,
    .news-panel,
    .site-footer {
        display: none;
    }

    body,
    .paper-stage {
        background: #fff;
    }

    .epaper-layout {
        display: block;
        padding: 0;
    }

    .viewer-shell,
    .uploaded-paper {
        border: 0;
        box-shadow: none;
    }
}

/* Browser-visible final e-paper polish */
.container.epaper-layout {
    width: calc(100vw - 20px);
    max-width: none;
    margin-left: 10px;
    margin-right: 10px;
}

.epaper-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
    grid-template-areas:
        "pages pages"
        "paper news";
}

.viewer-shell {
    width: 100%;
}

.paper-stage {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: calc(100vh - 155px);
    padding: 10px;
}

.uploaded-paper {
    width: min(100%, 1480px);
    max-width: 1480px;
    min-height: calc(100vh - 178px);
}

.paper-pdf {
    min-height: calc(100vh - 178px);
}

.news-panel {
    width: 280px;
}

@media (min-width: 1800px) {
    .epaper-layout {
        grid-template-columns: minmax(0, 1fr) 300px;
    }

    .uploaded-paper {
        width: min(100%, 1580px);
        max-width: 1580px;
    }

    .news-panel {
        width: 300px;
    }
}

/* Attractive balanced e-paper view */
.container.epaper-layout {
    width: min(1480px, calc(100vw - 28px));
    max-width: 1480px;
    margin: 18px auto 30px;
}

.epaper-layout {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr) 300px;
    grid-template-areas: "pages paper news";
    align-items: start;
    gap: 14px;
    padding: 0;
}

.sidebar {
    grid-area: pages;
    position: sticky;
    top: 98px;
    padding: 14px;
}

.sidebar .section-title {
    display: grid;
    align-items: start;
    justify-content: stretch;
    gap: 4px;
    margin-bottom: 12px;
}

.page-list {
    display: grid;
    gap: 10px;
    overflow: visible;
    padding: 0;
}

.thumb {
    min-width: 0;
    grid-template-columns: 38px 1fr;
    gap: 9px;
    padding: 9px;
    font-size: 14px;
}

.mini-paper {
    width: 34px;
    height: 46px;
    gap: 3px;
    padding: 6px;
}

.upload-link {
    width: 100%;
    margin-top: 14px;
}

.viewer-shell {
    grid-area: paper;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .08);
}

.viewer-toolbar {
    position: static;
    padding: 10px 14px;
    background: #fff;
}

.paper-stage {
    display: block;
    min-height: calc(100vh - 190px);
    padding: 18px;
    overflow: auto;
    background: linear-gradient(180deg, #e7e7e7, #d7d7d7);
}

.uploaded-paper {
    width: min(100%, 980px);
    max-width: 980px;
    min-height: auto;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #b9b9b9;
    box-shadow: 0 14px 30px rgba(0, 0, 0, .18);
}

.paper-image {
    display: block;
    width: 100%;
    height: auto;
}

.paper-pdf {
    display: block;
    width: 100%;
    min-height: 1180px;
    border: 0;
}

.news-panel {
    grid-area: news;
    position: sticky;
    top: 98px;
    width: auto;
    max-height: calc(100vh - 116px);
    padding: 14px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .08);
}

.news-panel .section-title {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.news-list {
    gap: 11px;
}

.news-card {
    padding: 12px;
    background: #fffafa;
    border: 1px solid #ead1d1;
    border-left: 4px solid var(--brand);
}

.news-card strong {
    font-size: 16px;
}

.news-card span {
    font-size: 14px;
}

.edition-grid {
    min-height: 82px;
}

.ticker-inner {
    width: min(1480px, calc(100vw - 28px));
}

@media (min-width: 1600px) {
    .container.epaper-layout {
        max-width: 1540px;
    }

    .epaper-layout {
        grid-template-columns: 220px minmax(0, 1fr) 320px;
    }

    .uploaded-paper {
        width: min(100%, 1040px);
        max-width: 1040px;
    }
}

@media (max-width: 1200px) {
    .epaper-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "pages"
            "news"
            "paper";
    }

    .sidebar,
    .news-panel {
        position: static;
        max-height: none;
    }

    .page-list,
    .news-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Final reader fit: avoid PDF clipping and improve balance */
.container.epaper-layout {
    width: min(1560px, calc(100vw - 32px));
}

.epaper-layout {
    grid-template-columns: 230px minmax(760px, 1fr) 300px;
    gap: 16px;
}

.paper-stage {
    padding: 16px;
    overflow: auto;
}

.uploaded-paper {
    width: min(100%, 920px);
    max-width: 920px;
}

.paper-pdf {
    width: 100%;
    min-height: 1120px;
    background: #fff;
}

.viewer-toolbar {
    border-radius: 5px 5px 0 0;
}

.sidebar,
.news-panel,
.viewer-shell {
    border-color: #cfcfcf;
}

.news-panel {
    background: #fff;
}

@media (min-width: 1600px) {
    .container.epaper-layout {
        max-width: 1600px;
    }

    .uploaded-paper {
        width: min(100%, 980px);
        max-width: 980px;
    }
}

.current-file-message {
    display: block;
    margin: 8px 0 14px;
    padding: 10px 12px;
    border-radius: 4px;
    font-weight: 700;
}

.current-file-message.success {
    color: #0b6630;
    background: #eaf7ef;
    border: 1px solid #bfe4ca;
}

.current-file-message.warning {
    color: #8a5a00;
    background: #fff7e3;
    border: 1px solid #f1d899;
}

.field-hint {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

/* Empty issue state: hide sample-news area and emphasize upload prompt */
.epaper-layout.no-news {
    grid-template-columns: 230px minmax(760px, 1fr);
    grid-template-areas: "pages paper";
    max-width: 1280px;
}

.epaper-layout.no-news .viewer-shell {
    min-height: 620px;
}

.epaper-layout.no-news .paper-stage {
    min-height: 620px;
    display: grid;
    place-items: center;
    padding: 28px;
    background: linear-gradient(180deg, #f4f4f4, #e0e0e0);
}

.epaper-layout.no-news .uploaded-paper {
    width: min(100%, 720px);
    max-width: 720px;
    min-height: 430px;
    display: grid;
    place-items: center;
    border: 2px dashed #d29a9a;
    box-shadow: 0 16px 36px rgba(0, 0, 0, .12);
}

.empty-paper {
    min-height: 430px;
    width: 100%;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 16px;
    padding: 42px;
    text-align: center;
    background: #fff;
}

.empty-paper strong {
    color: var(--brand-dark);
    font-size: 28px;
    line-height: 1.35;
}

.empty-paper span {
    max-width: 520px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.55;
}

.empty-paper a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    color: #fff;
    background: var(--brand);
    border-radius: 5px;
    font-weight: 800;
}

.empty-paper a:hover {
    background: var(--brand-dark);
}

@media (max-width: 1200px) {
    .epaper-layout.no-news {
        grid-template-columns: 1fr;
        grid-template-areas:
            "pages"
            "paper";
    }
}

/* Real page thumbnails and clean image viewer */
.epaper-layout {
    grid-template-columns: 270px minmax(760px, 1fr) 300px;
}

.sidebar {
    padding: 16px;
}

.page-list {
    display: grid;
    gap: 14px;
}

.thumb {
    grid-template-columns: 76px 1fr;
    min-height: 104px;
    padding: 10px;
    align-items: center;
    background: #fff;
    border: 1px solid #d4d4d4;
    border-radius: 6px;
}

.thumb.active {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(196, 0, 0, .08), inset 4px 0 0 var(--brand);
}

.thumb-image {
    grid-row: 1 / span 2;
    width: 66px;
    height: 88px;
    object-fit: cover;
    object-position: top center;
    background: #f7f7f7;
    border: 1px solid #bdbdbd;
    box-shadow: 0 3px 9px rgba(0, 0, 0, .14);
}

.thumb span:not(.mini-paper),
.thumb small {
    grid-column: 2;
}

.thumb span:not(.mini-paper) {
    color: var(--ink);
    font-size: 16px;
    font-weight: 800;
}

.thumb small {
    font-size: 13px;
}

.paper-stage {
    background: #e9e9e9;
}

.uploaded-paper {
    width: min(100%, 940px);
    max-width: 940px;
    min-height: auto;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.paper-image {
    display: block;
    width: 100%;
    height: auto;
    background: #fff;
    border: 1px solid #c8c8c8;
    box-shadow: 0 16px 36px rgba(0, 0, 0, .22);
}

@media (min-width: 1600px) {
    .epaper-layout {
        grid-template-columns: 280px minmax(820px, 1fr) 320px;
    }

    .uploaded-paper {
        width: min(100%, 1020px);
        max-width: 1020px;
    }
}

/* Wider readable newspaper area */
.container.epaper-layout {
    width: min(1660px, calc(100vw - 20px));
    max-width: 1660px;
}

.epaper-layout {
    grid-template-columns: 270px minmax(900px, 1fr) 260px;
    gap: 12px;
}

.news-panel {
    width: 260px;
}

.paper-stage {
    padding-left: 10px;
    padding-right: 10px;
}

.uploaded-paper {
    width: min(100%, 1120px);
    max-width: 1120px;
}

@media (min-width: 1700px) {
    .container.epaper-layout {
        max-width: 1760px;
    }

    .uploaded-paper {
        width: min(100%, 1220px);
        max-width: 1220px;
    }
}

/* Make the readable PDF/image block use more available width */
.container.epaper-layout {
    width: min(1840px, calc(100vw - 12px));
    max-width: 1840px;
}

.epaper-layout {
    grid-template-columns: 260px minmax(1040px, 1fr) 220px;
    gap: 10px;
}

.sidebar {
    padding: 12px;
}

.news-panel {
    width: 220px;
    padding: 10px;
}

.paper-stage {
    padding-left: 6px;
    padding-right: 6px;
}

.uploaded-paper {
    width: min(100%, 1320px);
    max-width: 1320px;
}

@media (min-width: 1700px) {
    .uploaded-paper {
        width: min(100%, 1420px);
        max-width: 1420px;
    }
}

/* Wider Bhawani Times readable block when no right news panel is shown */
.container.epaper-layout.no-news {
    width: min(1880px, calc(100vw - 10px));
    max-width: 1880px;
    margin-left: auto;
    margin-right: auto;
}

.epaper-layout.no-news {
    grid-template-columns: 260px minmax(1120px, 1fr);
    grid-template-areas: "pages paper";
    gap: 10px;
}

.epaper-layout.no-news .paper-stage {
    display: block;
    padding: 8px;
    min-height: calc(100vh - 150px);
}

.epaper-layout.no-news .uploaded-paper {
    width: min(100%, 1420px);
    max-width: 1420px;
    min-height: auto;
    margin: 0 auto;
    border: 0;
    box-shadow: none;
}

.epaper-layout.no-news .paper-image {
    width: 100%;
    max-width: none;
}

@media (min-width: 1700px) {
    .epaper-layout.no-news .uploaded-paper {
        width: min(100%, 1520px);
        max-width: 1520px;
    }
}

/* Prevent blue browser selection overlay on newspaper image */
.uploaded-paper,
.paper-image,
.thumb-image {
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

.paper-image::selection,
.thumb-image::selection {
    background: transparent;
}

.paper-image {
    cursor: default;
}

/* Responsive reader reset: fit paper naturally instead of forcing huge width */
.container.epaper-layout,
.container.epaper-layout.no-news {
    width: min(1440px, calc(100vw - 24px));
    max-width: 1440px;
    margin: 14px auto 28px;
}

.epaper-layout,
.epaper-layout.no-news {
    grid-template-columns: 250px minmax(0, 1fr) 280px;
    grid-template-areas: "pages paper news";
    gap: 14px;
}

.epaper-layout.no-news {
    grid-template-columns: 250px minmax(0, 1fr);
    grid-template-areas: "pages paper";
}

.paper-stage,
.epaper-layout.no-news .paper-stage {
    display: block;
    min-height: calc(100vh - 190px);
    padding: 16px;
    overflow: auto;
}

.uploaded-paper,
.epaper-layout.no-news .uploaded-paper {
    width: min(100%, 980px);
    max-width: 980px;
    min-height: auto;
    margin: 0 auto;
}

.paper-image,
.epaper-layout.no-news .paper-image {
    width: 100%;
    max-width: 100%;
    height: auto;
}

.sidebar {
    width: auto;
}

.news-panel {
    width: auto;
}

@media (min-width: 1500px) {
    .container.epaper-layout,
    .container.epaper-layout.no-news {
        max-width: 1520px;
    }

    .uploaded-paper,
    .epaper-layout.no-news .uploaded-paper {
        width: min(100%, 1060px);
        max-width: 1060px;
    }
}

@media (max-width: 1150px) {
    .container.epaper-layout,
    .container.epaper-layout.no-news {
        width: min(100%, calc(100vw - 18px));
        margin-top: 10px;
    }

    .epaper-layout,
    .epaper-layout.no-news {
        grid-template-columns: 1fr;
        grid-template-areas:
            "pages"
            "paper"
            "news";
    }

    .sidebar,
    .news-panel {
        position: static;
        max-height: none;
    }

    .page-list {
        display: flex;
        overflow-x: auto;
        gap: 10px;
    }

    .thumb {
        min-width: 190px;
    }
}

@media (max-width: 700px) {
    .paper-stage,
    .epaper-layout.no-news .paper-stage {
        padding: 8px;
    }

    .page-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        overflow: visible;
    }

    .thumb {
        min-width: 0;
        grid-template-columns: 54px 1fr;
        min-height: 82px;
    }

    .thumb-image {
        width: 48px;
        height: 64px;
    }

    .tool-buttons button,
    .toolbar-link {
        min-height: 30px;
        padding: 0 8px;
        font-size: 13px;
    }
}
/* Print only the readable newspaper page */
@media print {
    @page {
        margin: 6mm;
    }

    body {
        background: #fff !important;
    }

    .site-header,
    .edition-bar,
    .ticker,
    .sidebar,
    .viewer-toolbar,
    .archives,
    .news-panel,
    .site-footer,
    .empty-paper {
        display: none !important;
    }

    .container,
    .epaper-layout,
    .epaper-layout.no-news,
    .viewer-shell,
    .paper-stage,
    .uploaded-paper {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        background: #fff !important;
        overflow: visible !important;
        transform: none !important;
    }

    .paper-image {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    .paper-pdf {
        display: block !important;
        width: 100% !important;
        height: 95vh !important;
        border: 0 !important;
    }
}

