/* ════════════════════════════════════════════════════
   ARTICLE.CSS — Article page styles
   ════════════════════════════════════════════════════ */

/* Font size levels (controlled by IKS.setFontSize) */
:root             { --art-fs: 17.5px; }
:root[data-fs="lg"] { --art-fs: 20px; }
:root[data-fs="xl"] { --art-fs: 23px; }

/* ── ARTICLE TOPBAR — slim bar: breadcrumb + font size ── */
.art-topbar {
  background: var(--ivory);
  border-bottom: 1px solid var(--border);
  padding: 8px 56px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}

.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-secondary);
  font-style: italic; flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--saffron);
  text-decoration: none;
  transition: color 0.2s;
}
.breadcrumb a:hover { color: var(--saffron-light); }

/* Font Size Toggle — on light topbar */
.fs-toggle {
  display: flex; gap: 2px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px;
  flex-shrink: 0;
}
.fs-btn {
  padding: 3px 8px;
  border: none; border-radius: 16px;
  font-family: 'Crimson Pro', serif;
  font-size: 11px; font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  background: transparent;
  color: var(--text-secondary);
  line-height: 1.2;
}
.fs-btn.active {
  background: var(--ivory-dark);
  color: var(--text-primary);
}
.fs-btn:hover:not(.active) { color: var(--text-secondary); }

/* ── ARTICLE HEADER — Band 1: dark warm brown ───── */
.art-header {
  background: var(--brown);
  padding: 20px 56px 18px;
}

.art-num-badge {
  display: inline-block;
  font-family: monospace; font-size: 10px;
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.38);
  padding: 2px 8px; border-radius: 10px;
  margin-bottom: 10px;
}

.art-header h1 {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 30px; font-weight: 600;
  color: var(--brown-pale); line-height: 1.35;
}
.art-header .en-title {
  font-family: 'Crimson Pro', serif;
  font-size: 17px; font-weight: 300; font-style: italic;
  color: rgba(212,184,150,0.65); margin-top: 4px;
}
.reading-time { display: none; }
.art-section-tag { display: none; }

/* ── ARTICLE BODY ─────────────────────────────────── */
.art-body {
  max-width: 780px;
  padding: 20px 56px 72px;
}

/* Summary box */
.summary-box {
  background: var(--saffron-pale);
  border-left: 3px solid var(--saffron);
  border-radius: 0 6px 6px 0;
  padding: 14px 20px;
  margin-bottom: 40px;
}
.summary-box .box-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--saffron); margin-bottom: 8px;
}
.summary-box p {
  font-size: calc(var(--art-fs) - 1.5px); color: var(--text-secondary);
  line-height: 1.78; font-style: italic;
}

/* Content section */
.content-sec { margin-bottom: 36px; }
.content-sec h2 {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 18px; font-weight: 600;
  color: var(--saffron);
  margin-bottom: 14px;
}
.content-sec h2 .en-h {
  font-family: 'Crimson Pro', serif;
  font-size: 14px; font-weight: 400; font-style: italic;
  color: var(--text-muted); display: block; margin-top: 2px;
}
.content-sec p {
  font-size: var(--art-fs);
  color: var(--text-primary);
  line-height: 1.9;
  margin-bottom: 14px;
}

/* Article infographic */
.art-image {
  margin: 28px 0;
  border-radius: 8px;
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}
.art-image img, .art-image svg {
  width: max(100%, 480px); height: auto; display: block;
}
.art-image figcaption {
  font-size: 13px; color: var(--text-muted);
  font-style: italic; padding: 10px 16px;
  background: var(--ivory-dark);
  text-align: center;
}

/* ── Zoom controls (shared) ─────────────────────────── */
.zoom-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--ivory-dark);
  border-bottom: 1px solid var(--border);
}
.zoom-btn {
  width: 26px; height: 26px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--ivory);
  color: var(--text-secondary);
  font-size: 16px; line-height: 1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.zoom-btn:hover {
  background: var(--saffron-pale);
  border-color: var(--saffron-light);
}
.zoom-pct {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 36px;
  text-align: center;
  font-family: monospace;
}

/* ── Slide viewer (PDF.js-based, bilingual) ─────────── */
.slide-viewer {
  margin: 32px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.slide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--ivory-dark);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}
.slide-label {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.slide-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.slide-lang-btns {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.slide-lang-btn {
  padding: 4px 11px;
  font-size: 12px;
  border: none;
  background: var(--ivory);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.slide-lang-btn + .slide-lang-btn {
  border-left: 1px solid var(--border);
}
.slide-lang-btn.active {
  background: var(--saffron);
  color: #fff;
}
.slide-track {
  overflow-x: auto;
  overflow-y: hidden;
  background: #3d3530;
  padding: 16px;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  touch-action: pan-x;
}
.slide-track:active { cursor: grabbing; }
.slide-inner {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 16px;
  align-items: flex-start;
}
.slide-page {
  flex: 0 0 auto;
  scroll-snap-align: start;
}
.slide-page canvas {
  display: block;
  border-radius: 3px;
  box-shadow: 0 3px 14px rgba(0,0,0,0.45);
}
.slide-loading,
.slide-unavail {
  color: rgba(255,255,255,0.45);
  font-size: 13px;
  font-style: italic;
  padding: 40px 20px;
  text-align: center;
  width: 100%;
}

/* zoom-bar is shared; override background inside slide-header */
.slide-header .zoom-bar {
  background: transparent;
  border-bottom: none;
  padding: 0;
}
.open-pdf-btn {
  margin-left: 6px;
  border-left: 1px solid var(--border) !important;
  padding-left: 8px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 600px) {
  .slide-track { padding: 10px; }
  .slide-inner { gap: 10px; }
  .zoom-btn { min-width: 36px; min-height: 36px; font-size: 18px; }
}

/* ── SPECIAL BLOCKS ─────────────────────────────────── */

/* Sanskrit Term box */
.term-box {
  background: #FFFCF2;
  border: 1px solid #E8D9A0;
  border-top: 2px solid var(--gold);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 24px 0;
}
@media (prefers-color-scheme: dark) {
  .term-box { background: var(--ivory-dark); border-color: var(--border); border-top-color: var(--gold); }
}
.term-word {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 20px; color: var(--saffron);
  letter-spacing: 0.02em;
  display: flex; align-items: baseline; gap: 10px;
  flex-wrap: wrap;
}
.term-roman { font-size: 14px; font-style: italic; color: var(--text-muted); font-family: 'Crimson Pro', serif; }
.term-def {
  font-size: calc(var(--art-fs) - 2.5px); color: var(--text-secondary);
  margin-top: 8px; line-height: 1.65;
}

/* Key Insight block */
.insight-block {
  background: var(--saffron-pale);
  border-left: 3px solid var(--saffron);
  border-radius: 0 6px 6px 0;
  padding: 20px 24px;
  margin: 28px 0;
}
.insight-block p {
  font-size: var(--art-fs); color: #5A2D0C;
  font-style: italic; line-height: 1.85;
  margin-bottom: 0;
}
@media (prefers-color-scheme: dark) {
  .insight-block p { color: var(--text-primary); }
}

/* Curiosity box */
.curiosity-box {
  background: #EEF6FF;
  border-left: 3px solid #3B82C4;
  border-radius: 0 6px 6px 0;
  padding: 14px 20px;
  margin: 28px 0;
}
@media (prefers-color-scheme: dark) {
  .curiosity-box { background: var(--ivory-dark); border-color: #5A8AB0; }
}
.curiosity-box .box-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: #2B6CB0; margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
@media (prefers-color-scheme: dark) {
  .curiosity-box .box-label { color: #7AAFD4; }
}
.curiosity-box .box-label::before { content: '?'; font-size: 14px; font-weight: 900; }
.curiosity-box p, .curiosity-box ul { font-size: calc(var(--art-fs) - 1.5px); color: var(--text-primary); line-height: 1.75; }
.curiosity-box ul { padding-left: 20px; }
.curiosity-box ul li { margin-bottom: 6px; }

/* Activity box */
.activity-box {
  background: #EEFAF3;
  border-left: 3px solid #2A9D6B;
  border-radius: 0 6px 6px 0;
  padding: 14px 20px;
  margin: 28px 0;
}
@media (prefers-color-scheme: dark) {
  .activity-box { background: var(--ivory-dark); border-color: #3A9D6B; }
}
.activity-box .box-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: #0F6E48; margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
@media (prefers-color-scheme: dark) {
  .activity-box .box-label { color: #4DB88A; }
}
.activity-box .box-label::before { content: '▷'; font-size: 11px; }
.activity-box p, .activity-box ol { font-size: calc(var(--art-fs) - 1.5px); color: var(--text-primary); line-height: 1.75; }
.activity-box ol { padding-left: 20px; }
.activity-box ol li { margin-bottom: 6px; }

/* Key concepts grid */
.concepts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px; margin: 24px 0;
}
.concept-card {
  background: var(--ivory);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}
.c-term {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 14px; font-weight: 600;
  color: var(--saffron); margin-bottom: 2px;
}
.c-roman { font-size: 11px; color: var(--text-muted); font-style: italic; }
.c-def { font-size: calc(var(--art-fs) - 4.5px); color: var(--text-secondary); margin-top: 6px; line-height: 1.5; }

/* Phase II teaser */
.phase2-teaser {
  background: #FFFCF2;
  border: 1px solid #E8D9A0;
  border-radius: 8px;
  padding: 18px 22px;
  margin: 40px 0 0;
  display: flex; align-items: flex-start; gap: 14px;
}
.phase2-icon { font-size: 20px; flex-shrink: 0; padding-top: 2px; }
.phase2-label {
  font-size: 10px; color: var(--saffron);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px;
}
.phase2-desc { font-size: 13px; color: var(--text-muted); font-style: italic; }

/* ── ARTICLE NAV — Band 3: warm tint ────────────────── */
.art-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 28px 56px;
  border-top: 1px solid var(--border);
  background: var(--ivory-dark);
  gap: 16px;
}
.nav-btn {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer; background: #FFFFFF;
  text-align: left;
  transition: all 0.18s;
  max-width: 230px;
  text-decoration: none;
}
.nav-btn:hover { background: var(--saffron-pale); border-color: var(--saffron-light); }
.nav-btn.right { text-align: right; }
.nav-dir {
  font-size: 10px; color: var(--saffron);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.nav-art-title {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 12px; color: var(--text-secondary); line-height: 1.4;
}

/* ── ARTICLE FOOTER — Band 4: deepest brown ─────────── */
.art-footer-band {
  background: var(--brown-deep);
  padding: 20px 56px;
  border-top: 2px solid var(--saffron);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.art-footer-band .footer-note {
  font-size: 12px; color: rgba(255,255,255,0.3); font-style: italic;
}
.art-footer-band .footer-home {
  font-size: 12px; color: rgba(255,255,255,0.4);
  text-decoration: none; transition: color 0.18s;
}
.art-footer-band .footer-home:hover { color: var(--saffron-light); }

/* ── COMING SOON ─────────────────────────────────────── */
.coming-soon {
  padding: 80px 56px;
  text-align: center;
}
.coming-soon .cs-icon { font-size: 48px; margin-bottom: 20px; opacity: 0.4; }
.coming-soon h2 {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 22px; color: var(--text-primary); margin-bottom: 10px;
}
.coming-soon p { font-size: 16px; color: var(--text-muted); font-style: italic; }

/* ── ZOOM ICON ───────────────────────────────────────── */
.zoom-icon {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(28, 8, 0, 0.82);
  color: #fff;
  font-size: 13px;
  font-family: 'Crimson Pro', Georgia, serif;
  letter-spacing: 0.03em;
  padding: 6px 14px;
  border-radius: 20px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.18);
}

/* ── ARTICLE PHOTO PANEL ────────────────────────────── */

/* Mobile (≤860px): horizontal scroll — text first, swipe LEFT to reveal image */
@media (max-width: 860px) {
  .art-photo-layout {
    display: flex;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    height: calc(100vh - var(--topbar-h));
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .art-photo-layout::-webkit-scrollbar { display: none; }

  /* Image panel — full-viewport page, hidden to the LEFT of text */
  .art-photo-panel {
    min-width: 100%;
    order: -1;
    scroll-snap-align: center;
    overflow: hidden;
    cursor: zoom-in;
    background: #FAF6EE;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }
  .art-photo-panel.zoomed {
    overflow: auto;
    cursor: zoom-out;
    align-items: flex-start;
    justify-content: flex-start;
  }
  .art-photo-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
  }
  .art-photo-panel.zoomed .art-photo-img {
    max-width: none;
    max-height: none;
    width: 200%;
    height: auto;
    object-fit: unset;
  }

  /* Text panel — full-viewport page, shown first */
  .art-scroll-panel {
    min-width: 100%;
    scroll-snap-align: center;
    overflow-y: auto;
    height: 100%;
    -webkit-overflow-scrolling: touch;
  }

  /* Scroll hint — pulsing left arrow at edge of text panel */
  .art-panel-hint {
    position: fixed;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    opacity: 1;
    transition: opacity 0.4s ease;
    pointer-events: none;
  }
  .art-panel-hint.hidden { opacity: 0; }
  .hint-icon {
    font-size: 15px;
    color: var(--saffron, #D4500A);
    animation: hint-bounce 1.4s ease-in-out infinite;
    line-height: 1;
  }
  .hint-label {
    font-size: 8px;
    color: var(--saffron, #D4500A);
    font-family: 'Noto Sans Devanagari', sans-serif;
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    line-height: 1.2;
  }
  @keyframes hint-bounce {
    0%, 100% { transform: translateX(0); opacity: 0.55; }
    50%       { transform: translateX(-6px); opacity: 1; }
  }
  .art-header h1.title-photo-trigger::after { display: none; }
}

/* Desktop (≥861px): image panel fixed on LEFT in the freed sidebar space */
@media (min-width: 861px) {
  .art-photo-panel {
    position: fixed;
    left: 0;
    top: var(--topbar-h);
    width: clamp(300px, 38vw, 520px);
    height: calc(100vh - var(--topbar-h));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--ivory-dark);
    border-right: 2px solid var(--border);
    cursor: zoom-in;
    z-index: 90;
  }
  .zoom-icon { display: none; }
  .art-photo-panel.zoomed {
    overflow: auto;
    cursor: zoom-out;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0;
  }
  .art-photo-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
    border-radius: 4px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.10);
  }
  .art-photo-panel.zoomed .art-photo-img {
    max-width: none;
    max-height: none;
    width: 200%;
    height: auto;
    object-fit: unset;
    border-radius: 0;
    box-shadow: none;
  }
  .art-panel-hint { display: none; }
  /* Offset article content to make room for the wider image panel */
  main.art-photo-layout { margin-left: clamp(300px, 38vw, 520px); }
}

/* ── RESPONSIVE ARTICLE ─────────────────────────────── */
@media (max-width: 860px) {
  .art-topbar { padding: 8px 24px; }
  .art-header { padding: 16px 24px 14px; }
  .art-header h1 { font-size: 24px; }
  .art-body { padding: 16px 24px 56px; }
  .art-nav { padding: 20px 24px; }
  .art-footer-band { padding: 16px 24px; }
  .concepts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .art-nav { flex-direction: column; }
  .nav-btn { max-width: 100%; width: 100%; }
  .nav-btn.right { text-align: left; }
}
