/* BN ePaper – frontend */
:root {
	--bnep-primary: #d7171f;
	--bnep-ink: #1b1b1b;
	--bnep-muted: #666;
	--bnep-line: #dcdcdc;
	--bnep-soft: #f4f4f4;
	--bnep-bg: #fff;
	--bnep-font: 'SolaimanLipi', 'Kalpurush', 'Noto Serif Bengali', 'Noto Sans Bengali', serif;
	--bnep-w: 1200px;
}

.bnep, .bnep * , .bnep *::before, .bnep *::after { box-sizing: border-box; }
.bnep { font-family: var(--bnep-font); color: var(--bnep-ink); font-size: 17px; line-height: 1.55; }
.bnep a { color: inherit; text-decoration: none; }
.bnep img { max-width: 100%; height: auto; }
.bnep button { font-family: inherit; }
.bnep-ic { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; }

body.bnep-standalone { margin: 0; background: var(--bnep-bg); }

.bnep-container { width: 100%; max-width: var(--bnep-w); margin: 0 auto; padding: 0 15px; }

/* Top bar */
.bnep-topbar { border-bottom: 1px solid var(--bnep-line); font-size: 15px; }
.bnep-topbar-in { display: flex; justify-content: space-between; align-items: center; min-height: 38px; gap: 12px; }
.bnep-now { color: var(--bnep-muted); }
.bnep-social { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.bnep-social a { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; background: #555; font-size: 14px; transition: background .15s; }
.bnep-social a[aria-label="Facebook"] { background: #1877f2; }
.bnep-social a[aria-label="YouTube"] { background: #ff0000; }
.bnep-social a[aria-label="X"] { background: #000; }
.bnep-social a[aria-label="Instagram"] { background: #c13584; }
.bnep-social a[aria-label="TikTok"] { background: #111; }

/* Header */
.bnep-header { padding: 18px 0 14px; text-align: center; }
.bnep-logo { display: inline-block; }
.bnep-logo img { max-height: 78px; width: auto; display: block; }
.bnep-logo-text { font-size: 40px; font-weight: 700; color: var(--bnep-primary); line-height: 1.2; }

/* Nav */
.bnep-nav { background: var(--bnep-primary); color: #fff; }
.bnep-nav-in { display: flex; flex-wrap: wrap; align-items: stretch; }
.bnep-nav-link, .bnep-cat-menu a { display: inline-flex; align-items: center; padding: 9px 14px; color: #fff; font-size: 17px; background: none; border: 0; cursor: pointer; }
.bnep-nav-link:hover, .bnep-cat-menu a:hover, .bnep-nav-link:focus-visible { background: rgba(0,0,0,.18); }
.bnep-nav-home { font-weight: 700; }
.bnep-cat-menu { list-style: none; display: flex; flex-wrap: wrap; margin: 0; padding: 0; }
.bnep-drop { position: relative; }
.bnep-drop-menu { list-style: none; margin: 0; padding: 6px 0; position: absolute; left: 0; top: 100%; min-width: 210px; background: #fff; border: 1px solid var(--bnep-line); border-top: 3px solid var(--bnep-primary); box-shadow: 0 8px 20px rgba(0,0,0,.12); z-index: 50; display: none; }
.bnep-drop:hover .bnep-drop-menu, .bnep-drop:focus-within .bnep-drop-menu, .bnep-drop.is-open .bnep-drop-menu { display: block; }
.bnep-drop-menu a { display: block; padding: 7px 16px; color: var(--bnep-ink); }
.bnep-drop-menu a:hover { background: var(--bnep-soft); color: var(--bnep-primary); }

/* Layout */
.bnep-main { display: grid; grid-template-columns: 270px minmax(0, 1fr); grid-template-areas: "side content"; gap: 24px; padding-top: 22px; padding-bottom: 30px; }
.bnep-main.bnep-no-sidebar { grid-template-columns: minmax(0, 1fr); grid-template-areas: "content"; }
.bnep-content { grid-area: content; min-width: 0; }
.bnep-sidebar { grid-area: side; min-width: 0; }

/* Sidebar */
.bnep-box { border: 1px solid var(--bnep-line); margin-bottom: 18px; background: #fff; }
.bnep-box-title { margin: 0; padding: 8px 12px; font-size: 18px; font-weight: 700; color: #fff; background: var(--bnep-primary); line-height: 1.4; }
.bnep-archive { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px; }
.bnep-archive label { display: flex; flex-direction: column; gap: 3px; font-size: 14px; color: var(--bnep-muted); }
.bnep-archive select { width: 100%; padding: 6px 4px; font: inherit; font-size: 15px; border: 1px solid #c9c9c9; border-radius: 3px; background: #fff; color: var(--bnep-ink); }
.bnep-archive .bnep-btn { grid-column: 1 / -1; }
.bnep-special { text-align: center; }
.bnep-special img { display: block; width: 100%; }
.bnep-read { display: block; padding: 8px; font-weight: 600; color: var(--bnep-primary); border-top: 1px solid var(--bnep-line); }
.bnep-read:hover { background: var(--bnep-soft); }

.bnep-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 18px; font: inherit; font-size: 16px; font-weight: 600; color: #fff; background: var(--bnep-primary); border: 0; border-radius: 3px; cursor: pointer; }
.bnep-btn:hover { filter: brightness(.92); }
.bnep-btn-ghost { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font: inherit; font-size: 15px; color: var(--bnep-ink); background: #fff; border: 1px solid var(--bnep-line); border-radius: 3px; cursor: pointer; }
.bnep-btn-ghost:hover { border-color: var(--bnep-primary); color: var(--bnep-primary); }

/* Editions */
.bnep-editions { display: flex; border-bottom: 2px solid var(--bnep-primary); margin-bottom: 14px; flex-wrap: wrap; }
.bnep-edition { padding: 8px 18px; font-size: 17px; font-weight: 600; color: var(--bnep-ink); background: var(--bnep-soft); border: 1px solid var(--bnep-line); border-bottom: 0; margin-right: 4px; }
.bnep-edition.is-active { background: var(--bnep-primary); color: #fff; border-color: var(--bnep-primary); }
.bnep-edition.is-empty:not(.is-active) { opacity: .55; }

/* Title & page numbers */
.bnep-title { margin: 0 0 12px; font-size: 24px; font-weight: 700; line-height: 1.35; text-align: center; }
.bnep-title-date { color: var(--bnep-primary); font-weight: 600; }
.bnep-pages { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 14px; }
.bnep-pg { min-width: 38px; height: 38px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 600; border: 1px solid #c9c9c9; border-radius: 3px; background: #fff; }
.bnep-pg:hover { border-color: var(--bnep-primary); color: var(--bnep-primary); }
.bnep-pg.is-active { background: var(--bnep-primary); border-color: var(--bnep-primary); color: #fff; }

/* Paper */
.bnep-paper { border: 1px solid var(--bnep-line); background: #fff; }
.bnep-paper-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 8px; border-bottom: 1px solid var(--bnep-line); background: var(--bnep-soft); flex-wrap: wrap; }
.bnep-hint { font-size: 14px; color: var(--bnep-muted); }
.bnep-tools-r { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.bnep-stage { position: relative; width: 100%; line-height: 0; user-select: none; -webkit-user-select: none; }
.bnep-page-img { display: block; width: 100%; height: 100%; object-fit: contain; }
.bnep-hot { position: absolute; display: block; z-index: 2; cursor: zoom-in; border: 1px solid transparent; transition: background-color .12s, border-color .12s; }
.bnep-hot:hover, .bnep-hot:focus-visible { background: color-mix(in srgb, var(--bnep-primary) 10%, transparent); border-color: var(--bnep-primary); outline: none; box-shadow: inset 0 0 0 1px var(--bnep-primary); }
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
	.bnep-hot:hover, .bnep-hot:focus-visible { background: rgba(215, 23, 31, .1); }
}

.bnep-prevnext { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.bnep-pn { display: inline-flex; align-items: center; padding: 9px 18px; font-size: 17px; font-weight: 600; color: #fff; background: var(--bnep-primary); border-radius: 3px; }
.bnep-pn:hover { filter: brightness(.92); }
.bnep-pn.is-disabled { background: #bdbdbd; cursor: not-allowed; }

.bnep-empty { padding: 40px 20px; text-align: center; border: 1px dashed #c9c9c9; background: var(--bnep-soft); }
.bnep-empty p { margin: 0 0 10px; }

/* Footer */
.bnep-footer { border-top: 3px solid var(--bnep-primary); background: var(--bnep-soft); margin-top: 10px; }
.bnep-footer-in { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-top: 22px; padding-bottom: 22px; flex-wrap: wrap; }
.bnep-footer-text { font-size: 15px; line-height: 1.75; }
.bnep-footer-brand img { max-height: 56px; width: auto; }
.bnep-copy { text-align: center; padding: 10px 15px; font-size: 14px; color: #fff; background: #2b2b2b; }

/* ------------------------------------------------------------------ */
/* Reader popup */
.bnep-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 2vh 2vw; }
.bnep-modal[hidden] { display: none; }
.bnep-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.78); }
.bnep-modal-box { position: relative; display: flex; flex-direction: column; width: min(var(--bnep-pop-w, 1000px), 96vw); height: 96vh; background: #fff; border-radius: 4px; box-shadow: 0 20px 60px rgba(0,0,0,.45); overflow: hidden; animation: bnep-pop .16s ease-out; }
@keyframes bnep-pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bnep-modal-box { animation: none; } }

.bnep-modal-head { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--bnep-line); background: #fff; }
.bnep-modal-meta { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.bnep-modal-logo { height: 28px; width: auto; flex: none; }
.bnep-modal-title { font-size: 15px; color: var(--bnep-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bnep-zoom-tools { display: flex; align-items: center; gap: 2px; flex: none; }
.bnep-zoom-val { min-width: 48px; text-align: center; font-size: 14px; color: var(--bnep-muted); }
.bnep-ib { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; color: var(--bnep-ink); background: none; border: 0; border-radius: 3px; cursor: pointer; }
.bnep-ib:hover { background: var(--bnep-soft); color: var(--bnep-primary); }
.bnep-ib:disabled { opacity: .35; cursor: default; background: none; color: var(--bnep-ink); }
.bnep-close { font-size: 20px; color: #fff; background: var(--bnep-primary); margin-left: 4px; }
.bnep-close:hover { background: var(--bnep-primary); color: #fff; filter: brightness(.9); }

.bnep-modal-body { position: relative; flex: 1 1 auto; min-height: 0; background: #e9e9e9; display: flex; }
.bnep-zoom { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; touch-action: pan-x pan-y; cursor: zoom-in; outline: none; scrollbar-gutter: stable; }
.bnep-zoom.is-max { cursor: zoom-out; }
.bnep-zoom.is-dragging { cursor: grabbing; }
.bnep-zoom:focus-visible { box-shadow: inset 0 0 0 2px var(--bnep-primary); }
.bnep-zoom-inner { width: 100%; margin: 0 auto; background: #fff; line-height: 0; }
.bnep-zoom-inner img { display: block; width: 100%; margin: 0 auto; height: auto; max-width: none; pointer-events: none; -webkit-user-drag: none; user-select: none; image-rendering: auto; }
.bnep-part-label { line-height: 1.5; padding: 5px 12px; font-size: 15px; font-weight: 600; color: var(--bnep-primary); background: var(--bnep-soft); border-top: 1px solid var(--bnep-line); border-bottom: 1px solid var(--bnep-line); }
.bnep-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 16px; color: var(--bnep-muted); background: rgba(255,255,255,.7); }
.bnep-loading[hidden] { display: none; }

.bnep-wheel { height: 30px; margin-left: 4px; padding: 0 10px; font: inherit; font-size: 14px; color: var(--bnep-ink); background: #fff; border: 1px solid var(--bnep-line); border-radius: 15px; cursor: pointer; white-space: nowrap; }
.bnep-wheel:hover { border-color: var(--bnep-primary); color: var(--bnep-primary); }
.bnep-wheel.is-on { color: #fff; background: var(--bnep-primary); border-color: var(--bnep-primary); }
.bnep-wheel:focus-visible { outline: 2px solid var(--bnep-primary); outline-offset: 2px; }
.bnep-zoom-hint { flex: 1 1 auto; font-size: 13px; color: var(--bnep-muted); }
.bnep-modal-foot { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 12px; padding: 8px 10px; border-top: 1px solid var(--bnep-line); background: #fff; }
.bnep-share-label { font-size: 15px; font-weight: 600; color: var(--bnep-muted); display: inline-flex; gap: 6px; align-items: center; }
.bnep-share { display: flex; flex-wrap: wrap; gap: 6px; }
.bnep-sh { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; color: #fff; border: 0; border-radius: 50%; cursor: pointer; transition: transform .1s, filter .1s; }
.bnep-sh:hover { filter: brightness(.9); transform: translateY(-1px); }
.bnep-sh:focus-visible, .bnep-ib:focus-visible, .bnep-btn:focus-visible, .bnep-pg:focus-visible, .bnep-pn:focus-visible { outline: 2px solid var(--bnep-primary); outline-offset: 2px; }
.bnep-sh[hidden] { display: none; }
.bnep-sh-fb { background: #1877f2; }
.bnep-sh-x { background: #000; }
.bnep-sh-wa { background: #25d366; }
.bnep-sh-tg { background: #229ed9; }
.bnep-sh-li { background: #0a66c2; }
.bnep-sh-native { background: #6b6b6b; }
.bnep-sh-copy { background: #555; }
.bnep-sh-dl { background: #2e7d32; }
.bnep-sh-print { background: #37474f; }

.bnep-toast { position: absolute; left: 50%; bottom: 80px; transform: translateX(-50%); padding: 8px 16px; font-size: 15px; color: #fff; background: rgba(0,0,0,.85); border-radius: 20px; z-index: 3; pointer-events: none; }
.bnep-toast[hidden] { display: none; }

html.bnep-lock, html.bnep-lock body { overflow: hidden; }

/* Responsive */
@media (max-width: 900px) {
	.bnep-main { grid-template-columns: minmax(0, 1fr); grid-template-areas: "content" "side"; }
	.bnep-sidebar { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; }
}
@media (max-width: 900px) {
	.bnep-zoom-hint { display: none; }
}
@media (hover: none) {
	.bnep-wheel { display: none; }
}
@media (max-width: 600px) {
	.bnep { font-size: 16px; }
	.bnep-container { padding: 0 10px; }
	.bnep-logo img { max-height: 54px; }
	.bnep-logo-text { font-size: 30px; }
	.bnep-title { font-size: 20px; }
	.bnep-pg { min-width: 34px; height: 34px; font-size: 16px; }
	.bnep-hint { display: none; }
	.bnep-paper-tools { justify-content: flex-end; }
	.bnep-edition { padding: 7px 12px; font-size: 16px; }
	.bnep-modal { padding: 0; }
	.bnep-modal-box { width: 100vw; max-width: 100vw; height: 100%; height: 100dvh; border-radius: 0; }
	.bnep-wheel, .bnep-zoom-hint { display: none; }
	.bnep-modal-logo { display: none; }
	.bnep-zoom-val { display: none; }
	.bnep-sh { width: 34px; height: 34px; }
	.bnep-share-label { display: none; }
	.bnep-footer-in { flex-direction: column; text-align: center; }
}

@media print {
	.bnep-topbar, .bnep-nav, .bnep-sidebar, .bnep-pages, .bnep-prevnext, .bnep-paper-tools, .bnep-editions, .bnep-footer, .bnep-modal { display: none !important; }
	.bnep-main { display: block; }
}
