/* ══════════════════════════════════════════════════
   Vidyarthi Mitra E-Paper Viewer
   ══════════════════════════════════════════════════ */

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

:root {
  --ep-orange: #d9252a;
  --ep-orange-dark: #b21b20;
  --ep-dark: #111827;
  --ep-desk: #0f0f12;
  --ep-nav-bg: #1a1a1a;
  --ep-white: #ffffff;
  --ep-paper-bg: #ffffff;
  --ep-border: #e5e7eb;
  --ep-muted: #6b7280;
  --ep-text: #111827;
  --ep-nav-h: 46px;
  --ep-toolbar-w: 46px;
  --ep-font: 'DM Sans', 'Hind', sans-serif;
  --ep-serif: 'Playfair Display', 'Hind', serif;
}

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

body.epaper-body {
  font-family: var(--ep-font);
  background: var(--ep-desk);
  color: var(--ep-text);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ── Shared navbar override: always solid on viewer (no hero image here) ── */
body.epaper-body .vm-main-header {
  background: rgba(5, 10, 21, 0.92) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}
body.epaper-body .vm-nav-item,
body.epaper-body .vm-dropdown-trigger,
body.epaper-body .vm-btn-link {
  color: #ffffff;
}
body.epaper-body .vm-nav-item:hover,
body.epaper-body .vm-dropdown-trigger:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}


/* ── CATEGORY / EDITION NAV ────────────────────── */
.ep-nav {
  position: relative;
  height: var(--ep-nav-h);
  background: var(--ep-nav-bg);
  border-bottom: 2px solid rgba(217, 37, 42, 0.6);
  display: flex;
  align-items: stretch;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

/* date/edition button lives at the left of the nav */
.ep-date-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 16px;
  font-family: var(--ep-font);
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: all .2s;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.ep-date-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.ep-date-btn i {
  font-size: 11px;
  color: var(--ep-orange);
}

.ep-nav-scroll-btn {
  width: 26px;
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .2s;
}

.ep-nav-scroll-btn:hover {
  color: rgba(255, 255, 255, 0.8);
}

.ep-nav-list {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  -ms-overflow-style: none;
}

.ep-nav-list::-webkit-scrollbar {
  display: none;
}

.ep-nav-item {
  padding: 0 16px;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  transition: all .2s;
  flex-shrink: 0;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: -2px;
}

.ep-nav-item:hover {
  color: rgba(255, 255, 255, 0.85);
}

.ep-nav-item.active {
  color: #fff;
  border-bottom-color: var(--ep-orange);
}

/* ── MAIN READING AREA ─────────────────────────── */
.ep-main {
  background: var(--ep-desk);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
  padding: 28px 48px 158px;
  min-height: calc(100vh - var(--ep-nav-h) - 104px);
}

/* ── NEWS SIDEBAR ──────────────────────────────── */
.ep-news-sidebar {
  width: 280px;
  flex-shrink: 0;
  /* flex-shrink:0 is intentional — sidebar is fixed width on wide screens only */
  position: sticky;
  top: calc(var(--ep-nav-h) + 52px + 12px);
  /* below fixed nav + cat-nav */
  max-height: calc(100vh - var(--ep-nav-h) - 52px - 24px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}

.ep-news-sidebar::-webkit-scrollbar {
  width: 4px;
}

.ep-news-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.ep-news-sidebar::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}

.ep-news-sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 10px;
  border-bottom: 2px solid var(--ep-red);
  margin-bottom: 12px;
  position: sticky;
  top: 0;
  background: var(--ep-desk);
  z-index: 1;
}

.ep-news-sidebar-header span {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
}

.ep-news-sidebar-header i {
  color: var(--ep-red);
  font-size: 14px;
}

.ep-news-card {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
  border-radius: 6px;
}

.ep-news-card:hover {
  background: rgba(255, 255, 255, .04);
}

.ep-news-card:hover .ep-news-card-title {
  color: var(--ep-red);
}

.ep-news-card-thumb {
  width: 72px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: #1e1e24;
}

.ep-news-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ep-news-card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #374151;
  font-size: 20px;
}

.ep-news-card-body {
  flex: 1;
  min-width: 0;
}

.ep-news-card-cat {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--ep-red);
  margin-bottom: 3px;
}

.ep-news-card-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: #e5e7eb;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .15s;
}

.ep-news-card-meta {
  font-size: 10px;
  color: #6b7280;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ep-news-sidebar-more {
  display: block;
  text-align: center;
  margin-top: 14px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  text-decoration: none;
  transition: all .2s;
}

.ep-news-sidebar-more:hover {
  border-color: var(--ep-red);
  color: var(--ep-red);
}

.ep-news-sidebar-skeleton .ep-sk-line {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, #1e1e24 25%, #2a2a30 50%, #1e1e24 75%);
  background-size: 200% 100%;
  animation: epShimmer 1.4s infinite;
  margin-bottom: 8px;
}

/* ── NEWSPAPER PAPER (masthead + page, same width) ─ */
.ep-paper {
  width: 100%;
  max-width: 920px;
  min-width: 0;
  background: var(--ep-white);
  border-radius: 3px 3px 2px 2px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* deep floating shadow like a real newspaper lying on a dark desk */
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 4px 12px rgba(0, 0, 0, 0.4),
    0 20px 60px rgba(0, 0, 0, 0.7),
    0 40px 100px rgba(0, 0, 0, 0.5);
  position: relative;
}

/* left-edge spine removed */
.ep-paper::before {
  display: none;
}

.ep-paper:fullscreen {
  max-width: 100%;
  border-radius: 0;
  box-shadow: none;
}

/* document.documentElement fullscreen — whole page visible incl masthead */
body.ep-fullscreen .ep-paper {
  max-width: 100%;
  border-radius: 0;
  box-shadow: none;
}

body.ep-fullscreen .ep-main {
  padding: 0 0 0;
  min-height: calc(100vh - var(--ep-nav-h));
}

body.ep-fullscreen .ep-viewer {
  max-height: calc(100vh - var(--ep-nav-h) - 124px - 116px);
}

/* Fullscreen masthead — same paper width, reduced height */
body.ep-fullscreen .ep-masthead,
.ep-reader-container:fullscreen .ep-masthead {
  padding: 0;
  overflow: hidden;
  max-height: 90px;
}

body.ep-fullscreen .ep-masthead-img,
.ep-reader-container:fullscreen .ep-masthead-img {
  min-height: unset !important;
  height: 90px !important;
  border: none;
  border-radius: 0;
  overflow: hidden;
}

body.ep-fullscreen .ep-masthead-img img,
.ep-reader-container:fullscreen .ep-masthead-img img {
  width: 100%;
  height: auto;
  display: block;
}


/* ── MASTHEAD STRIP ────────────────────────────── */
.ep-masthead {
  padding: 14px 20px 10px;
  background: var(--ep-paper-bg);
  border-bottom: 2px solid #e8e0d4;
  flex-shrink: 0;
}

.ep-masthead-img {
  min-height: 60px;
  border-radius: 6px;
  border: 1px dashed #d1c9b8;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ep-paper-bg);
  position: relative;
}

.ep-masthead-img:has(.ep-section-header) {
  border: none;
  border-radius: 0;
  background: #fff;
  padding: 0;
  height: 72px;
  overflow: hidden;
}

.ep-masthead-img img {
  width: 100%;
  height: auto;
  display: block;
}

.ep-masthead-placeholder {
  font-size: 11px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

body.epaper-body.has-masthead .ep-masthead-placeholder {
  display: none;
}

/* ── Section Header (pages 2+) ── */
.ep-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-top: 2px dotted #d9252a;
  border-bottom: 2px dotted #d9252a;
  background: #fff;
  height: 100%;
  box-sizing: border-box;
}

.ep-section-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ep-section-num {
  font-size: 32px;
  font-weight: 800;
  color: #d9252a;
  line-height: 1;
  font-family: Georgia, serif;
  letter-spacing: -1px;
  flex-shrink: 0;
}

.ep-section-cat {
  font-size: 18px;
  font-weight: 800;
  color: #d9252a;
  font-family: Georgia, serif;
  letter-spacing: 0.5px;
  border-left: 3px solid #d9252a;
  padding-left: 16px;
  line-height: 1.1;
}

.ep-section-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.ep-section-date {
  font-size: 10px;
  font-weight: 600;
  color: #374151;
  line-height: 1.4;
}

.ep-section-logo {
  height: 40px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}

.ep-section-logo-text {
  font-size: 13px;
  font-weight: 800;
  color: #d9252a;
}

@media (max-width: 600px) {
  .ep-section-num {
    font-size: 22px;
  }

  .ep-section-cat {
    font-size: 13px;
    padding-left: 10px;
  }

  .ep-section-logo {
    height: 28px;
  }

  .ep-section-header {
    padding: 0 12px;
  }
}

.ep-masthead-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.ep-masthead-item {
  position: absolute;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ep-masthead-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ep-masthead-text {
  font-family: var(--ep-serif);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: center;
  width: 100%;
  line-height: 1.1;
}

/* ── PAGE VIEWER ───────────────────────────────── */
.ep-viewer {
  flex: 1;
  position: relative;
  overflow: auto;
  background: var(--ep-paper-bg);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 20px 48px;
  user-select: none;
}

.ep-viewer.can-pan {
  cursor: grab;
}

.ep-viewer.can-pan:active,
.ep-viewer.is-panning {
  cursor: grabbing;
}

.ep-page-container {
  position: relative;
  width: 100%;
  margin: 0 auto;
}

.ep-page-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  background: #fff;
  box-shadow:
    2px 8px 24px rgba(0, 0, 0, 0.18),
    0 1px 0 rgba(0, 0, 0, 0.08);
  border-radius: 1px;
}

/* Empty state */
#epEmptyState {
  display: none;
  text-align: center;
  padding: 60px 24px;
}

#epEmptyState i {
  color: #4b5563;
}

/* ── DIRECTIONAL PAGE FLIP ─────────────────────── */
/* Default flip (initial load) */
.ep-flip {
  animation: ep-flip-in .65s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* Forward (next page) — enters from the right */
.ep-flip.ep-flip-forward {
  animation-name: ep-flip-forward;
  transform-origin: left center;
}

/* Backward (prev page) — enters from the left */
.ep-flip.ep-flip-backward {
  animation-name: ep-flip-backward;
  transform-origin: right center;
}

@keyframes ep-flip-in {
  0% {
    opacity: 0;
    transform: perspective(2000px) scale(0.97);
    filter: brightness(0.7);
  }

  100% {
    opacity: 1;
    transform: perspective(2000px) scale(1);
    filter: brightness(1);
  }
}

@keyframes ep-flip-forward {
  0% {
    opacity: 0;
    transform: perspective(2200px) rotateY(-28deg) translateX(-40px) scale(0.96);
    filter: brightness(0.45);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  }

  55% {
    opacity: 0.9;
    transform: perspective(2200px) rotateY(-4deg) translateX(-4px) scale(1.005);
    filter: brightness(0.92);
  }

  100% {
    opacity: 1;
    transform: perspective(2200px) rotateY(0deg) translateX(0) scale(1);
    filter: brightness(1);
    box-shadow:
      -10px 0 28px rgba(0, 0, 0, 0.22),
      2px 8px 24px rgba(0, 0, 0, 0.18);
  }
}

@keyframes ep-flip-backward {
  0% {
    opacity: 0;
    transform: perspective(2200px) rotateY(28deg) translateX(40px) scale(0.96);
    filter: brightness(0.45);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  }

  55% {
    opacity: 0.9;
    transform: perspective(2200px) rotateY(4deg) translateX(4px) scale(1.005);
    filter: brightness(0.92);
  }

  100% {
    opacity: 1;
    transform: perspective(2200px) rotateY(0deg) translateX(0) scale(1);
    filter: brightness(1);
    box-shadow:
      -10px 0 28px rgba(0, 0, 0, 0.22),
      2px 8px 24px rgba(0, 0, 0, 0.18);
  }
}

/* ── PAPER FOOTER STRIP ────────────────────────── */
.ep-paper-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px 12px;
  border-top: 1px solid #e9e9e9;
  background: #fff;
  flex-shrink: 0;
}

.ep-footer-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ep-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.ep-dot.d1 {
  background: #9ca3af;
}

.ep-dot.d2 {
  background: #d1d5db;
}

.ep-dot.d3 {
  background: #fb923c;
}

.ep-dot.d4 {
  background: #0ea5e9;
}

.ep-dot.d5 {
  background: #facc15;
}

.ep-dot.d6 {
  background: #111827;
}

.ep-footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.ep-footer-link {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--ep-border);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #374151;
  text-decoration: none;
  font-size: 13px;
  transition: all .2s ease;
}

.ep-footer-link:hover {
  border-color: var(--ep-orange);
  color: var(--ep-orange);
  transform: translateY(-1px);
}

/* ── SIDE NAVIGATION CLICK ZONES ───────────────── */
/* Invisible wide arrows on left/right of the reading area for click navigation */
.ep-side-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 170;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 120px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .25s ease;
}

.ep-side-nav:hover {
  opacity: 1;
}

.ep-side-nav-left {
  left: 4px;
}

.ep-side-nav-right {
  right: 60px;
}

/* clear the toolbar */

.ep-side-nav-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  transition: background .2s;
}

.ep-side-nav:hover .ep-side-nav-icon {
  background: var(--ep-orange);
  border-color: var(--ep-orange);
}

/* ── BLOCK GRID ────────────────────────────────── */
.ep-block-grid {
  display: block;
  width: 100%;
  max-width: 860px;
  margin: 16px auto;
  padding: 0;
}

.ep-canvas-viewer {
  position: relative;
  width: 100%;
}

.ep-viewer:has(.ep-block-grid) {
  overflow: auto;
  align-items: flex-start;
}

.ep-block-card {
  overflow: hidden;
  cursor: pointer;
  background: transparent;
  transition: box-shadow .2s ease;
  box-shadow: none;
}

.ep-block-card:hover {
  box-shadow: none;
}

.ep-block-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.ep-block-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ede7db, #ddd5c5);
  color: #b5a896;
  font-size: 36px;
}

.ep-block-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(20, 12, 4, .82));
  padding: 18px 12px 11px;
  color: #fff;
}

.ep-block-cat {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: rgba(255, 255, 255, .7);
  margin-bottom: 3px;
}

.ep-block-title {
  font-family: var(--ep-serif);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

.ep-block-card.large .ep-block-title {
  font-size: 20px;
}

.ep-block-card.medium .ep-block-title {
  font-size: 16px;
}

.ep-block-sub {
  font-size: 11px;
  margin: 4px 0 0;
  color: rgba(255, 255, 255, .6);
  line-height: 1.3;
}

/* ── ARTICLE HOTSPOTS ──────────────────────────── */
.ep-hotspot {
  position: absolute;
  cursor: pointer;
  border: 1px solid rgba(217, 37, 42, 0.3);
  border-radius: 3px;
  background: rgba(217, 37, 42, 0.05);
  transition: all .25s ease;
  z-index: 10;
}

.ep-hotspot:hover {
  border-color: rgba(217, 37, 42, 0.7);
  background: rgba(217, 37, 42, 0.14);
  box-shadow: 0 2px 12px rgba(217, 37, 42, 0.15);
  z-index: 11;
}

.ep-hotspot::after {
  content: '📰 ' attr(title);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 15, 20, .95);
  color: #fff;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 20;
}

.ep-hotspot:hover::after {
  opacity: 1;
}

/* ── FLOATING ZOOM TOOLBAR (Right) ─────────────── */
.ep-toolbar {
  position: fixed;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 180;
}

.ep-tool-btn {
  width: var(--ep-toolbar-w);
  height: var(--ep-toolbar-w);
  background: rgba(26, 26, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.6);
  transition: all .2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ep-tool-btn:hover {
  color: #fff;
  border-color: var(--ep-orange);
  background: rgba(217, 37, 42, 0.2);
}

.ep-tool-btn.active {
  background: var(--ep-orange);
  color: #fff;
  border-color: var(--ep-orange);
}

.ep-tool-btn:disabled {
  opacity: .25;
  cursor: not-allowed;
  pointer-events: none;
}

.ep-tool-divider {
  width: 60%;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 3px auto;
}

/* ── THUMBNAIL STRIP ────────────────────────────── */
.ep-thumb-strip {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 116px;
  background: #1a1d26;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  z-index: 175;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
}

.ep-thumb-nav-btn {
  flex-shrink: 0;
  width: 30px;
  height: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}

.ep-thumb-nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.ep-thumb-scroll {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 8px;
  height: 100%;
  scrollbar-width: none;
}

.ep-thumb-scroll::-webkit-scrollbar {
  display: none;
}

.ep-thumb-card {
  flex-shrink: 0;
  width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  border-radius: 6px;
  padding: 4px 3px 3px;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  transition: all .2s ease;
}

.ep-thumb-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.ep-thumb-card.active {
  border-color: var(--ep-orange);
  background: rgba(217, 37, 42, 0.12);
}

.ep-thumb-label {
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 3px;
  text-align: center;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ep-thumb-card.active .ep-thumb-label {
  color: var(--ep-orange);
}

.ep-thumb-img {
  width: 100%;
  height: 72px;
  object-fit: cover;
  border-radius: 3px;
  display: block;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.ep-thumb-placeholder {
  width: 100%;
  height: 72px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.2);
  font-size: 26px;
}

/* ── PAGE NAVIGATION (Bottom Center) ───────────── */
.ep-pager {
  position: fixed;
  bottom: 130px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(20, 20, 24, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  border-radius: 28px;
  padding: 7px 18px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  z-index: 180;
}

.ep-pager-btn {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  transition: all .2s;
}

.ep-pager-btn:hover {
  background: var(--ep-orange);
  border-color: var(--ep-orange);
  color: #fff;
}

.ep-pager-btn:disabled {
  opacity: .25;
  cursor: not-allowed;
}

.ep-pager-info {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  min-width: 56px;
  text-align: center;
  letter-spacing: 0.5px;
}

/* ── DATE PICKER CALENDAR ───────────────────────── */
.ep-calendar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 155px;
}

.ep-calendar-overlay.open {
  display: flex;
}

.ep-calendar {
  background: var(--ep-white);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
  padding: 24px;
  width: 320px;
  animation: epSlideDown .22s ease;
}

@keyframes epSlideDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ep-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.ep-cal-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.ep-cal-nav-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--ep-border);
  border-radius: 50%;
  background: var(--ep-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--ep-text);
}

.ep-cal-nav-btn:hover {
  border-color: var(--ep-orange);
  color: var(--ep-orange);
}

.ep-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  text-align: center;
}

.ep-cal-day-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--ep-muted);
  padding: 5px 0;
}

.ep-cal-day {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  margin: auto;
}

.ep-cal-day:hover {
  background: #fff0e6;
  color: var(--ep-orange);
}

.ep-cal-day.today {
  font-weight: 700;
  border: 2px solid var(--ep-orange);
}

.ep-cal-day.selected {
  background: var(--ep-orange);
  color: #fff;
  font-weight: 700;
}

.ep-cal-day.disabled {
  opacity: .3;
  cursor: not-allowed;
}

.ep-cal-day.has-edition {
  position: relative;
}

.ep-cal-day.has-edition::after {
  content: '';
  position: absolute;
  bottom: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ep-orange);
}

/* ── ARTICLE DETAIL PANEL ───────────────────────── */
.ep-article-panel {
  position: fixed;
  inset: 0;
  background: #faf6f0;
  z-index: 1100;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4, 0, .2, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.ep-article-panel.open {
  transform: translateX(0);
}

/* ── Article top bar (Back + Play) ── */
.ep-article-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 0 0;
  background: #fff;
  border-bottom: 1px solid var(--ep-border);
  min-height: 48px;
}

.ep-tts-estimate {
  font-size: 11px;
  color: var(--ep-muted);
  white-space: nowrap;
}

.ep-article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 20px;
  color: var(--ep-orange);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--ep-font);
  transition: opacity .2s;
  flex-shrink: 0;
}

.ep-article-back:hover {
  opacity: .7;
}

.ep-art-listen-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ep-art-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 22px;
  border: none;
  background: var(--ep-orange);
  color: #fff;
  font-family: var(--ep-font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 2px 10px rgba(217, 37, 42, .35);
  white-space: nowrap;
}

.ep-art-play-btn:hover {
  background: var(--ep-orange-dark);
  transform: scale(1.04);
  box-shadow: 0 4px 16px rgba(217, 37, 42, .45);
}

.ep-art-play-btn.loading {
  opacity: .7;
  cursor: wait;
}

/* ── AI Tab bar (Voice+Play / Summarize / Share) ── */
.ep-ai-bar {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--ep-border);
  background: #f9fafb;
}

/* Voice + Play slot that lives inside the tab bar */
.ep-voice-tab-slot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  flex: 2;
  border-right: 1px solid var(--ep-border);
}

.ep-voice-tab-slot .ep-tts-voice-select {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 12px;
  font-family: var(--ep-font);
  background: #fff;
  color: #374151;
  cursor: pointer;
  outline: none;
}

.ep-voice-tab-slot .ep-tts-voice-select:focus {
  border-color: var(--ep-orange);
}

.ep-voice-tab-slot .ep-art-play-btn {
  padding: 7px 14px;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ep-ai-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  color: var(--ep-muted);
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: var(--ep-font);
  border-bottom: 2px solid transparent;
  transition: all .2s;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.ep-ai-tab:hover {
  color: var(--ep-text);
}

.ep-ai-tab.active {
  color: var(--ep-orange);
  border-bottom-color: var(--ep-orange);
}

.ep-ai-tab i {
  font-size: 17px;
}

.ep-ai-content {
  display: none;
  padding: 20px;
  background: #f9fafb;
  border-bottom: 1px solid var(--ep-border);
}

.ep-ai-content.active {
  display: block;
}

.ep-article-body {
  padding: 24px 28px 90px;
  max-width: 740px;
  margin: 0 auto;
}

.ep-article-category {
  font-size: 11px;
  font-weight: 800;
  color: var(--ep-orange);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 8px;
}

.ep-article-title {
  font-family: var(--ep-serif);
  font-size: clamp(26px, 5vw, 40px);
  font-weight: 900;
  line-height: 1.1;
  color: #0a0a0a;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.ep-article-date {
  font-size: 13px;
  color: var(--ep-muted);
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.ep-article-img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .1);
  display: block;
}

.ep-article-img+.ep-article-img-caption {
  display: block;
  font-family: var(--ep-font);
  font-size: 12px;
  color: #6b5e4e;
  font-style: italic;
  line-height: 1.4;
  margin: 0 0 18px;
  padding-top: 4px;
  border-bottom: 1px solid rgba(91, 72, 50, .15);
  padding-bottom: 6px;
}

.ep-article-text {
  font-family: var(--ep-serif);
  font-size: 18px;
  line-height: 1.9;
  color: #2b2621;
}

.ep-article-text p {
  margin-bottom: 16px;
}

.ep-article-text p:first-of-type::first-letter {
  font-size: 3.8em;
  float: left;
  line-height: 0.85;
  margin-right: 8px;
  margin-top: 6px;
  font-weight: 900;
  color: var(--ep-orange);
}

/* ── Article Gallery ── */
.ep-article-gallery-full {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin-bottom: 20px;
  border-radius: 10px;
  overflow: hidden;
}

.ep-article-gallery-full:has(> :only-child) {
  grid-template-columns: 1fr;
}

.ep-gallery-full-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  opacity: 0;
  transition: opacity .3s ease;
  background: #f3f4f6;
}

.ep-gallery-full-img.loaded {
  opacity: 1;
}

.ep-article-gallery-full:has(> :only-child) .ep-gallery-full-img {
  height: 280px;
  border-radius: 10px;
}

@media (max-width: 600px) {
  .ep-article-gallery-full {
    grid-template-columns: 1fr 1fr;
  }

  .ep-gallery-full-img {
    height: 140px;
  }

  .ep-article-gallery-full:has(> :only-child) .ep-gallery-full-img {
    height: 220px;
    border-radius: 8px;
  }
}

/* ── Voice Prompt Card ── */
.ep-tts-inline-prompt {
  background: #fef9f0;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ep-tts-prompt-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--ep-orange);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.ep-tts-prompt-text {
  flex: 1;
  min-width: 0;
}

.ep-tts-prompt-text strong {
  display: block;
  font-size: 13px;
  color: #1f2937;
  font-weight: 700;
}

.ep-tts-prompt-text span {
  font-size: 11px;
  color: #6b7280;
}

.ep-tts-voice-wrap {
  flex-shrink: 0;
}

.ep-tts-voice-select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 12px;
  font-family: var(--ep-font);
  background: #fff;
  color: #374151;
  cursor: pointer;
  outline: none;
  max-width: 160px;
}

.ep-tts-voice-select:focus {
  border-color: var(--ep-orange);
}

.ep-tts-prompt-btn {
  padding: 9px 20px;
  border-radius: 20px;
  border: none;
  background: var(--ep-orange);
  color: #fff;
  font-family: var(--ep-font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all .2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.ep-tts-prompt-btn:hover {
  background: var(--ep-orange-dark);
  transform: scale(1.04);
}

/* ── Compact Inline Voice Player ── */
.ep-inline-player {
  display: none;
  background: #111827;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .25);
}

.ep-inline-player.active {
  display: block;
}

/* Topbar style that mimics the first-image full-width player */
.ep-inline-player.topbar {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 6px 18px;
  background: linear-gradient(180deg, #0f1724, #07101a);
  box-shadow: 0 4px 30px rgba(0, 0, 0, .6);
  z-index: 9999;
  border-radius: 0;
}

.ep-inline-player.topbar .ep-inpl-progress {
  display: none;
}

.ep-inline-player.topbar .ep-inpl-controls {
  padding: 0;
  gap: 14px;
  width: 100%;
}

.ep-inline-player.topbar .ep-inpl-left {
  margin-left: 6px;
}

.ep-inline-player.topbar .ep-inpl-center {
  text-align: center;
}

.ep-inline-player.topbar .ep-inpl-right {
  margin-left: auto;
  margin-right: 6px;
}

.ep-inline-player.topbar .ep-inpl-title {
  color: #e6eef6;
  max-width: 420px;
}

.ep-inline-player.topbar .ep-inpl-waveform {
  display: none;
}

.ep-inline-player.topbar .ep-inpl-time {
  color: rgba(230, 238, 246, .7);
}

.ep-inline-player.topbar .ep-inpl-play {
  width: 44px;
  height: 44px;
}

.ep-inline-player.topbar .ep-inpl-dl,
.ep-inline-player.topbar .ep-inpl-close {
  width: 36px;
  height: 36px;
}

.ep-inpl-progress {
  position: relative;
  height: 5px;
  background: rgba(255, 255, 255, .15);
  cursor: pointer;
  transition: height .15s ease;
}

.ep-inpl-progress:hover {
  height: 7px;
}

.ep-inpl-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ep-orange), #ff9940);
  border-radius: 0 3px 3px 0;
  transition: width .25s linear;
  position: relative;
}

.ep-inpl-dot {
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--ep-orange);
  box-shadow: 0 0 6px rgba(217, 37, 42, .6);
  opacity: 0;
  transition: opacity .2s;
}

.ep-inline-player.active .ep-inpl-dot {
  opacity: 1;
}

.ep-inpl-controls {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  gap: 10px;
}

.ep-inpl-left,
.ep-inpl-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ep-inpl-play {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ep-orange);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  box-shadow: 0 2px 10px rgba(217, 37, 42, .4);
}

.ep-inpl-play:hover {
  background: var(--ep-orange-dark);
  transform: scale(1.08);
}

.ep-inpl-skip {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .09);
  color: rgba(255, 255, 255, .7);
  border: none;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  transition: all .2s;
  line-height: 1;
}

.ep-inpl-skip b {
  font-size: 7px;
  font-weight: 800;
  margin-top: -1px;
}

.ep-inpl-skip:hover {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.ep-inpl-center {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.ep-inpl-waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 18px;
  margin-bottom: 3px;
}

.ep-inpl-waveform span {
  width: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .25);
  height: 5px;
}

.ep-inline-player.playing .ep-inpl-waveform span {
  animation: epInplWave .55s ease-in-out infinite alternate;
  background: linear-gradient(180deg, #ff9940, var(--ep-orange));
}

.ep-inline-player.playing .ep-inpl-waveform span:nth-child(1) {
  animation-delay: 0s;
}

.ep-inline-player.playing .ep-inpl-waveform span:nth-child(2) {
  animation-delay: .07s;
}

.ep-inline-player.playing .ep-inpl-waveform span:nth-child(3) {
  animation-delay: .14s;
}

.ep-inline-player.playing .ep-inpl-waveform span:nth-child(4) {
  animation-delay: .21s;
}

.ep-inline-player.playing .ep-inpl-waveform span:nth-child(5) {
  animation-delay: .28s;
}

.ep-inline-player.playing .ep-inpl-waveform span:nth-child(6) {
  animation-delay: .35s;
}

.ep-inline-player.playing .ep-inpl-waveform span:nth-child(7) {
  animation-delay: .28s;
}

.ep-inline-player.playing .ep-inpl-waveform span:nth-child(8) {
  animation-delay: .21s;
}

.ep-inline-player.playing .ep-inpl-waveform span:nth-child(9) {
  animation-delay: .14s;
}

.ep-inline-player.playing .ep-inpl-waveform span:nth-child(10) {
  animation-delay: .07s;
}

@keyframes epInplWave {
  0% {
    height: 4px;
  }

  100% {
    height: 16px;
  }
}

.ep-inpl-times {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ep-inpl-time {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, .55);
  font-variant-numeric: tabular-nums;
  min-width: 30px;
}

.ep-inpl-title {
  font-size: 11px;
  color: rgba(255, 255, 255, .8);
  font-weight: 500;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ep-inpl-speed {
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .8);
  border: 1px solid rgba(255, 255, 255, .18);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--ep-font);
  transition: all .2s;
}

.ep-inpl-speed:hover {
  background: rgba(255, 255, 255, .2);
}

.ep-inpl-dl {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all .2s;
}

.ep-inpl-dl:hover {
  background: rgba(255, 255, 255, .2);
  color: #fff;
}

.ep-inpl-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .55);
  border: none;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}

.ep-inpl-close:hover {
  background: rgba(217, 37, 42, .35);
  color: #fff;
}

.ep-inline-player.loading .ep-inpl-play {
  background: #555;
  animation: epInplSpin .7s linear infinite;
}

@keyframes epInplSpin {
  to {
    transform: rotate(360deg);
  }
}

/* AI Summary */
.ep-summary-box {
  background: var(--ep-white);
  border-radius: 10px;
  padding: 18px;
  border: 1px solid var(--ep-border);
}

.ep-summary-box h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--ep-text);
}

.ep-summary-box ul {
  padding-left: 18px;
}

.ep-summary-box li {
  font-size: 14px;
  line-height: 1.7;
  color: #4b5563;
  margin-bottom: 8px;
}

.ep-summary-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ep-muted);
}

.ep-summary-loading .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--ep-border);
  border-top-color: var(--ep-orange);
  border-radius: 50%;
  animation: epSpin .8s linear infinite;
}

@keyframes epSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Translate */
.ep-translate-panel {
  background: var(--ep-white);
  border-radius: 10px;
  padding: 14px;
  border: 1px solid var(--ep-border);
}

.ep-translate-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--ep-border);
  border-radius: 7px;
  font-family: var(--ep-font);
  font-size: 13px;
  margin-bottom: 12px;
  outline: none;
}

.ep-translate-select:focus {
  border-color: var(--ep-orange);
}

.ep-translate-output {
  font-size: 15px;
  line-height: 1.8;
  color: var(--ep-text);
}

/* Share */
.ep-share-menu {
  background: var(--ep-white);
  border-radius: 10px;
  padding: 6px;
  border: 1px solid var(--ep-border);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ep-share-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ep-text);
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--ep-font);
  width: 100%;
  text-align: left;
  transition: background .15s;
}

.ep-share-item:hover {
  background: #f9fafb;
}

.ep-share-item i {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

/* WhatsApp FAB */
.ep-whatsapp-btn {
  position: fixed;
  bottom: 128px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 211, 102, .4);
  z-index: 190;
  transition: transform .2s;
  text-decoration: none;
}

.ep-whatsapp-btn:hover {
  transform: scale(1.1);
}

/* ── SKELETON / LOADING ─────────────────────────── */
.ep-skeleton {
  background: linear-gradient(90deg, #e5e5e5 25%, #f0f0f0 50%, #e5e5e5 75%);
  background-size: 200% 100%;
  animation: epShimmer 1.5s infinite;
  border-radius: 6px;
}

@keyframes epShimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ── TOAST ──────────────────────────────────────── */
.ep-toast {
  position: fixed;
  bottom: 182px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 15, 20, .95);
  color: #fff;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  z-index: 500;
  opacity: 0;
  transition: all .3s;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ep-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── VIDEO OVERLAY ──────────────────────────────── */
.ep-video-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .9);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.ep-video-overlay.open {
  display: flex;
}

.ep-video-wrap {
  position: relative;
  width: 90%;
  max-width: 900px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .6);
}

.ep-video-player {
  width: 100%;
  display: block;
  background: #000;
  border-radius: 10px;
}

.ep-video-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  border: none;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background .2s;
}

.ep-video-close:hover {
  background: var(--ep-orange);
}

.ep-hotspot.has-video::before {
  content: '\f04b';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  background: rgba(217, 37, 42, .9);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: 0 4px 14px rgba(217, 37, 42, .4);
  opacity: .8;
  transition: opacity .2s, transform .2s;
}

.ep-hotspot.has-video:hover::before {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

/* ── PUSH NOTIFICATION ──────────────────────────── */
.ep-push-prompt {
  position: fixed;
  bottom: 75px;
  right: 18px;
  background: var(--ep-white);
  border: 1px solid var(--ep-border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
  padding: 12px 14px;
  display: none;
  align-items: center;
  gap: 10px;
  z-index: 250;
}

.ep-push-prompt.open {
  display: flex;
}

.ep-push-prompt strong {
  font-size: 12px;
  color: var(--ep-text);
}

.ep-push-prompt button {
  border: none;
  background: var(--ep-orange);
  color: #fff;
  border-radius: 16px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.ep-push-prompt button:hover {
  background: var(--ep-orange-dark);
}

/* ══════════════════════════════════════════════════
   RESPONSIVE — full mobile-first overhaul
   1280 → 1100 → 900 → 768 → 600 → 480 → 360
   ══════════════════════════════════════════════════ */

@media (max-width: 1280px) {
  .ep-main {
    padding: 20px 20px 158px;
    gap: 16px;
  }

  .ep-news-sidebar {
    width: 240px;
  }
}

/* Sidebar hidden at 1100px — paper gets full width sooner */
@media (max-width: 1100px) {
  .ep-news-sidebar {
    display: none;
  }

  .ep-main {
    gap: 0;
    justify-content: center;
    padding: 16px 16px 158px;
  }
}

@media (max-width: 900px) {
  .ep-toolbar {
    right: 4px;
  }

  .ep-side-nav {
    display: none;
  }

  .ep-main {
    padding: 12px 8px 158px;
  }
}

/* ── 768px: tablet / large phone ── */
@media (max-width: 768px) {

  /* Layout */
  .ep-main {
    padding: 0 0 148px;
  }

  .ep-paper {
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .4);
  }

  .ep-paper::before {
    display: none;
  }

  .ep-viewer {
    padding: 8px 4px 48px;
  }

  .ep-masthead {
    padding: 6px 0 0;
  }

  .ep-masthead-img {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  /* Nav */
  .ep-date-btn span {
    display: none;
  }

  .ep-date-btn {
    padding: 0 12px;
  }

  .ep-nav-item {
    padding: 0 10px;
    font-size: 10px;
  }

  .ep-side-nav {
    display: none;
  }

  /* Toolbar — move to bottom-right above thumb strip */
  .ep-toolbar {
    right: 6px;
    top: auto;
    bottom: 148px;
    transform: none;
  }

  .ep-tool-btn {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  /* Pager — bigger touch targets */
  .ep-pager {
    bottom: 126px;
    padding: 6px 14px;
    gap: 8px;
  }

  .ep-pager-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .ep-pager-info {
    min-width: 48px;
    font-size: 11px;
  }

  /* Thumb strip */
  .ep-thumb-strip {
    height: 116px;
  }

  .ep-thumb-card {
    width: 88px;
  }

  .ep-thumb-img,
  .ep-thumb-placeholder {
    height: 90px;
  }

  /* WhatsApp FAB */
  .ep-whatsapp-btn {
    bottom: 124px;
  }

  /* Article panel */
  .ep-article-body {
    padding: 16px 16px 90px;
    max-width: 100%;
  }

  .ep-article-title {
    font-size: 20px;
  }

  .ep-article-text {
    font-size: 15px;
    line-height: 1.75;
  }

  /* AI bar — voice row full-width, then tabs */
  .ep-ai-bar {
    flex-wrap: wrap;
  }

  .ep-voice-tab-slot {
    flex: 0 0 100%;
    border-right: none;
    border-bottom: 1px solid var(--ep-border);
    padding: 8px 10px;
  }

  .ep-ai-tab {
    font-size: 10px;
    padding: 9px 6px;
  }

  .ep-ai-tab i {
    font-size: 15px;
  }

  /* Inline player */
  .ep-inpl-controls {
    gap: 6px;
    padding: 6px 10px;
  }

  .ep-inpl-title {
    max-width: 80px;
    font-size: 11px;
  }

  .ep-inpl-speed .ep-inpl-dur,
  .ep-inpl-dl .ep-inpl-dur,
  .ep-inpl-close .ep-inpl-dur {
    display: none;
  }

  /* Calendar — narrower, lower padding-top */
  .ep-calendar-overlay {
    padding-top: 80px;
    align-items: flex-start;
  }

  .ep-calendar {
    width: 92vw;
    max-width: 340px;
    padding: 18px;
  }

  .ep-cal-day {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  /* Hotspot tooltip */
  .ep-hotspot::after {
    max-width: 72vw;
    font-size: 11px;
  }

  /* Toast above pager */
  .ep-toast {
    bottom: 168px;
  }

  /* Section header */
  .ep-section-header {
    padding: 10px 14px;
  }

  .ep-section-num {
    font-size: 22px;
  }

  .ep-section-cat {
    font-size: 13px;
  }

  /* Article topbar */
  .ep-article-topbar {
    min-height: 52px;
  }

  .ep-article-back {
    padding: 14px 16px;
    font-size: 13px;
  }

  .ep-art-play-btn {
    padding: 8px 14px;
    font-size: 13px;
  }
}

/* ── 600px: small tablet / large phone ── */
@media (max-width: 600px) {
  .ep-section-header {
    padding: 8px 12px;
    gap: 10px;
  }

  .ep-section-num {
    font-size: 18px;
  }

  .ep-section-cat {
    font-size: 11px;
    letter-spacing: 0.3px;
  }

  .ep-article-body {
    padding: 14px 14px 90px;
  }

  .ep-article-title {
    font-size: 18px;
  }

  .ep-article-text {
    font-size: 14px;
  }

  /* Summary box */
  .ep-summary-box {
    padding: 12px 14px;
  }

  /* New edition banner */
  .ep-new-edition-banner {
    font-size: 12px;
    padding: 10px 14px;
    gap: 8px;
    white-space: normal;
    max-width: 92vw;
    bottom: 168px;
  }

  /* Push prompt */
  .ep-push-prompt {
    right: 8px;
    left: 8px;
    bottom: 168px;
  }
}

/* ── 480px: mobile phones ── */
@media (max-width: 480px) {

  /* Nav */
  .ep-date-btn {
    padding: 0 10px;
    gap: 5px;
    font-size: 10px;
  }

  .ep-nav-item {
    padding: 0 8px;
    font-size: 10px;
  }

  .ep-nav-scroll-btn {
    width: 20px;
  }

  /* Toolbar */
  .ep-toolbar {
    right: 4px;
    bottom: 144px;
  }

  .ep-tool-btn {
    width: 38px;
    height: 38px;
    font-size: 13px;
  }

  /* Pager */
  .ep-pager {
    bottom: 122px;
    padding: 5px 12px;
    gap: 7px;
  }

  .ep-pager-btn {
    width: 38px;
    height: 38px;
  }

  /* Thumb strip */
  .ep-thumb-strip {
    height: 110px;
  }

  .ep-thumb-card {
    width: 72px;
  }

  .ep-thumb-img,
  .ep-thumb-placeholder {
    height: 76px;
  }

  /* WhatsApp */
  .ep-whatsapp-btn {
    bottom: 120px;
  }

  /* Article */
  .ep-article-body {
    padding: 12px 12px 90px;
  }

  .ep-article-title {
    font-size: 17px;
  }

  .ep-article-text {
    font-size: 14px;
  }

  .ep-article-date {
    font-size: 11px;
  }

  /* Calendar fits screen */
  .ep-calendar-overlay {
    padding-top: 60px;
  }

  .ep-calendar {
    width: 96vw;
    padding: 14px 12px;
  }

  .ep-cal-day {
    width: 34px;
    height: 34px;
    font-size: 12px;
  }

  .ep-cal-day-name {
    font-size: 9px;
  }

  /* AI bar voice select */
  .ep-voice-tab-slot {
    gap: 6px;
    padding: 6px 8px;
  }

  .ep-voice-tab-slot .ep-tts-voice-select {
    font-size: 11px;
  }

  .ep-voice-tab-slot .ep-art-play-btn {
    padding: 7px 10px;
    font-size: 12px;
  }

  .ep-ai-tab {
    font-size: 9px;
    padding: 8px 4px;
  }

  .ep-ai-tab i {
    font-size: 14px;
  }

  /* Inline player */
  .ep-inpl-title {
    max-width: 60px;
    font-size: 10px;
  }

  /* Toast */
  .ep-toast {
    bottom: 162px;
    font-size: 12px;
    padding: 8px 14px;
  }

  /* Hotspot */
  .ep-hotspot::after {
    max-width: 80vw;
    font-size: 10px;
    padding: 6px 8px;
  }

  /* Article gallery */
  .ep-article-gallery-full {
    gap: 4px;
  }

  /* Share items */
  .ep-share-item {
    padding: 8px 10px;
    font-size: 12px;
  }

  /* Section header */
  .ep-section-num {
    font-size: 16px;
  }

  .ep-section-cat {
    font-size: 10px;
  }
}

/* ── 360px: small phones (Samsung Galaxy A series, etc.) ── */
@media (max-width: 360px) {
  .ep-date-btn {
    padding: 0 8px;
  }

  .ep-nav-item {
    padding: 0 5px;
    font-size: 9px;
    letter-spacing: 0.3px;
  }

  .ep-toolbar {
    right: 2px;
  }

  .ep-tool-btn {
    width: 36px;
    height: 36px;
    font-size: 12px;
  }

  .ep-thumb-card {
    width: 62px;
  }

  .ep-thumb-img,
  .ep-thumb-placeholder {
    height: 66px;
  }

  .ep-article-body {
    padding: 10px 10px 90px;
  }

  .ep-article-title {
    font-size: 15px;
  }

  .ep-article-text {
    font-size: 13px;
  }

  .ep-cal-day {
    width: 30px;
    height: 30px;
    font-size: 11px;
  }

  .ep-cal-day-name {
    font-size: 8px;
  }

  .ep-ai-tab span {
    display: none;
  }

  .ep-ai-tab {
    padding: 10px 6px;
  }

  .ep-voice-tab-slot .ep-art-play-btn span {
    display: none;
  }
}


/* ── New edition banner ── */
.ep-new-edition-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1e293b;
  color: #fff;
  border-radius: 40px;
  padding: 12px 18px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .35);
  z-index: 9999;
  font-size: 14px;
  white-space: nowrap;
  animation: epBannerIn .3s ease;
}

@keyframes epBannerIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.ep-neb-icon {
  font-size: 18px;
}

.ep-neb-load {
  background: #ff6600;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
}

.ep-neb-load:hover {
  background: #e05500;
}

.ep-neb-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, .5);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 4px;
  line-height: 1;
}

.ep-neb-close:hover {
  color: #fff;
}

@media (max-width: 600px) {
  .ep-new-edition-banner {
    font-size: 12px;
    padding: 10px 14px;
    gap: 8px;
    white-space: normal;
    max-width: 90vw;
  }
}

/* ── Sentence highlight while TTS plays ── */
.ep-tts-sentence {
  border-radius: 3px;
  padding: 1px 2px;
  transition: background .2s, color .2s;
}

.ep-tts-sentence.ep-tts-active {
  background: #fff3c4;
  color: #111;
  box-shadow: 0 0 0 2px #fbbf24;
}

/* ── EP-READER-CONTAINER & FULLSCREEN STYLES ── */
.ep-reader-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  max-width: 920px;
  position: relative;
}

/* Immersive native fullscreen state */
.ep-reader-container:fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  background: var(--ep-desk) !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  overflow: hidden !important;
}

.ep-reader-container:fullscreen .ep-paper {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.ep-reader-container:fullscreen .ep-viewer {
  max-height: calc(100vh - 72px - 53px) !important;
  height: 100% !important;
}

/* Custom scrolling paper-viewer-container */
.paper-viewer-container {
  overflow: auto !important;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

/* Crisp & smooth paper scaling transitions */
.ep-page-container,
.ep-block-grid {
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center top;
  margin: 0 auto;
}

/* ── Share Toolbar Menu ── */
.ep-share-container {
  position: relative;
  display: block;
  width: var(--ep-toolbar-w);
  height: var(--ep-toolbar-w);
}

.ep-share-dropdown {
  position: absolute;
  right: calc(100% + 6px); /* Pop out to the left of the button */
  top: 50%;
  transform: translateY(-50%) scale(0.9);
  background: rgba(20, 20, 24, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 150px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 99999;
}

.ep-share-dropdown.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

.ep-share-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  width: 100%;
}

.ep-share-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.ep-share-dropdown-item i {
  width: 16px;
  text-align: center;
}

/* ── PDF Generation Progress Loader ── */
#epPdfLoader {
  transition: opacity 0.3s ease;
}

@keyframes epSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════════════
   MOBILE UX IMPROVEMENTS
   ══════════════════════════════════════════════════ */

/* Disable iOS double-tap browser zoom on the viewer — we handle it in JS */
.ep-viewer {
  touch-action: manipulation;
}

/* Page image fade-in when loading */
.ep-page-img {
  transition: opacity 0.12s ease;
}

/* ── Swipe hint (first visit, mobile only) ── */
.ep-swipe-hint {
  display: none;
  position: absolute;
  bottom: 158px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.65);
  color: rgba(255, 255, 255, 0.9);
  padding: 7px 18px;
  border-radius: 24px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  z-index: 50;
  letter-spacing: 0.3px;
  gap: 7px;
  align-items: center;
}

.ep-swipe-hint i {
  font-size: 13px;
  opacity: 0.8;
}

.ep-swipe-hint.ep-swipe-hint-visible {
  display: flex;
  animation: ep-hint-fade 2.8s ease forwards;
}

@keyframes ep-hint-fade {
  0%   { opacity: 0; transform: translateX(-50%) translateY(6px); }
  15%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  70%  { opacity: 1; }
  100% { opacity: 0; }
}

@media (max-width: 768px) {
  /* Larger touch targets for thumb strip navigation */
  .ep-thumb-nav-btn {
    min-width: 36px;
    padding: 0 10px;
  }

  /* Page image takes full available width on mobile */
  .ep-page-container {
    width: 100%;
  }

  /* Pager buttons easier to tap */
  .ep-pager-btn {
    min-width: 44px;
    min-height: 44px;
  }
}