/* ══════════════════════════════════════════════════
   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-red: #d9252a;
  --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: 0 1 auto;            /* size to content so the group stays compact & centred */
  -ms-overflow-style: none;
  justify-content: center;
}

/* Centre the date button + language tabs together in the middle of the header
   so both are easy to find. The views badge is pinned to the far right, out of
   flow, so it doesn't shift the centring. */
.ep-nav { justify-content: center; }
.ep-nav .ep-views-badge {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
}

.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);
}

body.epaper-body:not(.ep-edition-open) #epViews,
body.epaper-body:not(.ep-edition-open) #epNavLeft,
body.epaper-body:not(.ep-edition-open) #epNavRight,
body.epaper-body:not(.ep-edition-open) #epNavList,
body.epaper-body:not(.ep-edition-open) .ep-side-nav,
body.epaper-body:not(.ep-edition-open) .ep-toolbar,
body.epaper-body:not(.ep-edition-open) .ep-pager,
body.epaper-body:not(.ep-edition-open) .ep-thumb-strip {
  display: none !important;
}

/* ── 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);
}

@media (min-width: 1101px) {
  body.epaper-body.ep-edition-open .ep-main {
    display: grid;
    grid-template-columns: 280px minmax(0, 920px) 280px;
    justify-content: center;
    align-items: flex-start;
  }

  body.epaper-body.ep-edition-open .ep-news-sidebar {
    grid-column: 1;
  }

  body.epaper-body.ep-edition-open .ep-reader-container {
    grid-column: 2;
    width: min(920px, 100%);
    max-width: 920px;
    justify-self: center;
  }

  body.epaper-body.ep-edition-open .ep-main.news-sidebar-collapsed {
    grid-template-columns: minmax(0, 920px);
  }

  body.epaper-body.ep-edition-open .ep-main.news-sidebar-collapsed .ep-reader-container {
    grid-column: 1;
  }
}

/* ── 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-main.news-sidebar-collapsed .ep-news-sidebar {
  display: none;
}

.ep-main.news-sidebar-collapsed .ep-news-sidebar-reopen {
  display: inline-flex;
}

.ep-main.news-sidebar-collapsed .ep-reader-container {
  max-width: none;
}

.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;
  justify-content: space-between;
  gap: 12px;
  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-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.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-sidebar-close {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.78);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s ease;
  flex-shrink: 0;
}

.ep-news-sidebar-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

.ep-news-sidebar-reopen {
  display: none;
  position: fixed;
  left: 16px;
  top: calc(var(--ep-nav-h) + 96px);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  gap: 10px;
  padding: 14px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(14, 17, 24, 0.94);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
  z-index: 20;
}

body.epaper-body:not(.ep-edition-open) .ep-news-sidebar-reopen {
  top: calc(var(--ep-nav-h) + 128px);
}

.ep-news-sidebar-reopen i {
  color: var(--ep-red);
  transform: rotate(90deg);
}

.ep-news-sidebar-reopen span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.ep-news-sidebar-reopen:hover {
  background: rgba(24, 29, 38, 0.98);
}

.ep-edition-landing {
  display: none;
  color: #fff;
}

body.epaper-body:not(.ep-edition-open) .ep-edition-landing {
  display: block;
}

body.epaper-body:not(.ep-edition-open) .ep-reader-container {
  align-items: stretch;
  max-width: 1120px;
}

body.epaper-body:not(.ep-edition-open) .ep-paper {
  display: none;
}

.ep-edition-landing-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 26px;
}

.ep-edition-landing-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: #f87171;
  margin-bottom: 8px;
}

.ep-edition-landing-header h2 {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
  max-width: 440px;
}

.ep-edition-landing-copy {
  max-width: 340px;
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.72);
}

.ep-edition-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.ep-edition-filter-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.ep-edition-filter-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.08);
}

.ep-edition-filter-btn.active {
  background: #fff;
  color: #111827;
  border-color: #fff;
}

.ep-edition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
}

.ep-edition-card,
.ep-edition-card-skeleton {
  border-radius: 17px;
  overflow: hidden;
  background: #f9f9f7;
  border: 1px solid rgba(15, 23, 42, 0.07);
}

.ep-edition-card {
  position: relative;
  padding: 0;
  text-align: center;
  cursor: pointer;
  isolation: isolate;
  background: #f9f9f7;
  transition:
    transform 300ms ease,
    box-shadow 300ms ease,
    border-color 300ms ease;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 6px 18px rgba(15, 23, 42, 0.08);
}

.ep-edition-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 255, 255, 0.1) 30%,
    transparent 55%
  );
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
  z-index: 3;
}

.ep-edition-card:hover {
  transform: translateY(-8px);
  border-color: rgba(217, 37, 42, 0.24);
  box-shadow:
    0 10px 20px rgba(15, 23, 42, 0.1),
    0 24px 48px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(217, 37, 42, 0.1),
    0 0 32px rgba(217, 37, 42, 0.16);
}

.ep-edition-card:hover::before {
  opacity: 1;
}

.ep-edition-card:active {
  transform: translateY(-4px);
  transition-duration: 120ms;
}

.ep-edition-card:focus-visible {
  outline: 2px solid var(--ep-orange);
  outline-offset: 3px;
}

.ep-edition-card-cover {
  position: relative;
  aspect-ratio: 0.78;
  background: linear-gradient(180deg, #f5f5f3 0%, #ececea 100%);
  padding: 12px 12px 0;
  display: block;
  overflow: hidden;
}

.ep-edition-card-cover::after {
  content: "";
  position: absolute;
  top: -20%;
  left: -120%;
  width: 55%;
  height: 140%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 35%,
    rgba(255, 255, 255, 0.65) 50%,
    rgba(255, 255, 255, 0.1) 65%,
    transparent 100%
  );
  transform: skewX(-18deg);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
}

.ep-edition-card:hover .ep-edition-card-cover::after {
  animation: epCardMirrorShine 300ms ease forwards;
  opacity: 1;
}

@keyframes epCardMirrorShine {
  0%   { left: -120%; opacity: 0; }
  20%  { opacity: 1; }
  100% { left: 140%; opacity: 0; }
}

.ep-edition-card-cover.has-image {
  background-size: cover;
  background-position: center;
}

.ep-edition-card-top {
  display: none;
}

.ep-edition-card-badge {
  display: none;
}

.ep-edition-card-date {
  display: none;
}

.ep-edition-card-brand {
  display: none;
}

.ep-edition-card-preview-frame {
  position: relative;
  background: #23272f;
  padding: 12px;
  overflow: hidden;
  border-radius: 4px 4px 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.ep-edition-card-preview {
  display: block;
  width: 100%;
  aspect-ratio: 0.78;
  object-fit: contain;
  object-position: top center;
  background: #ffffff;
  border: 1px solid #dbe2ea;
  transform: scale(1);
  transition: transform 300ms ease;
}

.ep-edition-card:hover .ep-edition-card-preview {
  transform: scale(1.03);
}

.ep-edition-card-preview-placeholder {
  width: 100%;
  aspect-ratio: 0.78;
  border: 1px solid #dbe2ea;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(246,248,252,0.98)),
    repeating-linear-gradient(
      to bottom,
      rgba(37, 99, 235, 0.1) 0 24px,
      rgba(255,255,255,1) 24px 48px
    );
  position: relative;
  transform: scale(1);
  transition: transform 300ms ease;
}

.ep-edition-card:hover .ep-edition-card-preview-placeholder {
  transform: scale(1.03);
}

.ep-edition-card-preview-placeholder::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  height: 26px;
  background: linear-gradient(90deg, #24438f 0 58%, #e5524c 58% 76%, #ffffff 76% 100%);
  border-radius: 2px;
}

.ep-edition-card-preview-placeholder::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 62px;
  bottom: 18px;
  background:
    linear-gradient(#d9e8f9 0 38%, transparent 38% 42%, #fae1d8 42% 100%);
  opacity: 0.9;
}

.ep-edition-card-body {
  position: relative;
  z-index: 1;
  padding: 14px 16px 16px;
  color: #111827;
  background: #f9f9f7;
  transition: background 300ms ease;
}

.ep-edition-card:hover .ep-edition-card-body {
  background: #fcfaf8;
}

.ep-edition-card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
  color: #23324b;
  transition: color 300ms ease;
}

.ep-edition-card:hover .ep-edition-card-title {
  color: var(--ep-orange-dark);
}

.ep-edition-card-subtitle {
  font-size: 14px;
  color: #7b8798;
  margin-bottom: 10px;
  transition: color 300ms ease;
}

.ep-edition-card:hover .ep-edition-card-subtitle {
  color: #5b6778;
}

.ep-edition-card-language {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: #475569;
  background: rgba(15, 23, 42, 0.06);
  transition: transform 300ms ease, box-shadow 300ms ease, background 300ms ease, color 300ms ease, border-color 300ms ease;
}

.ep-edition-card:hover .ep-edition-card-language {
  transform: translateY(-1px);
}

/* English — class, data-lang, and parent data-language fallbacks */
.ep-edition-card-language.ep-lang-english,
.ep-edition-card-language[data-lang="english"],
.ep-edition-card[data-language="English"] .ep-edition-card-language {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.14);
  border-color: rgba(37, 99, 235, 0.28);
}

.ep-edition-card:hover .ep-edition-card-language.ep-lang-english,
.ep-edition-card:hover .ep-edition-card-language[data-lang="english"],
.ep-edition-card[data-language="English"]:hover .ep-edition-card-language {
  background: rgba(37, 99, 235, 0.2);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.18);
}

/* Hindi */
.ep-edition-card-language.ep-lang-hindi,
.ep-edition-card-language[data-lang="hindi"],
.ep-edition-card[data-language="Hindi"] .ep-edition-card-language {
  color: #c2410c;
  background: rgba(234, 88, 12, 0.14);
  border-color: rgba(234, 88, 12, 0.3);
}

.ep-edition-card:hover .ep-edition-card-language.ep-lang-hindi,
.ep-edition-card:hover .ep-edition-card-language[data-lang="hindi"],
.ep-edition-card[data-language="Hindi"]:hover .ep-edition-card-language {
  background: rgba(234, 88, 12, 0.2);
  box-shadow: 0 2px 10px rgba(234, 88, 12, 0.18);
}

/* Marathi */
.ep-edition-card-language.ep-lang-marathi,
.ep-edition-card-language[data-lang="marathi"],
.ep-edition-card[data-language="Marathi"] .ep-edition-card-language {
  color: #15803d;
  background: rgba(22, 163, 74, 0.14);
  border-color: rgba(22, 163, 74, 0.28);
}

.ep-edition-card:hover .ep-edition-card-language.ep-lang-marathi,
.ep-edition-card:hover .ep-edition-card-language[data-lang="marathi"],
.ep-edition-card[data-language="Marathi"]:hover .ep-edition-card-language {
  background: rgba(22, 163, 74, 0.2);
  box-shadow: 0 2px 10px rgba(22, 163, 74, 0.18);
}

.ep-edition-card-language.ep-lang-default,
.ep-edition-card-language[data-lang="edition"] {
  color: #475569;
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.1);
}

.ep-edition-card:hover .ep-edition-card-language.ep-lang-default {
  background: rgba(217, 37, 42, 0.08);
  border-color: rgba(217, 37, 42, 0.18);
  color: var(--ep-orange-dark);
}

/* Ensure badge colors win inside <button> cards */
button.ep-edition-card .ep-edition-card-language {
  -webkit-appearance: none;
  appearance: none;
}

.ep-edition-card-skeleton {
  min-height: 430px;
  background: #f9f9f7;
  position: relative;
}

.ep-edition-card-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.18), transparent);
  transform: translateX(-100%);
  animation: epLandingShimmer 1.5s infinite;
}

@media (prefers-reduced-motion: reduce) {
  .ep-edition-card,
  .ep-edition-card-preview,
  .ep-edition-card-preview-placeholder,
  .ep-edition-card-body,
  .ep-edition-card-title,
  .ep-edition-card-subtitle,
  .ep-edition-card-language {
    transition: none;
  }

  .ep-edition-card:hover {
    transform: none;
  }

  .ep-edition-card:hover .ep-edition-card-preview,
  .ep-edition-card:hover .ep-edition-card-preview-placeholder {
    transform: none;
  }

  .ep-edition-card-cover::after {
    animation: none !important;
    display: none;
  }
}

.ep-edition-empty {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  line-height: 1.7;
}

.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: 920px;
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  align-self: center;
  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-toolbar {
  top: 50%;
}

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 {
  display: none;
}

body.epaper-body:not(.has-masthead) .ep-masthead {
  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;
  overflow-anchor: 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: '\f1ea  ' attr(title);
  font-family: 'FontAwesome', 'Font Awesome 5 Free', var(--ep-font-sans, sans-serif);
  font-weight: 900;
  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: calc(50% + 48px);
  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;
  font-weight: 700;
}

.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);
  position: relative;
}

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

/* Close / minimise button for the Translate & Summarize panels */
.ep-ai-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: background 0.15s, color 0.15s;
}

.ep-ai-close:hover {
  background: rgba(0, 0, 0, 0.12);
  color: #111;
}

.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;
  }

  body.epaper-body.ep-edition-open .ep-main {
    grid-template-columns: 240px minmax(0, 920px) 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;
  align-items: center;
  min-width: 0;
  max-width: none;
  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;
  align-items: stretch;
  justify-content: flex-start;
  overflow-anchor: none;
}

.ep-reader-container:fullscreen .ep-page-container,
.ep-reader-container:fullscreen .ep-block-grid {
  margin-left: 0;
  margin-right: 0;
}

/* 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 epLandingShimmer {
  100% { transform: translateX(100%); }
}

@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) {
  .ep-edition-landing-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .ep-edition-landing-copy {
    max-width: none;
  }

  .ep-news-sidebar-reopen {
    padding: 12px 8px;
    border-radius: 12px;
  }

  /* 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;
  }
}

/* ══════════════════════════════════════════════════
   RESPONSIVE OVERLAY FIX
   Prevents toolbar, pager, thumbnail strip and other
   floating controls from overlapping the newspaper
   content on mobile and tablet devices.

   Strategy:
   - ≤900px  → fixed controls become inline-flow
               elements inside .ep-reader-container,
               reordered via CSS `order` so toolbar
               sits above the paper and pager/thumbs
               sit below it.
   - 901–1100px → right padding added to .ep-main
               so the fixed right-side toolbar does
               not overlap the paper edge.

   All selectors use body.epaper-body.ep-edition-open
   for higher specificity, ensuring they override the
   existing media-query rules above without !important.
   ══════════════════════════════════════════════════ */

/* ── 901–1100px: Right clearance for fixed toolbar ─ */
@media (min-width: 901px) and (max-width: 1100px) {
  body.epaper-body.ep-edition-open .ep-main {
    padding-right: 64px;
  }
}

/* ── ≤900px: All controls inline ───────────────── */
@media (max-width: 900px) {

  /* ── Toolbar → horizontal bar above paper ── */
  body.epaper-body.ep-edition-open .ep-toolbar {
    position: relative;
    right: auto;
    top: auto;
    bottom: auto;
    transform: none;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    order: -1;
    background: #14141a;
    border-radius: 0;
    padding: 8px 12px;
    gap: 6px;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  }

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

  /* Dividers rotate to vertical separators in the row */
  body.epaper-body.ep-edition-open .ep-tool-divider {
    width: 1px;
    height: 24px;
    margin: 0 2px;
    background: rgba(255, 255, 255, 0.12);
  }

  /* Share dropdown pops downward in horizontal toolbar */
  body.epaper-body.ep-edition-open .ep-share-container {
    width: auto;
    height: auto;
  }

  body.epaper-body.ep-edition-open .ep-share-dropdown {
    right: 0;
    left: auto;
    top: calc(100% + 8px);
    transform: translateY(0) scale(0.92);
  }

  body.epaper-body.ep-edition-open .ep-share-dropdown.show {
    transform: translateY(0) scale(1);
  }

  /* ── Pager → inline below paper ── */
  body.epaper-body.ep-edition-open .ep-pager {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    width: auto;
    align-self: center;
    margin: 12px auto;
    order: 1;
  }

  /* ── Thumbnail strip → inline below pager ── */
  body.epaper-body.ep-edition-open .ep-thumb-strip {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    order: 2;
  }

  /* ── Main area: remove fixed-element bottom padding ── */
  body.epaper-body.ep-edition-open .ep-main {
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 16px;
  }

  /* ── Mobile full-bleed paper stage ── */
  body.epaper-body.ep-edition-open .ep-reader-container {
    align-items: stretch;
    width: 100%;
  }

  body.epaper-body.ep-edition-open .ep-paper {
    width: 100%;
    max-width: none;
    align-self: stretch;
    margin: 0;
    order: 0;
  }

  body.epaper-body.ep-edition-open .ep-viewer,
  body.epaper-body.ep-edition-open .paper-viewer-container {
    width: 100%;
    height: auto;
    min-height: 0;
    flex: 0 1 auto;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 8px;
    justify-content: flex-start;
    align-items: stretch;
  }

  body.epaper-body.ep-edition-open .ep-page-container,
  body.epaper-body.ep-edition-open .ep-block-grid {
    width: 100%;
    max-width: none;
    margin: 0;
  }

  body.epaper-body.ep-edition-open .ep-page-img {
    width: 100%;
    height: auto;
    display: block;
  }

  body.epaper-body.ep-edition-open .ep-masthead {
    padding-left: 0;
    padding-right: 0;
  }

  body.epaper-body.ep-edition-open .ep-masthead-img {
    border-left: none;
    border-right: none;
    border-radius: 0;
  }

  body.epaper-body.ep-edition-open .ep-paper-footer {
    padding-left: 12px;
    padding-right: 12px;
  }

  /* ── WhatsApp FAB: clear of inline controls ── */
  body.epaper-body.ep-edition-open .ep-whatsapp-btn {
    bottom: 16px;
    right: 16px;
  }

  /* ── Toast: reposition near bottom ── */
  body.epaper-body.ep-edition-open .ep-toast {
    bottom: 70px;
  }

  /* ── Swipe hint: adjust for inline layout ── */
  body.epaper-body.ep-edition-open .ep-swipe-hint {
    bottom: 20px;
  }

  /* ── Fullscreen: paper fills remaining space ── */
  body.epaper-body.ep-fullscreen .ep-viewer {
    max-height: none;
  }

  .ep-reader-container:fullscreen .ep-paper {
    flex: 1 1 auto;
    min-height: 0;
    height: auto !important;
  }

  .ep-reader-container:fullscreen .ep-viewer {
    flex: 1;
    max-height: none !important;
    height: auto !important;
  }

  .ep-reader-container:fullscreen .ep-thumb-strip {
    height: 80px;
  }
}

/* ── ≤480px: Compact mobile ────────────────────── */
@media (max-width: 480px) {
  body.epaper-body.ep-edition-open .ep-toolbar {
    padding: 6px 8px;
    gap: 3px;
  }

  body.epaper-body.ep-edition-open .ep-tool-btn {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  body.epaper-body.ep-edition-open .ep-tool-divider {
    height: 20px;
  }

  body.epaper-body.ep-edition-open .ep-pager {
    margin: 8px auto;
  }

  body.epaper-body.ep-edition-open .ep-thumb-strip {
    height: 100px;
  }
}

/* ── ≤360px: Small phones ──────────────────────── */
@media (max-width: 360px) {
  body.epaper-body.ep-edition-open .ep-toolbar {
    padding: 4px 6px;
    gap: 2px;
  }

  body.epaper-body.ep-edition-open .ep-tool-btn {
    width: 32px;
    height: 32px;
    font-size: 11px;
    border-radius: 6px;
  }

  body.epaper-body.ep-edition-open .ep-tool-divider {
    height: 16px;
  }

  body.epaper-body.ep-edition-open .ep-pager {
    padding: 4px 10px;
    gap: 6px;
  }

  body.epaper-body.ep-edition-open .ep-pager-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
  }
}