
:root{--card:#fff;--bg:#f6f7fb;--text:#0f172a;--muted:#64748b;--brand:#0ea5e9;;--readerH:calc(100vh - 180px);--bottomBarH:72px}
*{box-sizing:border-box}
body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial;background:var(--bg);color:var(--text)}
a{color:var(--brand);text-decoration:none}
.container{max-width:1400px;margin:0 auto;padding:16px}
.hidden{display:none !important}
.pageSelect{display:none}

/* --- Site header (compact, professional) --- */
.site-header{
  background:linear-gradient(180deg, rgba(255,255,255,1), rgba(255,255,255,.94));
  border:1px solid rgba(2,8,23,.08);
  border-radius:14px;
  box-shadow:0 12px 34px rgba(2,8,23,.07);
  padding:10px 12px;
  margin-bottom:10px;
  position:sticky;
  top:10px;
  z-index:1200;
  backdrop-filter: blur(10px);
}
.mastrow{display:flex;gap:12px;align-items:center;justify-content:space-between}
.mastbrand{display:flex;align-items:center;gap:10px;min-width:0}
.mastlogo{height:46px;width:auto;display:block}
.masttitle{font-weight:1000;font-size:22px;letter-spacing:.4px;color:rgba(2,8,23,.92)}
.mastsocial{
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:nowrap;
  overflow-x:auto;
  scrollbar-width:none;
}
.mastsocial::-webkit-scrollbar{display:none}
.soc{
  width:30px;height:30px;border-radius:999px;
  display:inline-flex;align-items:center;justify-content:center;
  color:#fff;font-size:14px;
  box-shadow:0 10px 20px rgba(2,8,23,.12);
  flex:0 0 auto;
}
.soc:hover{transform:translateY(-1px)}
.soc.fb{background:#1877f2}
.soc.web{background:#111827}
.soc.tk{background:#111827}
.soc.wa{background:#25D366}
.soc.pt{background:#e60023}
.soc.yt{background:#ff0000}
.soc.in{background:#0a66c2}
.soc.ig{background:#d62976}

.mastline{height:1px;background:rgba(2,8,23,.10);margin:8px 0}
.mastmini{display:flex;gap:10px;align-items:center;justify-content:flex-end;margin-top:6px}
.mini-link{font-size:12px;color:rgba(2,8,23,.78);padding:7px 10px;border-radius:12px;border:1px solid rgba(2,8,23,.12);background:#fff;font-weight:900;box-shadow:0 10px 20px rgba(2,8,23,.05)}
.mini-link:hover{background:#fff}


/* Controls row under header */
.issue-controls{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.ctrl-left,.ctrl-mid,.ctrl-right{display:flex;gap:10px;align-items:center}
.ctrl-field{position:relative;display:flex;align-items:center}
.ctrl-field input,.ctrl-field select{appearance:none;border:1px solid rgba(2,8,23,.14);background:#fff;border-radius:12px;padding:10px 36px 10px 12px;font-size:14px;font-weight:900;box-shadow:0 10px 20px rgba(2,8,23,.05)}
.ctrl-field i{position:absolute;right:12px;color:rgba(2,8,23,.55);pointer-events:none}

.ctrl-mid{flex:1;justify-content:center;min-width:260px}
.pnav{width:38px;height:38px;border-radius:12px;border:1px solid rgba(2,8,23,.14);display:inline-flex;align-items:center;justify-content:center;background:#fff;color:var(--text);box-shadow:0 10px 20px rgba(2,8,23,.05);transition:.12s}
.pnav.disabled{opacity:.45;pointer-events:none}
.pstrip{display:flex;gap:8px;align-items:center;overflow:auto;max-width:620px;padding:2px 6px}
.pnum{width:38px;height:38px;border-radius:12px;border:1px solid rgba(2,8,23,.14);display:inline-flex;align-items:center;justify-content:center;background:#fff;color:var(--text);font-weight:1000;box-shadow:0 10px 20px rgba(2,8,23,.05);transition:.12s}
.pnum.active{outline:2px solid rgba(16,185,129,.85);border-color:transparent}

.zbtn{height:38px;min-width:44px;border-radius:12px;border:1px solid rgba(2,8,23,.14);background:#fff;cursor:pointer;font-weight:1000;box-shadow:0 10px 20px rgba(2,8,23,.05);transition:.12s}
.allpages{height:38px;display:inline-flex;align-items:center;justify-content:center;padding:0 14px;border-radius:12px;border:1px solid rgba(16,185,129,.85);color:#065f46;background:#fff;font-weight:1000;box-shadow:0 10px 20px rgba(2,8,23,.05);transition:.12s}
.allpages:hover{background:rgba(16,185,129,.06);transform:translateY(-1px)}
.pnav:hover,.pnum:hover,.zbtn:hover{transform:translateY(-1px)}
.ctrl-field input:focus,.ctrl-field select:focus{outline:none;box-shadow:0 0 0 3px rgba(14,165,233,.18), 0 10px 20px rgba(2,8,23,.05);border-color:rgba(14,165,233,.55)}
.card{background:var(--card);border-radius:14px;box-shadow:0 10px 30px rgba(2,8,23,.06);padding:14px}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}
.thumb{display:block;border-radius:12px;overflow:hidden;border:1px solid rgba(2,8,23,.08)}
.thumb img{width:100%;display:block}
.small{color:var(--muted);font-size:12px}
.btn{display:inline-flex;align-items:center;gap:8px;border:1px solid rgba(2,8,23,.15);padding:10px 12px;border-radius:12px;background:#fff;cursor:pointer}
.btn.primary{background:var(--brand);color:#fff;border-color:transparent}
.viewer-wrap{position:relative;background:#111827;border-radius:16px;overflow:hidden}
.viewer-wrap.viewer-white{background:#ffffff;overflow:hidden;border:1px solid rgba(2,8,23,.10)}
/* When used outside the main stage, keep a reasonable height */
.viewer-wrap[data-epaper-viewer]{min-height:75vh}
/* New viewer layers: pan + scale (fit-to-viewport, no scroll) */
.viewer-pan{position:absolute;left:0;top:0;will-change:transform}
.viewer-scale{position:relative;left:0;top:0;will-change:transform;transform-origin:top left}
.viewer-scale img{width:100%;height:100%;display:block}
.box{position:absolute;border:2px solid rgba(14,165,233,.95);background:rgba(14,165,233,.18);border-radius:10px;cursor:pointer;transition:.12s}
.box:hover{background:rgba(14,165,233,.28)}
.box.active{background:rgba(14,165,233,.35)}

/* Front view: keep hotspots clickable but visually clean (no permanent marking) */
body:not(.admin-body) .box{border:0;background:transparent;box-shadow:none}
body:not(.admin-body) .box:hover{border:1px solid rgba(14,165,233,.35);background:rgba(14,165,233,.08)}
body:not(.admin-body) .box.active{border:1px solid rgba(14,165,233,.45);background:rgba(14,165,233,.10)}
.reader{max-width:920px;margin:0 auto}
.reader img{width:100%;border-radius:14px;border:1px solid rgba(2,8,23,.10);box-shadow:0 12px 24px rgba(2,8,23,.08);margin:10px 0;background:#fff}
.pill{display:inline-flex;gap:8px;align-items:center;padding:8px 10px;border-radius:999px;background:rgba(14,165,233,.10);color:#0369a1;font-weight:600;font-size:12px}
hr.sep{border:none;border-top:1px solid rgba(2,8,23,.10);margin:12px 0}

/* --- 3 column epaper reader (like a pro ePaper UI) --- */
.epaper-shell{display:grid;grid-template-columns:190px 1fr 420px;gap:12px;align-items:stretch}
.epaper-left,.epaper-right{background:var(--card);border-radius:14px;box-shadow:0 10px 30px rgba(2,8,23,.06);overflow:hidden}
.epaper-mid{min-width:0}

.epaper-sidehead{padding:12px 12px 10px;border-bottom:1px solid rgba(2,8,23,.08);background:linear-gradient(180deg, rgba(2,8,23,.02), rgba(2,8,23,0))}
/* Make side panels taller (more viewer height) */
.epaper-left{height:var(--readerH);display:flex;flex-direction:column}
.epaper-right{height:var(--readerH);display:flex;flex-direction:column}
.epaper-thumbs{padding:10px;flex:1;overflow:auto;max-height:none}
.epaper-thumb{display:block;border:1px solid rgba(2,8,23,.10);border-radius:12px;overflow:hidden;background:#fff;margin-bottom:10px;position:relative}
.epaper-thumb.active{outline:2px solid rgba(14,165,233,.85);border-color:transparent}
.epaper-thumb img{width:100%;display:block}
.epaper-thumb .badge{position:absolute;left:8px;top:8px;background:rgba(255,255,255,.92);border:1px solid rgba(2,8,23,.12);backdrop-filter:blur(6px);padding:6px 8px;border-radius:999px;font-size:12px;font-weight:800}

.epaper-toolbar{background:var(--card);border-radius:14px;box-shadow:0 10px 30px rgba(2,8,23,.06);padding:12px;display:flex;gap:12px;align-items:center;justify-content:space-between}
.epaper-meta{min-width:220px}
.epaper-title{font-weight:900;font-size:16px;line-height:1.1}
.epaper-controls{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.sepv{display:inline-block;width:1px;height:30px;background:rgba(2,8,23,.12);margin:0 4px}

.epaper-stage{position:relative;cursor:grab;background:var(--card);border-radius:14px;box-shadow:0 10px 30px rgba(2,8,23,.06);padding:10px;margin-top:10px;overflow:hidden;height:var(--readerH);display:flex}
.epaper-stage .viewer-wrap{border-radius:12px;flex:1;height:100%}
.epaper-hint{margin-top:8px;padding:0 4px}

.article-panel{padding:10px;flex:1;overflow:auto;max-height:none}
.article-panel.loading{opacity:.6}
.article-empty{padding:18px;border:1px dashed rgba(2,8,23,.18);border-radius:14px;background:rgba(2,8,23,.02)}

/* --- Article viewer (styled like a printed clipping card) --- */
.article-sheet{background:#fff;border-radius:18px;overflow:hidden;border:2px solid rgba(16,185,129,.85);box-shadow:0 16px 34px rgba(2,8,23,.10)}
.article-sheet-top{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border-bottom:1px solid rgba(2,8,23,.10);background:linear-gradient(180deg, rgba(16,185,129,.06), rgba(16,185,129,0))}
.article-sheet-brand{display:flex;align-items:center;gap:10px;min-width:150px}
.article-sheet-logo{height:26px;width:auto;display:block}
.article-sheet-logotext{font-weight:1000;letter-spacing:.2px}
.article-sheet-actions{display:flex;align-items:center;gap:8px}
.iconbtn{width:34px;height:34px;border-radius:999px;border:1px solid rgba(2,8,23,.14);background:#fff;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;color:rgba(2,8,23,.85)}
.iconbtn:hover{transform:translateY(-1px)}

.article-sheet-title{padding:10px 12px 0;font-weight:1000;font-size:20px;line-height:1.15}
.article-sheet-sub{padding:8px 12px 10px;display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.tag{display:inline-flex;gap:8px;align-items:center;padding:6px 10px;border-radius:999px;background:rgba(2,8,23,.04);border:1px solid rgba(2,8,23,.10);font-size:12px;color:rgba(2,8,23,.75);font-weight:700}
.tagbtn{display:inline-flex;gap:8px;align-items:center;padding:6px 10px;border-radius:999px;background:#fff;border:1px solid rgba(2,8,23,.14);font-size:12px;color:rgba(2,8,23,.80);cursor:pointer;font-weight:800}
.tagbtn:hover{background:rgba(2,8,23,.02)}

.article-sheet-body{padding:10px 12px 14px}
.article-sheet-img{width:100%;border-radius:14px;border:1px solid rgba(2,8,23,.10);box-shadow:0 10px 22px rgba(2,8,23,.10);margin:10px 0;background:#fff;cursor:pointer}
.article-sheet--preview .article-sheet-title{font-size:18px}

/* Image modal (click on article image) */
.imgmodal{position:fixed;inset:0;display:none;align-items:center;justify-content:center;z-index:9999}
.imgmodal.open{display:flex}
.imgmodal-backdrop{position:absolute;inset:0;background:rgba(2,8,23,.68)}
.imgmodal-card{position:relative;max-width:min(980px,96vw);max-height:92vh;background:#fff;border-radius:18px;overflow:auto;padding:12px;box-shadow:0 30px 60px rgba(0,0,0,.35)}
.imgmodal-close{position:absolute;right:10px;top:10px;width:38px;height:38px;border-radius:999px;border:1px solid rgba(2,8,23,.14);background:#fff;cursor:pointer}
.imgmodal-img{display:block;max-width:100%;height:auto;border-radius:14px;border:1px solid rgba(2,8,23,.10)}




/* Header responsive */
.page-issue .mastmini{display:none}

@media (max-width: 820px){
  .site-header{top:8px}
  .mastlogo{height:42px}
  .soc{width:28px;height:28px;font-size:13px}
}

@media (max-width: 700px){
  .container{padding:10px}
  .site-header{padding:8px 10px; top:8px}
  .mastrow{flex-direction:row;align-items:center;justify-content:space-between;gap:10px}
  .mastlogo{height:38px}
  .soc{width:26px;height:26px;font-size:12px}
  .mastline{margin:6px 0}

  /* Controls: keep single line (scroll horizontally if needed) */
  .issue-controls{flex-wrap:nowrap;overflow-x:auto;gap:8px;scrollbar-width:none}
  .issue-controls::-webkit-scrollbar{display:none}
  .ctrl-left,.ctrl-mid,.ctrl-right{flex-wrap:nowrap;width:auto}
  .ctrl-mid{min-width:0;flex:0 0 auto}
  .pstrip{display:none}
  .allpages{display:none}
  .pageSelect{
    display:block;
    min-width:170px;
    border:1px solid rgba(2,8,23,.14);
    background:#fff;
    border-radius:10px;
    padding:8px 10px;
    font-size:13px
  }
  .ctrl-field input,.ctrl-field select{border-radius:10px;padding:8px 32px 8px 10px;font-size:13px}
  .pnav{width:34px;height:34px;border-radius:10px}
  .zbtn{height:34px;min-width:40px;border-radius:10px}
  .mastmini{display:none}
}


@media (max-width: 1100px){
  .epaper-shell{grid-template-columns:160px 1fr;}
  .epaper-right{grid-column:1 / -1;}
  .epaper-thumbs{max-height:260px;display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:10px}
  .epaper-thumb{margin-bottom:0}
}

@media (max-width: 700px){
  .epaper-shell{grid-template-columns:1fr;}
  .epaper-mid{order:1}
  .epaper-stage{height:72vh;overflow:hidden}
  .epaper-left{order:2;height:auto}
  .epaper-thumbs{display:flex;gap:10px;overflow-x:auto;overflow-y:hidden;flex:unset}
  .epaper-thumb{min-width:140px;}

  /* Mobile: article viewer as a bottom sheet (no scrolling to it) */
  .epaper-right{
    position:fixed;
    left:10px;
    right:10px;
    bottom:calc(10px + var(--bottomBarH) + env(safe-area-inset-bottom));
    height:52vh;
    max-height:560px;
    z-index:1600;
    border-radius:18px;
    box-shadow:0 24px 60px rgba(2,8,23,.22);
    transform:translateY(calc(100% + 16px));
    transition:transform .22s ease;
    overflow:hidden;
    background:var(--card);
    padding-bottom:calc(var(--bottomBarH) + env(safe-area-inset-bottom));
  }
  .epaper-shell.viewer-open .epaper-right{transform:translateY(0)}
  .epaper-right .epaper-sidehead{display:none}
  .article-panel{padding:12px;overflow:auto}
}




/* --- Mobile layout to match 'eAmarDesh' style (compact header + stacked controls + full page + bottom thumbs) --- */
@media (max-width: 700px){
  body{background:#ffffff;}
  .container{padding:0}
  .site-header{
    position:relative;
    top:0;
    padding:12px 12px 8px;
    margin:0 0 8px;
    border-radius:0;
    box-shadow:none;
    background:#fff;
  }
  .mastrow{justify-content:center}
  .mastsocial{display:none !important}
  .mastbrand{justify-content:center}
  .mastlogo{height:56px}
  .mastline{margin:10px 0}

  /* Controls: 3 rows (date+edition) / (page nav) / (all pages) */
  .issue-controls{
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:10px;
    flex-wrap:nowrap;
    overflow:visible;
  }
  .ctrl-left{
    width:100%;
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap:10px;
  }
  .ctrl-left .ctrl-field{width:100%}
  .ctrl-field input,.ctrl-field select{width:100%; border-radius:14px; padding:12px 38px 12px 12px; font-size:14px}
  .ctrl-mid{
    width:100%;
    justify-content:center;
    min-width:0;
    gap:10px;
  }
  .pnav{width:42px;height:42px;border-radius:14px}
  .pstrip{
    display:flex !important;
    gap:10px;
    align-items:center;
    overflow-x:auto;
    max-width:100%;
    padding:2px 4px;
    scrollbar-width:none;
  }
  .pstrip::-webkit-scrollbar{display:none}
  .pnum{width:42px;height:42px;border-radius:14px}
  .ctrl-right{
    width:100%;
    justify-content:center;
    gap:10px;
  }
  /* keep zoom buttons available on mobile */
  .pageSelect{display:none !important}
  .allpages{
    display:inline-flex !important;
    height:44px;
    padding:0 18px;
    border-radius:14px;
    font-size:15px;
  }

  /* Reader layout: page first, thumbs below */
  .epaper-shell{grid-template-columns:1fr; gap:10px}
  .epaper-mid{order:1}
  .epaper-stage{
    margin-top:0;
    height: calc(100vh - 300px);
    min-height: 460px;
    border-radius:0;
    box-shadow:none;
    padding:10px 12px;
    overflow:hidden;
  }
  .viewer-wrap[data-epaper-viewer]{min-height: unset; height:100%}

  /* Bottom thumbs strip */
  .epaper-left{
    order:2;
    height:auto;
    border-radius:0;
    box-shadow:none;
    background:#fff;
  }
  .epaper-left .epaper-sidehead{display:none}
  .epaper-thumbs{
    padding: 8px 12px 16px;
    display:flex;
    gap:12px;
    overflow-x:auto;
    overflow-y:hidden;
    scrollbar-width:none;
  }
  .epaper-thumbs::-webkit-scrollbar{display:none}
  .epaper-thumb{
    min-width: 140px;
    margin-bottom:0;
    border-radius:14px;
  }
  .epaper-thumb .badge{display:none}

  /* Article viewer bottom sheet stays overlay; keep user position */
  .epaper-right{
    left:12px;
    right:12px;
    bottom:calc(12px + var(--bottomBarH) + env(safe-area-inset-bottom));
    height: 56vh;
    max-height: 620px;
  }
  .article-panel{padding:12px}
}

/* --- Light footer + mobile bottom bar --- */
.site-footer{margin-top:14px;background:linear-gradient(180deg, rgba(2,8,23,.02), rgba(2,8,23,0));border-top:1px solid rgba(2,8,23,.08);border-radius:14px;box-shadow:0 10px 30px rgba(2,8,23,.04);padding:14px}
.foot-wrap{display:grid;grid-template-columns:1.2fr 1fr;gap:14px;align-items:start}
.foot-title{font-weight:1000;font-size:18px;letter-spacing:.2px}
.foot-about{color:var(--muted);font-size:12px;margin-top:6px}
.foot-site{display:inline-flex;margin-top:10px;font-weight:900;color:rgba(2,8,23,.78);padding:8px 10px;border-radius:12px;background:#fff;border:1px solid rgba(2,8,23,.10)}
.foot-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;align-content:start}
.foot-link{display:flex;gap:10px;align-items:center;padding:10px 12px;border-radius:14px;border:1px solid rgba(2,8,23,.10);background:#fff;color:rgba(2,8,23,.85);font-weight:800}
.foot-link i{width:18px;text-align:center;color:rgba(2,8,23,.55)}
.foot-link:hover{transform:translateY(-1px)}
.foot-meta{grid-column:1 / -1;border-top:1px solid rgba(2,8,23,.08);padding-top:10px}

.mobilebar{position:fixed;left:0;right:0;bottom:0;height:var(--bottomBarH);padding:8px 12px calc(8px + env(safe-area-inset-bottom));background:rgba(255,255,255,.92);backdrop-filter:blur(12px);border-top:1px solid rgba(2,8,23,.10);display:none;align-items:flex-end;justify-content:space-around;z-index:2000}
.mb-item{flex:1;display:flex;flex-direction:column;align-items:center;gap:6px;color:rgba(2,8,23,.78);font-weight:800;font-size:12px}
.mb-item i{font-size:18px}
.mb-home{flex:1.1}
.mb-homebtn{width:56px;height:56px;border-radius:18px;display:flex;align-items:center;justify-content:center;background:rgba(14,165,233,.12);border:1px solid rgba(14,165,233,.25);box-shadow:0 12px 24px rgba(2,8,23,.10);transform:translateY(-16px)}
.mb-homebtn i{font-size:20px;color:rgba(2,8,23,.85)}
.mb-hometxt{margin-top:-10px}

@media (max-width: 700px){
  body{padding-bottom:calc(var(--bottomBarH) + env(safe-area-inset-bottom))}
  .site-footer{border-radius:0;margin-top:0}
  .foot-wrap{grid-template-columns:1fr}
  .mobilebar{display:flex}
}


/* Desktop: make reader fill viewport (no bottom gaps) and keep a clean edge */
@media (min-width: 701px){
  body{background:#ffffff;}
  .container{max-width:1600px;padding:10px 12px;}
  .epaper-stage{padding:6px;}
  .epaper-left,.epaper-right{border-radius:14px;}
}

