/* /assets/css/style.css
 * ePaper Opti Webopz - Frontend Newspaper Stylesheet
 * Version: 5.0.0
 * Changelog:
 *   2026-03-29 v5.0.0 - Phase 1 Foundation.
 *                       - Full mobile-responsive overhaul (320px / 768px / 1280px+).
 *                       - Dark mode via [data-theme="dark"] + prefers-color-scheme.
 *                       - Font-size controls (sm / md / lg classes on .np-page).
 *                       - Share bar in article modal (WhatsApp, Facebook, X, Copy Link).
 *                       - Breaking news ticker.
 *                       - Minimum 44×44px tap targets on all interactive elements.
 *                       - Thumbnail page-strip on mobile.
 *                       - "Admin" button hidden from public visitors.
 *                       - Reading toolbar (dark toggle, font size, search toggle).
 */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ══════════════════════════════════════
   CSS CUSTOM PROPERTIES (Light mode)
══════════════════════════════════════ */
:root {
    --primary:        #01568c;
    --primary-dark:   #013d66;
    --primary-light:  #0278bf;
    --sidebar-bg:     #1e3a52;
    --sidebar-hover:  #254d6b;
    --sidebar-active: #01568c;
    --sidebar-text:   #c8dde8;
    --sidebar-w:      180px;
    --archive-w:      260px;
    --header-h:       52px;
    --bg:             #f5f0e8;
    --white:          #ffffff;
    --border:         #c8bfad;
    --text:           #1a1a1a;
    --text-muted:     #6b7280;
    --np-font:        Georgia, 'Times New Roman', Times, serif;
    --np-sans:        Arial, 'Helvetica Neue', sans-serif;
    --radius:         4px;
    --shadow:         0 2px 8px rgba(0,0,0,.1);
    --modal-bg:       #ffffff;
    --modal-header-bg:#f9f7f3;
    --ticker-bg:      #c0392b;
    --ticker-text:    #ffffff;
    /* font scale – controlled by .np-text-sm/md/lg */
    --article-font-size: 0.83rem;
}

/* ══════════════════════════════════════
   DARK MODE
══════════════════════════════════════ */
[data-theme="dark"] {
    --bg:             #0f1117;
    --white:          #1a1d27;
    --border:         #2e3340;
    --text:           #e5e7eb;
    --text-muted:     #9ca3af;
    --modal-bg:       #1a1d27;
    --modal-header-bg:#111318;
    --primary:        #4a9fcf;
    --primary-dark:   #0278bf;
    --primary-light:  #60b8e8;
    --sidebar-bg:     #111318;
    --sidebar-hover:  #1e2433;
    --sidebar-active: #1e3a52;
    --sidebar-text:   #9bb8cd;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg:             #0f1117;
        --white:          #1a1d27;
        --border:         #2e3340;
        --text:           #e5e7eb;
        --text-muted:     #9ca3af;
        --modal-bg:       #1a1d27;
        --modal-header-bg:#111318;
        --primary:        #4a9fcf;
        --primary-dark:   #0278bf;
        --primary-light:  #60b8e8;
        --sidebar-bg:     #111318;
        --sidebar-hover:  #1e2433;
        --sidebar-active: #1e3a52;
        --sidebar-text:   #9bb8cd;
    }
}

html { font-size: 15px; }
body { font-family: var(--np-sans); background: var(--bg); color: var(--text); min-height: 100vh; transition: background .2s, color .2s; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; height: auto; }

/* ══════════════════════════════════════
   BREAKING NEWS TICKER
══════════════════════════════════════ */
.breaking-ticker {
    background: var(--ticker-bg);
    color: var(--ticker-text);
    font-size: .75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    overflow: hidden;
    height: 32px;
    position: sticky;
    top: 0;
    z-index: 210;
}
.ticker-label {
    background: rgba(0,0,0,.3);
    padding: 0 .75rem;
    white-space: nowrap;
    flex-shrink: 0;
    height: 100%;
    display: flex;
    align-items: center;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: .68rem;
}
.ticker-track {
    flex: 1;
    overflow: hidden;
    position: relative;
}
.ticker-inner {
    white-space: nowrap;
    display: inline-block;
    animation: ticker-scroll 25s linear infinite;
    padding-left: 100%;
}
.ticker-inner:hover { animation-play-state: paused; }
@keyframes ticker-scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

/* ══════════════════════════════════════
   HEADER
══════════════════════════════════════ */
.epaper-header {
    background: var(--primary);
    color: #fff;
    height: var(--header-h);
    padding: 0 1rem;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 200;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
/* When ticker is visible, header sticks below it */
.has-ticker .epaper-header { top: 32px; }

.header-left  { display: flex; align-items: center; gap: .65rem; min-width: 0; flex: 1; }
.menu-toggle  {
    display: none; background: none; border: none; color: #fff;
    font-size: 1.3rem; cursor: pointer;
    min-width: 44px; min-height: 44px;
    display: none; align-items: center; justify-content: center;
}
.header-brand { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-name   { font-size: 1rem; font-weight: 800; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-tagline{ font-size: .68rem; opacity: .75; }
.header-right { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.header-date-str { font-size: .75rem; opacity: .8; white-space: nowrap; }

/* ── Header toolbar buttons ── */
.header-tool-btn {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    color: #fff;
    border-radius: var(--radius);
    min-width: 36px; min-height: 36px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: .8rem; transition: background .12s;
    padding: 0 .45rem; gap: .3rem; white-space: nowrap;
}
.header-tool-btn:hover { background: rgba(255,255,255,.28); }
.header-tool-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.header-search-bar {
    display: none; align-items: center;
    background: rgba(255,255,255,.9);
    border-radius: var(--radius);
    overflow: hidden; flex: 1; max-width: 360px;
}
.header-search-bar.open { display: flex; }
.header-search-bar input {
    border: none; outline: none; padding: .35rem .6rem;
    font-size: .82rem; background: transparent; color: #1a1a1a; flex: 1; min-width: 0;
}
.header-search-bar button {
    background: var(--primary); border: none; color: #fff;
    padding: .35rem .6rem; cursor: pointer; font-size: .8rem;
    min-width: 40px; min-height: 36px;
}

/* Font size controls */
.font-size-controls { display: flex; gap: 2px; }
.font-size-btn {
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
    color: #fff; cursor: pointer; border-radius: var(--radius);
    min-width: 30px; min-height: 34px; font-family: Georgia, serif;
    transition: background .12s; display: flex; align-items: center; justify-content: center;
}
.font-size-btn:hover { background: rgba(255,255,255,.28); }
.font-size-btn.active { background: rgba(255,255,255,.35); font-weight: 700; }
.font-size-btn.sz-sm { font-size: .72rem; }
.font-size-btn.sz-md { font-size: .82rem; }
.font-size-btn.sz-lg { font-size: .95rem; }

/* Admin button — only shown when .admin-visible is on body */
.header-admin-btn {
    display: none;
    color: #fff; background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3); border-radius: var(--radius);
    padding: .25rem .65rem; font-size: .75rem; font-weight: 600; transition: background .12s;
    min-height: 36px; align-items: center;
}
.admin-visible .header-admin-btn { display: flex; }
.header-admin-btn:hover { background: rgba(255,255,255,.28); text-decoration: none; }

/* ══════════════════════════════════════
   LAYOUT
══════════════════════════════════════ */
.epaper-layout {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr var(--archive-w);
    min-height: calc(100vh - var(--header-h));
    align-items: start;
}

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.epaper-sidebar {
    background: var(--sidebar-bg);
    min-height: calc(100vh - var(--header-h));
    display: flex; flex-direction: column;
    position: sticky; top: var(--header-h);
    height: calc(100vh - var(--header-h));
    overflow-y: auto;
}
.has-ticker .epaper-sidebar { top: calc(var(--header-h) + 32px); height: calc(100vh - var(--header-h) - 32px); }

.sidebar-header-row { padding: .55rem .75rem; border-bottom: 1px solid rgba(255,255,255,.08); flex-shrink: 0; }
.sidebar-read-web { color: #fff; font-size: .72rem; font-weight: 700; display: block; opacity: .9; }
.sidebar-read-web:hover { opacity: 1; text-decoration: none; }

.sidebar-list { list-style: none; flex: 1; overflow-y: auto; }
.sidebar-no-pages { padding: 1rem .75rem; color: rgba(255,255,255,.4); font-size: .78rem; }
.sidebar-item { border-bottom: 1px solid rgba(255,255,255,.05); }
.sidebar-link {
    display: flex; align-items: center; min-height: 44px;
    padding: .5rem .75rem;
    color: var(--sidebar-text); font-size: .82rem;
    transition: background .12s, color .12s;
    border-left: 3px solid transparent; cursor: pointer;
}
.sidebar-link:hover  { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.sidebar-item.active .sidebar-link,
.sidebar-link.active { background: var(--sidebar-active); color: #fff; font-weight: 700; border-left-color: #7ec8e3; }

.sidebar-date-section {
    padding: .6rem .75rem; border-top: 1px solid rgba(255,255,255,.1);
    flex-shrink: 0; background: rgba(0,0,0,.2);
}
.sidebar-date-label { font-size: .68rem; color: rgba(255,255,255,.55); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .3rem; }
#date-picker {
    width: 100%; padding: .35rem .4rem; font-size: .76rem;
    border: 1px solid rgba(255,255,255,.2); border-radius: var(--radius);
    background: rgba(255,255,255,.1); color: #fff; margin-bottom: .35rem;
    cursor: pointer; outline: none; min-height: 36px;
}
#date-picker::-webkit-calendar-picker-indicator { filter: invert(1); }
.sidebar-date-nav { display: flex; gap: .25rem; justify-content: center; }
.nav-btn {
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
    color: #fff; border-radius: var(--radius); padding: .22rem .45rem;
    font-size: .72rem; cursor: pointer; transition: background .12s; flex: 1; text-align: center;
    min-height: 36px; display: flex; align-items: center; justify-content: center;
}
.nav-btn:hover:not(:disabled) { background: rgba(255,255,255,.25); }
.nav-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ══════════════════════════════════════
   MAIN — newspaper page
══════════════════════════════════════ */
.epaper-main {
    background: var(--white);
    padding: .75rem 1.1rem 2rem;
    min-height: calc(100vh - var(--header-h));
    border-right: 1px solid var(--border);
    transition: background .2s;
}

/* Page header */
.np-page-header {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: .4rem; gap: 1rem; flex-wrap: wrap;
}
.np-page-name {
    font-family: var(--np-font);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}
.np-page-date { font-size: .78rem; color: var(--text-muted); }
.np-divider { border: none; border-top: 3px double var(--border); margin-bottom: .65rem; }
.np-row-divider { border: none; border-top: 1px solid var(--border); margin: .5rem 0; }
.np-article-divider { border: none; border-top: 1px solid var(--border); margin: .4rem 0; opacity: .5; }
.np-article-divider:last-child { display: none; }

/* ── ROW layouts ── */
.np-page { width: 100%; }

.np-row { display: grid; gap: .75rem; margin-bottom: .1rem; }
.np-row--full          { grid-template-columns: 1fr; }
.np-row--halves        { grid-template-columns: 1fr 1fr; }
.np-row--thirds        { grid-template-columns: 1fr 1fr 1fr; }
.np-row--2-1           { grid-template-columns: 2fr 1fr; }
.np-row--1-2           { grid-template-columns: 1fr 2fr; }
.np-row--sidebar-left  { grid-template-columns: 180px 1fr; }
.np-row--sidebar-right { grid-template-columns: 1fr 180px; }

.np-col { padding: 0 .5rem; }
.np-col + .np-col { border-left: 1px solid var(--border); }

/* ── ARTICLE ── */
.np-article { padding: .3rem 0; }

/* Font size control classes on .np-page */
.np-text-sm { --article-font-size: 0.76rem; }
.np-text-md { --article-font-size: 0.83rem; }
.np-text-lg { --article-font-size: 0.96rem; }

/* Headline sizes */
.np-article.hl-xl .np-headline { font-size: 2rem;    line-height: 1.1; }
.np-article.hl-lg .np-headline { font-size: 1.45rem; line-height: 1.15; }
.np-article.hl-md .np-headline { font-size: 1.1rem;  line-height: 1.2; }
.np-article.hl-sm .np-headline { font-size: .9rem;   line-height: 1.25; }

.np-headline {
    font-family: var(--np-font);
    font-weight: 700;
    color: var(--text);
    margin-bottom: .3rem;
}
.np-headline a { color: inherit; text-decoration: none; cursor: pointer; }
.np-headline a:hover { color: var(--primary); text-decoration: underline; }

.np-sub-headline {
    font-family: var(--np-sans);
    font-size: .82rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: .3rem;
    line-height: 1.4;
}

.np-byline {
    font-size: .72rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: .3rem;
}

.np-body-text {
    font-family: var(--np-font);
    font-size: var(--article-font-size);
    line-height: 1.6;
    color: var(--text);
}
.np-body-text p  { margin-bottom: .5rem; }
.np-body-text h2 { font-size: 1rem; font-weight: 700; margin: .5rem 0 .25rem; }
.np-body-text h3 { font-size: .9rem; font-weight: 700; margin: .4rem 0 .2rem; }

/* Image positions */
.article-img { margin: .4rem 0; }
.article-img--left, .article-img--right { float: left; margin: 0 .75rem .4rem 0; max-width: 45%; }
.article-img--right { float: right; margin: 0 0 .4rem .75rem; }
.article-img figcaption { font-size: .68rem; color: var(--text-muted); font-style: italic; margin-top: .2rem; }
.np-body-with-img::after { content: ''; display: table; clear: both; }

/* Continued link */
.np-continued { margin-top: .4rem; }
.np-continued a {
    font-size: .75rem; font-weight: 700; color: var(--primary);
    border-top: 1px solid var(--border); display: inline-block; padding-top: .25rem;
}
.np-continued a:hover { text-decoration: underline; }

/* No paper */
.no-paper { text-align: center; padding: 4rem 2rem; color: var(--text-muted); }
.no-paper-icon { font-size: 3rem; margin-bottom: 1rem; }
.no-paper h2 { font-size: 1.2rem; margin-bottom: .5rem; color: var(--primary); font-family: var(--np-font); }
.no-paper p  { font-size: .9rem; margin-bottom: .3rem; }
.no-paper a  { color: var(--primary); }

/* ══════════════════════════════════════
   ARTICLE MODAL
══════════════════════════════════════ */
.article-modal {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.6); z-index: 800;
    align-items: flex-start; justify-content: center;
    padding: 1.5rem 1rem; overflow-y: auto;
}
.article-modal.active { display: flex; }
.article-modal-box {
    background: var(--modal-bg); border-radius: 4px;
    width: 100%; max-width: 800px;
    box-shadow: 0 8px 40px rgba(0,0,0,.35);
    position: relative;
    transition: background .2s;
}
.article-modal-header {
    padding: .65rem 1.25rem;
    border-bottom: 3px double var(--border);
    background: var(--modal-header-bg);
}
.article-modal-more {
    font-family: var(--np-sans);
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: .35rem;
}
.article-modal-related {
    display: flex; flex-wrap: wrap; gap: .3rem .85rem;
}
.article-modal-related a {
    font-size: .75rem; color: var(--primary); font-weight: 600;
    text-decoration: none;
}
.article-modal-related a:hover { text-decoration: underline; }

.article-modal-close {
    position: absolute; top: .5rem; right: .5rem;
    background: rgba(0,0,0,.08); border: none; font-size: 1.4rem;
    cursor: pointer; color: var(--text-muted); z-index: 5;
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: background .12s;
}
.article-modal-close:hover { background: rgba(0,0,0,.18); color: var(--text); }

#article-modal-body {
    padding: 1.25rem 1.5rem;
    font-family: var(--np-font);
    font-size: var(--article-font-size);
    line-height: 1.7;
    color: var(--text);
}
#article-modal-body .modal-headline {
    font-size: 1.8rem; font-weight: 700; line-height: 1.1;
    margin-bottom: .5rem; font-family: var(--np-font);
    color: var(--text);
}
#article-modal-body .modal-sub-headline {
    font-size: .95rem; color: var(--text-muted); margin-bottom: .5rem; line-height: 1.4;
    font-family: var(--np-sans);
}
#article-modal-body .modal-byline {
    font-size: .75rem; color: var(--text-muted); font-style: italic;
    margin-bottom: .85rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border);
    font-family: var(--np-sans);
}
#article-modal-body figure {
    margin: .75rem 0; float: right; margin-left: 1rem; max-width: 50%;
}
#article-modal-body figure img { width: 100%; }
#article-modal-body figcaption { font-size: .7rem; color: var(--text-muted); font-style: italic; }
#article-modal-body p { margin-bottom: .75rem; }
#article-modal-body::after { content: ''; display: table; clear: both; }

/* ── Share Bar ── */
.modal-share-bar {
    display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
    padding: .65rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--modal-header-bg);
}
.modal-share-label {
    font-size: .68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: var(--text-muted);
}
.share-btn {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .3rem .7rem; border-radius: 3px; border: none;
    font-size: .75rem; font-weight: 700; cursor: pointer;
    text-decoration: none; transition: opacity .12s;
    min-height: 34px;
}
.share-btn:hover { opacity: .85; text-decoration: none; }
.share-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.share-whatsapp { background: #25d366; color: #fff; }
.share-facebook { background: #1877f2; color: #fff; }
.share-x        { background: #000;    color: #fff; }
.share-copy     { background: var(--primary); color: #fff; }
.share-copy.copied { background: #16a34a; }

.article-modal-footer {
    padding: .65rem 1.25rem;
    border-top: 3px double var(--border);
    background: var(--modal-header-bg);
}
.article-modal-more-bottom { font-size: .65rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: .35rem; }

/* ══════════════════════════════════════
   ARCHIVE
══════════════════════════════════════ */
.epaper-archive {
    background: var(--white); border-left: 1px solid var(--border);
    padding: .85rem; position: sticky; top: var(--header-h);
    height: calc(100vh - var(--header-h)); overflow-y: auto;
    transition: background .2s;
}
.has-ticker .epaper-archive { top: calc(var(--header-h) + 32px); height: calc(100vh - var(--header-h) - 32px); }

.archive-title {
    font-size: .8rem; font-weight: 700; color: #fff;
    background: var(--primary); padding: .35rem .6rem;
    margin: -.85rem -.85rem .6rem; text-align: center;
}
.archive-current-date { font-size: .78rem; color: var(--text-muted); margin-bottom: .75rem; }
.cal-nav-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.cal-nav-row button {
    background: none; border: none; cursor: pointer; font-size: 1.1rem; color: var(--primary);
    padding: .15rem .35rem; border-radius: var(--radius); transition: background .12s;
    min-width: 36px; min-height: 36px; display: flex; align-items: center; justify-content: center;
}
.cal-nav-row button:hover { background: rgba(0,0,0,.07); }
.cal-my { font-size: .82rem; font-weight: 700; color: var(--text); }

.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 1px; text-align: center; }
.cal-day-name { font-size: .62rem; font-weight: 700; color: var(--text-muted); padding: .2rem 0; text-transform: uppercase; }
.cal-day { font-size: .74rem; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; margin: 0 auto; border-radius: 50%; color: var(--text-muted); cursor: default; }
.cal-day.has-paper { color: var(--text); font-weight: 700; cursor: pointer; transition: background .12s; }
.cal-day.has-paper:hover { background: rgba(0,0,0,.07); color: var(--primary); }
.cal-day.today    { background: var(--primary); color: #fff; }
.cal-day.selected { background: var(--primary-light); color: #fff; }
.cal-day.other-month { opacity: .2; }
.archive-count { margin-top: .85rem; text-align: center; font-size: .78rem; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: .65rem; }
.archive-count strong { color: var(--primary); }

/* ══════════════════════════════════════
   FOOTER
══════════════════════════════════════ */
.epaper-footer {
    background: var(--primary-dark); color: rgba(255,255,255,.6);
    text-align: center; padding: .65rem 1rem; font-size: .72rem;
}

/* ══════════════════════════════════════
   SPINNER
══════════════════════════════════════ */
.spinner {
    width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--primary);
    border-radius: 50%; animation: spin .7s linear infinite; margin: 1.25rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════
   SIDEBAR OVERLAY
══════════════════════════════════════ */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 150; }
.sidebar-overlay.active { display: block; }

/* ══════════════════════════════════════
   MASONRY LAYOUT
══════════════════════════════════════ */
.np-row--masonry {
    columns: 3;
    column-gap: .65rem;
    margin-bottom: .1rem;
}
.np-row--masonry .np-img-only,
.np-row--masonry .np-article {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    margin-bottom: .65rem;
    display: inline-block;
    width: 100%;
}

/* Image-only article */
.np-img-only { margin: 0 0 .65rem; position: relative; }
.np-img-only img { width: 100%; display: block; border-radius: 2px; }
.np-img-only figcaption {
    font-size: .68rem; color: var(--text-muted); font-style: italic;
    margin-top: .2rem; line-height: 1.3; font-family: var(--np-sans);
}

/* ══════════════════════════════════════
   MOBILE PAGE STRIP
══════════════════════════════════════ */
.page-strip {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--sidebar-bg);
    border-top: 1px solid rgba(255,255,255,.1);
    height: 52px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    z-index: 140;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.page-strip::-webkit-scrollbar { display: none; }
.page-strip-inner { display: inline-flex; align-items: center; height: 100%; padding: 0 .5rem; gap: .25rem; }
.strip-item {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 .75rem; height: 36px; border-radius: 3px;
    font-size: .72rem; color: var(--sidebar-text); white-space: nowrap;
    cursor: pointer; text-decoration: none; flex-shrink: 0;
    border: 1px solid transparent; transition: background .12s;
}
.strip-item:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.strip-item.active { background: var(--sidebar-active); color: #fff; font-weight: 700; border-color: #7ec8e3; }

/* ══════════════════════════════════════
   PAGE INDICATOR TOAST
══════════════════════════════════════ */
.page-indicator {
    position: fixed; bottom: 64px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,.75); color: #fff;
    padding: .35rem .9rem; border-radius: 99px; font-size: .78rem;
    pointer-events: none; z-index: 145;
    opacity: 0; transition: opacity .25s;
}
.page-indicator.show { opacity: 1; }

/* ══════════════════════════════════════
   SEARCH RESULTS PANEL
══════════════════════════════════════ */
.search-panel {
    display: none; position: fixed; top: var(--header-h); left: 0; right: 0;
    background: var(--white); border-bottom: 2px solid var(--primary);
    z-index: 190; max-height: 70vh; overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
    padding: .75rem 1.25rem;
}
.search-panel.open { display: block; }
.search-results-header { font-size: .78rem; color: var(--text-muted); margin-bottom: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.search-result-item {
    padding: .65rem 0; border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-headline { font-family: var(--np-font); font-size: .95rem; font-weight: 700; color: var(--text); margin-bottom: .2rem; }
.search-result-meta { font-size: .72rem; color: var(--text-muted); }
.search-result-snippet { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; line-height: 1.4; }
.search-result-item:hover .search-result-headline { color: var(--primary); }
.search-no-results { text-align: center; padding: 1.5rem; color: var(--text-muted); font-size: .9rem; }

/* ══════════════════════════════════════
   RESPONSIVE — TABLET
══════════════════════════════════════ */
@media (max-width: 1100px) {
    .epaper-layout { grid-template-columns: var(--sidebar-w) 1fr; }
    .epaper-archive { display: none; }
    .font-size-controls { display: none; }
}

/* ══════════════════════════════════════
   RESPONSIVE — MOBILE
══════════════════════════════════════ */
@media (max-width: 768px) {
    :root {
        --sidebar-w: 240px;
        --header-h: 52px;
    }

    .menu-toggle { display: flex; }
    .header-date-str { display: none; }
    .font-size-controls { display: none; }

    .epaper-layout { grid-template-columns: 1fr; }

    .epaper-sidebar {
        position: fixed;
        top: 0; left: -260px; width: 260px;
        height: 100vh; z-index: 160;
        transition: left .22s cubic-bezier(.4,0,.2,1);
        box-shadow: 4px 0 24px rgba(0,0,0,.35);
    }
    .epaper-sidebar.open { left: 0; }

    .epaper-main {
        padding: .65rem .75rem 80px; /* bottom padding for page strip */
    }

    /* All multi-column layouts stack */
    .np-row--halves, .np-row--thirds, .np-row--2-1, .np-row--1-2,
    .np-row--sidebar-left, .np-row--sidebar-right {
        grid-template-columns: 1fr;
    }
    .np-col + .np-col {
        border-left: none;
        border-top: 1px solid var(--border);
        margin-top: .5rem;
        padding-top: .5rem;
    }

    /* Modal */
    #article-modal-body figure { float: none; max-width: 100%; margin-left: 0; }
    .article-modal { padding: .35rem; align-items: flex-end; }
    .article-modal-box {
        max-width: 100%;
        max-height: 92vh;
        overflow-y: auto;
        border-radius: 12px 12px 0 0;
    }
    #article-modal-body .modal-headline { font-size: 1.35rem; }

    /* Page strip visible */
    .page-strip { display: block; }

    /* Masonry */
    .np-row--masonry { columns: 1; }
}

/* ══════════════════════════════════════
   RESPONSIVE — SMALL MOBILE
══════════════════════════════════════ */
@media (max-width: 400px) {
    .brand-tagline { display: none; }
    .header-tool-btn .btn-label { display: none; }
}

/* ══════════════════════════════════════
   MASONRY — TABLET BREAKPOINT
══════════════════════════════════════ */
@media (max-width: 900px) and (min-width: 769px) {
    .np-row--masonry { columns: 2; }
}

/* /assets/css/style.css
 * ePaper Opti Webopz — Frontend Newspaper Stylesheet
 * Version: 5.1.0
 * Changelog:
 *   2026-03-29 v5.1.0 — Phase 4 Polish & Scale.
 *                       Added: modal toolbar (TTS/bookmark/print buttons),
 *                       saved articles panel, Urdu Nastaliq font + RTL styles,
 *                       scan image zoom controls, WebP <picture> wrapper styles,
 *                       bookmark button states, print @media styles.
 *   2026-03-29 v5.0.0 — Phase 1 Foundation (full responsive, dark mode, etc).
 *
 * NOTE: This file contains ONLY the Phase 4 additions.
 * It must be APPENDED to the existing style.css from Phase 1.
 * Do NOT replace style.css with this file — append this content to the end.
 */

/* ══════════════════════════════════════
   URDU / NASTALIQ FONT
══════════════════════════════════════ */
/* Using Noto Nastaliq Urdu as a free fallback.
   For better rendering, replace with Mehr Nastaliq Web or
   Jameel Noori Nastaleeq loaded via your own @font-face. */
@import url('https://fonts.googleapis.com/css2?family=Noto+Nastaliq+Urdu:wght@400;700&display=swap');

:root {
    --urdu-font: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Mehr Nastaliq Web', serif;
}

.urdu-content {
    font-family: var(--urdu-font) !important;
    direction: rtl;
    text-align: right;
    line-height: 2.2 !important; /* Nastaliq needs extra line height */
    font-size: 1.05em !important; /* Nastaliq renders smaller at same size */
    unicode-bidi: plaintext;
}

/* When forced back to Latin (toggle) */
.urdu-content.force-latin {
    font-family: var(--np-font) !important;
    direction: ltr;
    text-align: left;
    line-height: 1.7 !important;
    font-size: 1em !important;
}

/* RTL column layout */
.np-row.rtl-row { direction: rtl; }
.np-row.rtl-row .np-col + .np-col { border-left: none; border-right: 1px solid var(--border); }

/* ══════════════════════════════════════
   MODAL TOOLBAR (TTS / Bookmark / Print)
══════════════════════════════════════ */
#modal-toolbar {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
    padding: .5rem 1.5rem .4rem;
    border-bottom: 1px solid var(--border);
    background: var(--modal-header-bg);
}

.modal-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .7rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--white);
    color: var(--text);
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .12s, border-color .12s;
    min-height: 32px;
    white-space: nowrap;
}
.modal-tool-btn:hover { background: rgba(0,0,0,.05); border-color: var(--primary); }

/* Bookmark active state */
.modal-tool-btn.bookmarked {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}
[data-theme="dark"] .modal-tool-btn.bookmarked {
    background: #3b2d0a;
    border-color: #d97706;
    color: #fcd34d;
}

/* ══════════════════════════════════════
   SAVED ARTICLES PANEL
══════════════════════════════════════ */
#saved-toggle {
    /* Header toolbar button — same as .header-tool-btn */
}

#saved-panel {
    position: fixed;
    top: 0; right: -340px;
    width: 320px;
    height: 100vh;
    background: var(--white);
    border-left: 1px solid var(--border);
    box-shadow: -4px 0 20px rgba(0,0,0,.15);
    z-index: 810;
    transition: right .25s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#saved-panel.open { right: 0; }

.saved-panel-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--primary);
    color: #fff;
    flex-shrink: 0;
}
.saved-panel-header h3 { font-size: .95rem; font-weight: 700; margin: 0; }
.saved-panel-close {
    background: none; border: none; color: #fff;
    font-size: 1.3rem; cursor: pointer; line-height: 1;
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: background .12s;
}
.saved-panel-close:hover { background: rgba(255,255,255,.2); }

.saved-list {
    flex: 1;
    overflow-y: auto;
    padding: .75rem;
}

.saved-item {
    padding: .65rem 0;
    border-bottom: 1px solid var(--border);
}
.saved-item:last-child { border-bottom: none; }

.saved-headline {
    display: block;
    font-family: var(--np-font);
    font-size: .88rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    margin-bottom: .2rem;
    line-height: 1.3;
}
.saved-headline:hover { color: var(--primary); text-decoration: underline; }

.saved-meta {
    font-size: .72rem;
    color: var(--text-muted);
    margin-bottom: .3rem;
}

.saved-remove {
    background: none;
    border: none;
    font-size: .72rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}
.saved-remove:hover { color: #dc2626; }

.saved-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: .85rem;
    padding: 2rem 1rem;
    line-height: 1.5;
}

/* ══════════════════════════════════════
   SCAN IMAGE ZOOM CONTROLS
══════════════════════════════════════ */
.scan-container {
    position: relative;
    overflow: hidden;
    text-align: center;
    touch-action: none; /* allow custom pinch handling */
}

.scan-img {
    max-width: 100%;
    display: block;
    margin: 0 auto;
    transform-origin: top center;
    transition: transform .15s ease-out;
}

.zoom-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .5rem .75rem;
    background: rgba(0,0,0,.05);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.zoom-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--text);
    font-size: .95rem;
    cursor: pointer;
    transition: background .12s;
    font-weight: 700;
}
.zoom-btn:hover { background: #e0eef8; border-color: var(--primary); }

#zoom-label {
    font-size: .78rem;
    color: var(--text-muted);
    min-width: 40px;
    text-align: center;
    font-weight: 600;
}

/* ══════════════════════════════════════
   WEBP PICTURE WRAPPER
══════════════════════════════════════ */
picture { display: block; }
picture img { display: block; max-width: 100%; height: auto; }

/* ══════════════════════════════════════
   PRINT STYLES
══════════════════════════════════════ */
@media print {
    .epaper-header,
    .epaper-sidebar,
    .epaper-archive,
    .page-strip,
    .epaper-footer,
    .article-modal,
    #push-prompt,
    #saved-panel,
    .breaking-ticker { display: none !important; }

    .epaper-main { padding: 0 !important; }
    .np-row { display: block !important; }
    .np-col { border: none !important; padding: 0 !important; }

    .np-article { break-inside: avoid; page-break-inside: avoid; }
    .np-headline a { color: #000 !important; text-decoration: none !important; }
    a[href]::after { content: '' !important; } /* suppress URL printing */
}
