/* =============================================
   ePaper Manager — Public Styles
   News-Site Layout + Inline Viewer + Theme Switcher
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;500;600;700;800&family=Noto+Sans:wght@400;500;600;700;800&display=swap');

/* ---- Themes ---- */
:root,
[data-epm-theme="orange"] {
    --epm-primary:       #FC7E01;
    --epm-primary-dark:  #FC7E01;
    --epm-primary-light: #FFE8CF;
    --epm-primary-text:  #B84F00;   /* darker orange for text on light bg (readable) */
    --epm-on-primary:    #1a1a1a;   /* text colour on orange surfaces (use #fff if you prefer) */
    --epm-accent:        #FC7E01;
    --epm-bg:            #fff8f0;
    --epm-card-bg:       #ffffff;
    --epm-toolbar-bg:    #2b1a0a;
    --epm-toolbar-color: #fff;
    --epm-masthead-bg:   #FC7E01;
    --epm-masthead-color:#1a1a1a;
    --epm-border:        #ecd9c4;
    --epm-text:          #1a1a1a;
    --epm-text-muted:    #5c5148;
    --epm-radius:        10px;
    --epm-shadow:        0 1px 4px rgba(0,0,0,.10);
    --epm-shadow-card:   0 2px 12px rgba(0,0,0,.08);
}
[data-epm-theme="navy"] {
    --epm-primary:       #22245F;
    --epm-primary-dark:  #22245F;
    --epm-primary-light: #E3E4F5;
    --epm-primary-text:  #22245F;
    --epm-accent:        #22245F;
    --epm-bg:            #f4f4fb;
    --epm-toolbar-bg:    #14153d;
    --epm-masthead-bg:   #22245F;
    --epm-border:        #d6d7ea;
    --epm-text-muted:    #55577a;
    --epm-card-bg:       #ffffff;
    --epm-toolbar-color: #fff;
    --epm-masthead-color:#fff;
    --epm-on-primary:    #fff;
    --epm-text:          #1a1a1a;
    --epm-radius:        10px;
    --epm-shadow:        0 1px 4px rgba(0,0,0,.10);
    --epm-shadow-card:   0 2px 12px rgba(0,0,0,.08);
}
[data-epm-theme="red"] {
    --epm-primary:       #f20613;
    --epm-primary-dark:  #f20613;
    --epm-primary-light: #FFE0E2;
    --epm-primary-text:  #c70410;
    --epm-accent:        #f20613;
    --epm-bg:            #fff6f6;
    --epm-toolbar-bg:    #3a0509;
    --epm-masthead-bg:   #f20613;
    --epm-border:        #f0d4d6;
    --epm-text-muted:    #5c4a4b;
    --epm-card-bg:       #ffffff;
    --epm-toolbar-color: #fff;
    --epm-masthead-color:#fff;
    --epm-on-primary:    #fff;
    --epm-text:          #1a1a1a;
    --epm-radius:        10px;
    --epm-shadow:        0 1px 4px rgba(0,0,0,.10);
    --epm-shadow-card:   0 2px 12px rgba(0,0,0,.08);
}

/* =============================================
   BASE
   ============================================= */
.epm-wrap {
    font-family: 'Noto Sans Devanagari', 'Noto Sans', Arial, sans-serif;
    color: var(--epm-text);
    background: var(--epm-bg);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0 40px;
}

/* =============================================
   MASTHEAD
   ============================================= */
.epm-masthead {
    background: var(--epm-masthead-bg);
    color: var(--epm-masthead-color);
    border-bottom: 3px solid rgba(0,0,0,.12);
    margin-bottom: 0;
}
.epm-masthead-inner {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    flex-wrap: wrap;
}
.epm-masthead-brand {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.epm-masthead-icon { font-size: 32px; line-height: 1; }
.epm-masthead-title {
    font-family: 'Noto Sans Devanagari', 'Noto Sans', Arial, sans-serif;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.1;
    margin: 0;
    color: var(--epm-masthead-color);
}
.epm-masthead-tagline {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: .85;
    margin-top: 2px;
}
.epm-masthead-controls {
    display: flex;
    align-items: stretch;
    padding: 0 8px;
}
.epm-masthead-search {
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-left: 1px solid rgba(0,0,0,.12);
}
.epm-masthead-search input {
    background: rgba(255,255,255,.85);
    border: 1px solid rgba(0,0,0,.15);
    color: #1a1a1a;
    padding: 10px 16px;
    border-radius: var(--epm-radius);
    font-size: 15px;
    width: 240px;
    outline: none;
    font-family: 'Noto Sans Devanagari', 'Noto Sans', Arial, sans-serif;
    transition: background .2s;
}
.epm-masthead-search input::placeholder { color: #6b5a48; }
.epm-masthead-search input:focus { background: #fff; box-shadow: 0 0 0 3px rgba(0,0,0,.25); }

/* Theme switcher */
.epm-theme-switcher {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 14px;
    border-left: 1px solid rgba(0,0,0,.12);
}
.epm-theme-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: .85;
    white-space: nowrap;
    color: var(--epm-masthead-color);
}
.epm-theme-dots { display: flex; gap: 5px; }
.epm-theme-dot {
    width: 24px; height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(0,0,0,.25);
    transition: transform .15s, border-color .15s;
}
.epm-theme-dot[data-theme="orange"] { background: #FC7E01; }
.epm-theme-dot[data-theme="navy"]   { background: #22245F; }
.epm-theme-dot[data-theme="red"]    { background: #f20613; }
.epm-theme-dot:hover { transform: scale(1.2); border-color: #1a1a1a; }
.epm-theme-dot.active { border-color: #fff; box-shadow: 0 0 0 2px #1a1a1a; transform: scale(1.1); }

/* =============================================
   FILTER BAR below masthead
   ============================================= */
.epm-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: var(--epm-card-bg);
    border-bottom: 1px solid var(--epm-border);
    flex-wrap: wrap;
    gap: 8px;
}
.epm-filter-box { display: flex; gap: 8px; }
.epm-filter-box select {
    padding: 9px 12px;
    border: 1px solid var(--epm-border);
    border-radius: var(--epm-radius);
    font-size: 14px;
    font-family: 'Noto Sans Devanagari', 'Noto Sans', Arial, sans-serif;
    cursor: pointer;
    background: var(--epm-bg);
    color: var(--epm-text);
    font-weight: 500;
}
.epm-filter-date { font-size: 14px; color: var(--epm-text-muted); font-weight: 500; }

/* =============================================
   SECTION HEADER
   ============================================= */
.epm-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 12px;
    border-bottom: 2px solid var(--epm-primary);
    margin-bottom: 0;
}
.epm-section-title {
    font-family: 'Noto Sans Devanagari', 'Noto Sans', Arial, sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--epm-text);
    margin: 0;
    letter-spacing: 0;
}
.epm-section-title span { color: var(--epm-primary-text); }

/* =============================================
   NEWS LAYOUT
   ============================================= */
.epm-news-body {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 0;
}
.epm-news-main {
    border-right: 1px solid var(--epm-border);
    padding: 20px 24px 20px 20px;
}
.epm-news-sidebar {
    padding: 20px 16px 20px 20px;
}

/* Featured card */
.epm-featured-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--epm-card-bg);
    border: 1px solid var(--epm-border);
    border-radius: var(--epm-radius);
    overflow: hidden;
    box-shadow: var(--epm-shadow-card);
    cursor: pointer;
    transition: box-shadow .2s;
    margin-bottom: 20px;
}
.epm-featured-card:hover { box-shadow: 0 6px 28px rgba(0,0,0,.14); }
.epm-featured-thumb {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}
.epm-featured-thumb-placeholder {
    height: 250px;
    background: linear-gradient(135deg, var(--epm-primary-light), var(--epm-bg));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 72px;
}
.epm-featured-info {
    padding: 22px 22px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.epm-featured-label {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--epm-primary-text);
    background: var(--epm-primary-light);
    padding: 4px 10px;
    border-radius: var(--epm-radius);
    margin-bottom: 10px;
    width: fit-content;
}
.epm-featured-title {
    font-family: 'Noto Sans Devanagari', 'Noto Sans', Arial, sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--epm-text);
    margin: 0 0 10px;
}
.epm-featured-meta {
    font-size: 14px;
    color: var(--epm-text-muted);
    margin-bottom: 16px;
}
.epm-featured-meta strong { color: var(--epm-primary-text); font-weight: 600; }
.epm-featured-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--epm-primary);
    color: var(--epm-on-primary);
    border: none;
    padding: 12px 22px;
    border-radius: var(--epm-radius);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Noto Sans Devanagari', 'Noto Sans', Arial, sans-serif;
    transition: background .2s;
    width: fit-content;
}
.epm-featured-btn:hover { background: var(--epm-primary-dark); }

/* Secondary row */
.epm-secondary-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

/* =============================================
   CARD
   ============================================= */
.epm-card {
    background: var(--epm-card-bg);
    border: 1px solid var(--epm-border);
    border-radius: var(--epm-radius);
    box-shadow: var(--epm-shadow-card);
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow .2s, transform .15s;
    display: flex;
    flex-direction: column;
}
.epm-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.13); transform: translateY(-2px); }
.epm-card-thumb {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
}
.epm-card-thumb-placeholder {
    width: 100%;
    aspect-ratio: 3/4;
    background: linear-gradient(135deg, var(--epm-primary-light), var(--epm-bg));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--epm-text-muted);
}
.epm-card-body { padding: 12px 14px 14px; flex: 1; display: flex; flex-direction: column; }
.epm-card-title {
    font-family: 'Noto Sans Devanagari', 'Noto Sans', Arial, sans-serif;
    font-weight: 600;
    font-size: 15px;
    margin: 0 0 6px;
    line-height: 1.5;
    color: var(--epm-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.epm-card-date { font-size: 13px; color: var(--epm-primary-text); font-weight: 600; }
.epm-card-author { font-size: 13px; color: var(--epm-text-muted); margin-top: 2px; }
.epm-card-read-btn {
    display: block;
    margin-top: auto;
    padding: 10px;
    background: var(--epm-primary);
    color: var(--epm-on-primary);
    text-align: center;
    border-radius: var(--epm-radius);
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    width: 100%;
    font-family: 'Noto Sans Devanagari', 'Noto Sans', Arial, sans-serif;
    transition: background .2s;
    margin-top: 10px;
}
.epm-card-read-btn:hover { background: var(--epm-primary-dark); }

/* Grid */
.epm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

/* =============================================
   LOADING
   ============================================= */
.epm-loading {
    grid-column: 1/-1;
    text-align: center;
    padding: 40px;
    color: var(--epm-text-muted);
    font-size: 14px;
}
.epm-spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid var(--epm-border);
    border-top-color: var(--epm-primary);
    border-radius: 50%;
    animation: epm-spin .7s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}
@keyframes epm-spin { to { transform: rotate(360deg); } }

/* =============================================
   PAGINATION
   ============================================= */
.epm-pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 4px 0 4px;
}
.epm-pagination button {
    padding: 8px 14px;
    min-width: 40px;
    border: 1px solid var(--epm-border);
    border-radius: var(--epm-radius);
    background: var(--epm-card-bg);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--epm-text);
    font-family: 'Noto Sans Devanagari', 'Noto Sans', Arial, sans-serif;
    transition: all .15s;
}
.epm-pagination button:hover { background: var(--epm-primary); color: var(--epm-on-primary); border-color: var(--epm-primary); }
.epm-pagination button.active { background: var(--epm-primary); color: var(--epm-on-primary); border-color: var(--epm-primary); }
.epm-pagination button:disabled { opacity: .35; cursor: default; }

/* =============================================
   SIDEBAR
   ============================================= */
.epm-sidebar-heading {
    font-family: 'Noto Sans Devanagari', 'Noto Sans', Arial, sans-serif;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--epm-text);
    border-bottom: 2px solid var(--epm-primary);
    padding-bottom: 7px;
    margin: 0 0 12px;
}
.epm-sidebar-block { margin-bottom: 24px; }

/* Calendar sidebar */
.epm-calendar-section {
    background: var(--epm-card-bg);
    border: 1px solid var(--epm-border);
    border-radius: var(--epm-radius);
    padding: 12px;
}
.epm-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.epm-cal-title { font-weight: 700; font-size: 15px; color: var(--epm-text); }
.epm-cal-prev, .epm-cal-next {
    background: none; border: none;
    font-size: 22px; cursor: pointer;
    color: var(--epm-primary-text);
    padding: 0 4px;
}
.epm-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    text-align: center;
}
.epm-cal-day-label { font-size: 12px; font-weight: 700; color: var(--epm-text-muted); padding: 3px 0; }
.epm-cal-day { font-size: 14px; padding: 7px 2px; border-radius: 50%; cursor: default; color: var(--epm-text); }
.epm-cal-day.has-paper { background: var(--epm-primary); color: var(--epm-on-primary); cursor: pointer; font-weight: 700; }
.epm-cal-day.has-paper:hover { background: var(--epm-primary-dark); }
.epm-cal-day.today { outline: 2px solid var(--epm-primary); outline-offset: -1px; }
.epm-cal-day.empty { color: transparent; pointer-events: none; }

/* Sidebar list */
.epm-sidebar-list { list-style: none; padding: 0; margin: 0; }
.epm-sidebar-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--epm-border);
    display: flex;
    gap: 10px;
    align-items: flex-start;
    cursor: pointer;
}
.epm-sidebar-list li:last-child { border-bottom: none; }
.epm-sidebar-list-thumb {
    width: 60px; height: 78px;
    object-fit: cover;
    border-radius: var(--epm-radius);
    flex-shrink: 0;
    background: var(--epm-primary-light);
}
.epm-sidebar-list-thumb-placeholder {
    width: 60px; height: 78px;
    background: var(--epm-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border-radius: var(--epm-radius);
    flex-shrink: 0;
}
.epm-sidebar-list-title {
    font-family: 'Noto Sans Devanagari', 'Noto Sans', Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--epm-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 3px;
}
.epm-sidebar-list-date { font-size: 13px; color: var(--epm-primary-text); font-weight: 600; }

/* =============================================
   INLINE VIEWER (same-page, not fullscreen)
   ============================================= */
.epm-inline-viewer-wrap {
    display: none;
    background: var(--epm-toolbar-bg);
    border-radius: var(--epm-radius);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 4px 24px rgba(0,0,0,.3);
}
.epm-inline-viewer-wrap.active { display: flex; flex-direction: column; }

/* Viewer toolbar */
.epm-viewer-toolbar {
    background: var(--epm-toolbar-bg);
    color: #fff;
    padding: 9px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
}
.epm-viewer-info { display: flex; flex-direction: column; min-width: 140px; }
.epm-viewer-title {
    font-family: 'Noto Sans Devanagari', 'Noto Sans', Arial, sans-serif;
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}
.epm-viewer-meta { font-size: 13px; color: rgba(255,255,255,.75); }
.epm-viewer-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.epm-ctrl-group { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.epm-ctrl-group label {
    font-size: 11px; font-weight: 700; letter-spacing: 1px;
    color: rgba(255,255,255,.75); text-transform: uppercase;
}
.epm-ctrl-group > div, .epm-ctrl-group > span { display: flex; align-items: center; gap: 4px; }

.epm-btn {
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.28);
    color: #fff;
    padding: 8px 13px;
    min-height: 38px;
    border-radius: var(--epm-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    transition: background .15s;
    font-family: 'Noto Sans Devanagari', 'Noto Sans', Arial, sans-serif;
}
.epm-btn:hover { background: var(--epm-primary); border-color: var(--epm-primary); color: var(--epm-on-primary); }
.epm-btn-clip { background: color-mix(in srgb, var(--epm-primary) 25%, transparent); border-color: color-mix(in srgb, var(--epm-primary) 50%, transparent); }
.epm-btn-clip.clipping { background: var(--epm-primary); color: var(--epm-on-primary); }
.epm-btn-screenshot { background: rgba(41,182,246,.18); border-color: rgba(41,182,246,.3); }

.epm-page-display { display: flex; align-items: center; gap: 4px; }
.epm-page-display input {
    width: 52px; padding: 8px 6px; text-align: center;
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.08);
    color: #fff; border-radius: var(--epm-radius);
    font-size: 14px; font-family: 'Noto Sans Devanagari', 'Noto Sans', Arial, sans-serif;
}
.epm-page-display span { font-size: 14px; color: rgba(255,255,255,.8); }

.epm-viewer-close {
    background: var(--epm-primary); border: none; color: var(--epm-on-primary);
    font-size: 18px; font-weight: 700; width: 38px; height: 38px;
    border-radius: var(--epm-radius); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s; flex-shrink: 0;
}
.epm-viewer-close:hover { background: var(--epm-primary); }

/* Viewer body */
.epm-viewer-body {
    display: flex;
    height: 680px;
    overflow: hidden;
    position: relative;
}

/* Thumb strip */
.epm-thumb-strip {
    width: 120px; flex-shrink: 0;
    background: rgba(0,0,0,.35);
    overflow-y: auto;
    border-right: 1px solid rgba(255,255,255,.05);
}
.epm-thumb-strip-inner { padding: 6px; }
.epm-strip-page {
    margin-bottom: 6px; cursor: pointer;
    border-radius: var(--epm-radius); overflow: hidden;
    border: 2px solid transparent;
    transition: border-color .15s; position: relative;
}
.epm-strip-page:hover { border-color: rgba(255,255,255,.25); }
.epm-strip-page.active { border-color: var(--epm-primary); }
.epm-strip-page canvas { width: 100% !important; height: auto !important; display: block; }
.epm-strip-label {
    text-align: center; font-size: 12px; color: rgba(255,255,255,.75);
    padding: 3px 0 4px; background: rgba(0,0,0,.3);
}

/* Canvas area */
.epm-canvas-wrap {
    flex: 1; overflow: auto;
    display: flex; justify-content: center; align-items: flex-start;
    background: #1e1e2e; padding: 20px; position: relative;
}
.epm-canvas-container { position: relative; box-shadow: 0 4px 32px rgba(0,0,0,.5); line-height: 0; }
#epm-main-canvas { display: block; max-width: 100%; }

/* Clip overlay */
.epm-clip-overlay { position: absolute; inset: 0; cursor: crosshair; z-index: 20; }
.epm-clip-selection {
    position: absolute;
    border: 2px dashed var(--epm-primary);
    background: color-mix(in srgb, var(--epm-primary) 12%, transparent);
    pointer-events: none;
}
.epm-clip-hint {
    position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,.7); color: #fff;
    padding: 8px 16px; border-radius: var(--epm-radius); font-size: 14px;
    white-space: nowrap; pointer-events: none;
}

/* Footer nav */
.epm-viewer-footer {
    background: rgba(0,0,0,.3);
    border-top: 1px solid rgba(255,255,255,.05);
    padding: 8px 14px;
    display: flex; align-items: center; justify-content: center;
    gap: 8px; flex-shrink: 0;
}
.epm-btn-lg {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.14);
    color: #fff; padding: 10px 16px; min-height: 40px; border-radius: var(--epm-radius);
    cursor: pointer; font-size: 14px; font-weight: 600;
    font-family: 'Noto Sans Devanagari', 'Noto Sans', Arial, sans-serif; transition: background .15s;
}
.epm-btn-lg:hover { background: var(--epm-primary); border-color: var(--epm-primary); color: var(--epm-on-primary); }
#vwr-foot-label { color: rgba(255,255,255,.85); font-size: 14px; min-width: 90px; text-align: center; }

/* =============================================
   PAGE POPUP
   ============================================= */
.epm-page-popup-overlay {
    display: none; position: fixed; inset: 0;
    z-index: 1000001; background: rgba(0,0,0,.7);
    align-items: center; justify-content: center;
}
.epm-page-popup-overlay.active { display: flex; }
.epm-page-popup {
    background: var(--epm-toolbar-bg); border-radius: var(--epm-radius); overflow: hidden;
    max-width: 90vw; max-height: 90vh;
    display: flex; flex-direction: column;
    box-shadow: 0 10px 60px rgba(0,0,0,.6);
}
.epm-page-popup-header {
    background: var(--epm-toolbar-bg); padding: 10px 16px;
    display: flex; align-items: center; justify-content: space-between;
    color: #fff; font-weight: 700; gap: 12px;
}
.epm-popup-actions { display: flex; gap: 8px; align-items: center; }
.epm-popup-btn {
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
    color: #fff; padding: 9px 14px; border-radius: var(--epm-radius);
    cursor: pointer; font-size: 14px; font-weight: 600;
    text-decoration: none; display: inline-flex; align-items: center; gap: 4px;
    transition: background .15s; font-family: 'Noto Sans Devanagari', 'Noto Sans', Arial, sans-serif;
}
.epm-popup-btn:hover { background: var(--epm-primary); border-color: var(--epm-primary); color: var(--epm-on-primary); }
.epm-popup-close {
    background: var(--epm-primary); border: none; color: var(--epm-on-primary);
    font-size: 16px; font-weight: 700; width: 36px; height: 36px; border-radius: var(--epm-radius);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.epm-popup-close:hover { background: var(--epm-primary); }
.epm-page-popup-body { overflow: auto; padding: 16px; position: relative; flex: 1; }
#epm-popup-canvas { display: block; max-width: 100%; }
.epm-popup-crop-overlay {
    position: absolute; top: 16px; left: 16px; right: 16px; bottom: 16px;
    cursor: crosshair; z-index: 5;
}
.epm-popup-crop-sel {
    position: absolute; border: 2px dashed var(--epm-primary);
    background: color-mix(in srgb, var(--epm-primary) 12%, transparent); pointer-events: none;
}

/* =============================================
   CLIP RESULT MODAL
   ============================================= */
.epm-clip-result-overlay {
    display: none; position: fixed; inset: 0;
    z-index: 1000002; background: rgba(0,0,0,.75);
    align-items: center; justify-content: center;
}
.epm-clip-result-overlay.active { display: flex; }
.epm-clip-result {
    background: #fff; border-radius: var(--epm-radius); overflow: hidden;
    max-width: 80vw; max-height: 85vh;
    display: flex; flex-direction: column;
    box-shadow: 0 10px 50px rgba(0,0,0,.5);
}
.epm-clip-result-header {
    background: var(--epm-toolbar-bg); color: #fff; padding: 12px 16px;
    display: flex; align-items: center; justify-content: space-between;
    font-weight: 700; font-family: 'Noto Sans Devanagari', 'Noto Sans', Arial, sans-serif;
}
.epm-clip-result-header button {
    background: var(--epm-primary); border: none; color: var(--epm-on-primary);
    width: 36px; height: 36px; border-radius: var(--epm-radius); cursor: pointer; font-size: 16px; font-weight: 700;
}
#epm-clip-result-img { max-width: 100%; object-fit: contain; }
.epm-clip-result-actions {
    padding: 12px 16px; background: #f4f4f4;
    display: flex; justify-content: flex-end;
}

/* =============================================
   LATEST WIDGET
   ============================================= */
.epm-latest-wrap { display: flex; flex-wrap: wrap; gap: 14px; }
.epm-latest-card {
    display: flex; gap: 12px;
    background: var(--epm-card-bg); border: 1px solid var(--epm-border);
    border-radius: var(--epm-radius); padding: 12px;
    box-shadow: var(--epm-shadow-card); align-items: flex-start;
    max-width: 400px; cursor: pointer;
}
.epm-latest-card img { width: 80px; border-radius: var(--epm-radius); border: 1px solid var(--epm-border); }
.epm-latest-info { display: flex; flex-direction: column; gap: 4px; }
.epm-latest-info strong { font-family: 'Noto Sans Devanagari', 'Noto Sans', Arial, sans-serif; font-size: 16px; color: var(--epm-text); }
.epm-latest-info span { font-size: 13px; color: var(--epm-text-muted); }
.epm-btn-read {
    display: inline-block; margin-top: 8px; padding: 10px 18px;
    background: var(--epm-primary); color: var(--epm-on-primary); border-radius: var(--epm-radius);
    font-size: 14px; font-weight: 700; border: none; cursor: pointer;
    font-family: 'Noto Sans Devanagari', 'Noto Sans', Arial, sans-serif;
}
.epm-btn-read:hover { background: var(--epm-primary-dark); }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
    .epm-news-body { grid-template-columns: 1fr; }
    .epm-news-main { border-right: none; padding-right: 20px; border-bottom: 1px solid var(--epm-border); padding-bottom: 20px; margin-bottom: 20px; }
    .epm-news-sidebar { padding-left: 20px; }
    .epm-featured-card { grid-template-columns: 1fr; }
    .epm-featured-thumb, .epm-featured-thumb-placeholder { height: 180px; }
    .epm-secondary-row { grid-template-columns: repeat(2, 1fr); }
    .epm-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .epm-masthead-controls { width: 100%; border-top: 1px solid rgba(255,255,255,.1); }
    .epm-masthead-search input { width: 150px; }
    .epm-secondary-row { grid-template-columns: 1fr; }
    .epm-grid { grid-template-columns: repeat(2, 1fr); }
    .epm-viewer-body { height: 480px; }
    .epm-thumb-strip { width: 80px; }
    .epm-ctrl-group label { display: none; }
    .epm-viewer-title { max-width: 140px; }
}


/* =============================================
   USABILITY EXTRAS
   ============================================= */
.epm-wrap, .epm-wrap *, .epm-page-popup-overlay *, .epm-clip-result-overlay * {
    font-family: 'Noto Sans Devanagari', 'Noto Sans', Arial, sans-serif;
}
.epm-wrap { font-size: 16px; line-height: 1.6; border-radius: var(--epm-radius); overflow: hidden; }
.epm-masthead { border-radius: var(--epm-radius) var(--epm-radius) 0 0; }

/* Zoom dropdown in dark toolbar */
.epm-viewer-toolbar select {
    background: rgba(255,255,255,.14);
    color: #fff;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: var(--epm-radius);
    padding: 8px 10px;
    min-height: 38px;
    font-size: 14px;
    cursor: pointer;
}
.epm-viewer-toolbar select option { color: #1a1a1a; background: #fff; }

/* Clear keyboard focus ring */
.epm-wrap button:focus-visible,
.epm-wrap a:focus-visible,
.epm-wrap select:focus-visible,
.epm-wrap input:focus-visible,
.epm-card:focus-visible,
.epm-sidebar-list li:focus-visible {
    outline: 3px solid var(--epm-primary);
    outline-offset: 2px;
}

/* Smooth feel + slight highlight on sidebar rows */
.epm-sidebar-list li { padding: 12px 8px; border-radius: var(--epm-radius); transition: background .15s; }
.epm-sidebar-list li:hover { background: var(--epm-primary-light); }
.epm-cal-day.has-paper:hover { transform: scale(1.08); }
.epm-card-thumb, .epm-featured-thumb { border-radius: 0; }
.epm-calendar-section { padding: 14px; }
.epm-btn-screenshot { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.28); }

/* Mobile: bigger touch targets */
@media (max-width: 600px) {
    .epm-masthead-title { font-size: 22px; }
    .epm-masthead-search input { width: 100%; }
    .epm-masthead-search { flex: 1; padding: 8px 10px; }
    .epm-featured-title { font-size: 20px; }
    .epm-btn, .epm-btn-lg { min-height: 44px; }
}

/* Hover effect keeps exact #FC7E01 (no colour change), uses brightness + shadow */
.epm-featured-btn:hover, .epm-card-read-btn:hover, .epm-btn-read:hover,
.epm-btn:hover, .epm-btn-lg:hover, .epm-popup-btn:hover,
.epm-pagination button:hover, .epm-viewer-close:hover, .epm-popup-close:hover {
    filter: brightness(1.06);
    box-shadow: 0 3px 10px color-mix(in srgb, var(--epm-primary) 45%, transparent);
}
/* Masthead title in capitals */
.epm-masthead-title { text-transform: uppercase; letter-spacing: 1px; }

/* Navy & Red themes: white text on masthead */
[data-epm-theme="navy"] .epm-masthead, [data-epm-theme="red"] .epm-masthead { border-bottom-color: rgba(255,255,255,.2); }
[data-epm-theme="navy"] .epm-masthead-search, [data-epm-theme="navy"] .epm-theme-switcher,
[data-epm-theme="red"]  .epm-masthead-search, [data-epm-theme="red"]  .epm-theme-switcher { border-left-color: rgba(255,255,255,.25); }
[data-epm-theme="navy"] .epm-theme-dot, [data-epm-theme="red"] .epm-theme-dot { border-color: rgba(255,255,255,.5); }
[data-epm-theme="navy"] .epm-theme-dot:hover, [data-epm-theme="red"] .epm-theme-dot:hover { border-color: #fff; }
[data-epm-theme="navy"] .epm-theme-dot.active, [data-epm-theme="red"] .epm-theme-dot.active { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
[data-epm-theme="navy"] .epm-masthead-search input:focus, [data-epm-theme="red"] .epm-masthead-search input:focus { box-shadow: 0 0 0 3px rgba(255,255,255,.5); }
/* Dots must stay visible on any masthead: give the orange dot a light edge on navy/red */

/* RNI number (shown exactly as written, no capital transform) */
.epm-masthead-rni {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: none;
    margin-top: 4px;
    color: var(--epm-masthead-color);
}
