/* ==========================================================================
   Horizontal 3D Side-Flip Article Reader Styles
   Simulates 3D book page leaf turn on the Y-axis (side flip)
   ========================================================================== */

body.detail-open #nav,
body.detail-open .nav {
  display: none !important;
}

body.detail-open #main {
  height: 100dvh !important;
  padding-bottom: 0 !important;
}

.nh-side-flip-reader {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 600px;
  margin: auto;
  overflow: hidden;
  background: var(--paper, #fff);
  perspective: 1800px;
  perspective-origin: 50% 50%;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  isolation: isolate;
  color: var(--ink, #171717);
  display: flex;
  flex-direction: column;
}

body.dark .nh-side-flip-reader {
  background: #121212;
  color: #f1f3f7;
}

.nh-side-flip-live {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--paper, #fff);
  touch-action: pan-y;
}

body.dark .nh-side-flip-live {
  background: #121212;
}

/* Header */
.dh-detail-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  min-height: 52px;
  padding: 4px 10px 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.52) 0%, rgba(0, 0, 0, 0.2) 65%, rgba(0, 0, 0, 0) 100%);
  border-bottom: 0;
  pointer-events: none;
}

body.dark .dh-detail-nav {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.52) 0%, rgba(0, 0, 0, 0.2) 65%, rgba(0, 0, 0, 0) 100%);
  border-bottom-color: transparent;
}

.dh-detail-center-header {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  min-width: 0;
}

.dh-detail-cat-name {
  font: 800 13px/1 Arial, sans-serif;
  letter-spacing: -0.2px;
  text-transform: uppercase;
  color: var(--ink, #111);
}

body.dark .dh-detail-cat-name {
  color: #f0f2f5;
}

/* Dots Indicator */
.dh-pager-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 10px;
  margin-top: 3px;
}

.dh-pager-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: all 0.2s ease;
  display: inline-block;
}

body.dark .dh-pager-dot {
  background: #374151;
}

.dh-pager-dot.active {
  width: 7px;
  height: 7px;
  background: #ed153b !important;
  box-shadow: 0 0 5px rgba(237, 21, 59, 0.6);
}

.dh-pager-dot.edge {
  width: 3.5px;
  height: 3.5px;
  opacity: 0.6;
}

/* 3D Side-Flip Motion Layers */
.nh-side-flip-motion {
  position: absolute;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  perspective: 1800px;
  perspective-origin: 50% 50%;
  transform-style: preserve-3d;
  overflow: hidden;
}

.nh-side-flip-base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--paper, #fff);
}

body.dark .nh-side-flip-base {
  background: #121212;
}

.nh-side-flip-leaf {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
  z-index: 5;
  transform-origin: left center;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.25);
}

.nh-side-flip-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  background: var(--paper, #fff);
}

body.dark .nh-side-flip-face {
  background: #121212;
}

.nh-side-flip-back {
  transform: rotateY(180deg);
}

.nh-side-flip-scroll {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.nh-side-flip-motion .nh-side-flip-scroll,
.nh-side-flip-motion .dh-detail-content {
  overflow: hidden !important;
  pointer-events: none;
}

.nh-side-flip-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.05));
  opacity: 0;
  pointer-events: none;
  z-index: 99;
}

.nh-side-flip-base-shade {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
}

.is-side-flipping .nh-side-flip-live {
  pointer-events: none;
}

/* Split the viewport into two pages; turning a full-width leaf hid the flip offscreen. */
.nh-side-flip-motion { overflow:visible; perspective:1200px; transform-style:flat; }
.nh-side-flip-still { position:absolute; inset:0; overflow:hidden; }
.nh-side-flip-still.left-half { clip-path:inset(0 50% 0 0); }
.nh-side-flip-still.right-half { clip-path:inset(0 0 0 50%); }
.nh-side-flip-leaf { inset:auto; top:0; width:50%; height:100%; box-shadow:0 4px 22px #0003; }
.nh-side-flip-leaf.forward { left:50%; transform-origin:left center; }
.nh-side-flip-leaf.backward { left:0; transform-origin:right center; }
.nh-side-flip-scroll { width:var(--nh-side-width,100%); height:100%; }
.nh-side-flip-face.right-sheet .nh-side-flip-scroll { position:relative; left:calc(var(--nh-side-width)/-2); }
.nh-side-flip-motion .nh-side-flip-scroll { contain:layout paint; }
.nh-side-flip-reader .dh-detail-root { will-change:auto; }
.nh-side-flip-shade { background:linear-gradient(90deg,#000b,#0000); }
.nh-side-flip-status { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }

/* Dailyhunt-style horizontal article slide stage + unmistakable swipe indicators */
.nh-side-slide-stage { position:relative; flex:1 1 auto; min-height:0; overflow:hidden; }
.nh-side-slide-incoming { position:absolute; inset:0; z-index:40; background:var(--paper,#fff); box-shadow:-8px 0 24px rgba(0,0,0,.16); will-change:transform; pointer-events:none; overflow:hidden; }
body.dark .nh-side-slide-incoming { background:#121212; }
.nh-side-edge-tab { position:absolute; top:55%; transform:translateY(-50%); z-index:85; width:26px; height:52px; border:1px solid rgba(229,27,43,.45); background:rgba(255,255,255,.92); color:#e51b2b; font:800 22px/1 sans-serif; display:flex; align-items:center; justify-content:center; cursor:pointer; box-shadow:0 3px 10px rgba(0,0,0,.14); }
.nh-side-edge-tab.right { right:0; border-right:0; border-radius:16px 0 0 16px; animation:nhEdgeNudgeR 2s ease-in-out infinite; }
.nh-side-edge-tab.left { left:0; border-left:0; border-radius:0 16px 16px 0; animation:nhEdgeNudgeL 2s ease-in-out infinite; }
body.dark .nh-side-edge-tab { background:rgba(24,24,30,.88); border-color:rgba(229,27,43,.6); }
@keyframes nhEdgeNudgeR { 0%,100%{transform:translate(0,-50%)} 50%{transform:translate(-4px,-50%)} }
@keyframes nhEdgeNudgeL { 0%,100%{transform:translate(0,-50%)} 50%{transform:translate(4px,-50%)} }
.nh-side-swipe-bar { flex:none; display:flex; align-items:center; gap:8px; padding:7px 10px; background:#fafafc; border-top:1px solid #e5e7eb; z-index:95; }
body.dark .nh-side-swipe-bar { background:#141418; border-top-color:#27272a; }
.nh-side-swipe-btn { flex:none; height:34px; padding:0 12px; border-radius:18px; font:800 12px/1 sans-serif; cursor:pointer; border:1px solid #e2e8f0; background:#f1f5f9; color:#1e293b; }
.nh-side-swipe-btn.next { background:#e51b2b; border-color:#e51b2b; color:#fff; }
body.dark .nh-side-swipe-btn.prev { background:#24242c; border-color:#32323d; color:#f8fafc; }
.nh-side-swipe-btn:disabled { opacity:.35; cursor:default; }
.nh-side-swipe-center { flex:1; min-width:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; background:none; border:0; padding:0; cursor:pointer; color:inherit; }
.nh-side-swipe-hint { display:inline-flex; align-items:center; gap:6px; font:800 11px/1.1 sans-serif; color:#e51b2b; }
.nh-side-swipe-count { padding:2px 6px; border-radius:999px; background:#fff1f2; color:#e51b2b; font-size:10px; }
body.dark .nh-side-swipe-count { background:#2d181b; }
.nh-side-swipe-next { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; color:#475569; }
body.dark .nh-side-swipe-next { color:#cbd5e1; }
