/* seekerblog-theme.css - Design System & Modern Theme for seekerblog.gauravw.com */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+Devanagari:wght@400;500;600;700&family=Outfit:wght@400;500;600;700&family=Tiro+Devanagari+Sanskrit:ital@0;1&display=swap');

:root {
  /* Color Palette - Deep Spiritual Night & Sacred Flame */
  --bg-main: #0b132b;
  --bg-darker: #060a17;
  --bg-card: rgba(15, 28, 54, 0.75);
  --bg-card-hover: rgba(22, 40, 75, 0.9);
  --bg-card-active: rgba(28, 50, 92, 0.95);
  
  /* Primary & Accents */
  --lamp: #e3b25a;
  --lamp-bright: #f7d08a;
  --lamp-dim: #9c7d42;
  --lamp-glow: rgba(227, 178, 90, 0.18);
  --lamp-glow-strong: rgba(227, 178, 90, 0.35);
  
  /* Neutral Ink & Surfaces */
  --ink: #ece4d2;
  --ink-bright: #ffffff;
  --ink-muted: #9faec0;
  --ink-dim: #64748b;
  
  /* Borders & Lines */
  --line: rgba(36, 62, 102, 0.8);
  --line-bright: rgba(227, 178, 90, 0.4);
  
  /* Tulsi Green & Special Badges */
  --tulsi: #8fb39b;
  --tulsi-bg: rgba(143, 179, 155, 0.15);
  --tulsi-border: rgba(143, 179, 155, 0.4);
  
  /* Typography */
  --font-deva: 'Tiro Devanagari Sanskrit', 'Noto Serif Devanagari', 'Nirmala UI', serif;
  --font-latin: Georgia, 'Times New Roman', serif;
  --font-ui: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Font Size Scaling Base */
  --deva-size: 1.3rem;
  --iast-size: 0.92rem;
  --trans-size: 0.92rem;
  
  /* Shadows & Glassmorphism */
  --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px var(--lamp-glow);
  --glass-blur: blur(14px);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Global */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-main);
  color: var(--ink);
  font-family: var(--font-ui);
  min-height: 100vh;
  padding: max(2rem, env(safe-area-inset-top)) 1.2rem 6rem;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Ambient Radial Background Glow */
body::before {
  content: "";
  position: fixed;
  top: -15vw;
  left: 50%;
  transform: translateX(-50%);
  width: 95vw;
  height: 50vw;
  max-width: 1100px;
  background: radial-gradient(ellipse at center, var(--lamp-glow), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.wrap {
  max-width: 48rem;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Header Component */
header {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.8rem;
}

.domain-pill {
  font-size: 0.82rem;
  color: var(--lamp);
  text-decoration: none;
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-full);
  transition: all var(--transition-normal);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  backdrop-filter: var(--glass-blur);
}

.domain-pill:hover {
  border-color: var(--lamp);
  background: var(--bg-card-hover);
  box-shadow: 0 0 16px var(--lamp-glow);
  transform: translateY(-1px);
}

.stats-strip {
  display: flex;
  gap: 0.8rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.stat-tag {
  background: rgba(36, 62, 102, 0.4);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.brand {
  text-align: center;
  margin-top: 0.5rem;
}

.brand h1 {
  font-family: var(--font-deva);
  font-size: clamp(2.6rem, 8vw, 3.8rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--ink-bright);
  letter-spacing: 0.02em;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.7);
}

.brand p {
  font-size: 0.84rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--lamp);
  margin-top: 0.6rem;
  font-weight: 700;
}

.brand .subtitle {
  font-family: var(--font-latin);
  font-style: italic;
  font-size: 0.98rem;
  color: var(--ink-muted);
  text-transform: none;
  letter-spacing: normal;
  margin-top: 0.45rem;
}

/* Quote Banner */
.quote-banner {
  background: linear-gradient(135deg, rgba(227, 178, 90, 0.12) 0%, rgba(15, 28, 54, 0.7) 100%);
  border: 1px solid var(--line-bright);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1.3rem;
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.quote-banner .om-symbol {
  font-family: var(--font-deva);
  font-size: 2.4rem;
  color: var(--lamp);
  line-height: 1;
  flex-shrink: 0;
  text-shadow: 0 0 12px var(--lamp-glow);
}

.quote-banner .quote-text {
  font-family: var(--font-latin);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.55;
}

/* Floating Reader Toolbar - Ultra Responsive */
/* Sizing below is intentionally in px, not rem: it keeps the toolbar's
   own footprint fixed regardless of any rem-based scaling elsewhere on
   the page (the A+/A- control here drives --scale, not root font-size,
   but pinning this chrome to px is what guarantees it never balloons). */
.reader-toolbar {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(11, 19, 43, 0.94);
  border: 1px solid var(--line-bright);
  border-radius: var(--radius-full);
  padding: 6px 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65), 0 0 20px var(--lamp-glow);
  z-index: 9999;
  width: max-content;
  max-width: calc(100vw - 1rem);
  box-sizing: border-box;
}

/* The chant readers call their light palette "leaf" in storage. This warmer
   ivory surface keeps the reading field bright without turning it stark. */
html[data-theme="leaf"] {
  --bg: #f8f1e1 !important;
  --bg2: #f1e5cb !important;
  --line: #cbb88e !important;
  --fg: #2f2619 !important;
  --fg2: #6c5b40 !important;
  --accent: #87551c !important;
  --gloss: #49644f !important;
}

html[data-theme="leaf"] .reader-toolbar {
  background: rgba(248, 241, 225, 0.96);
  border-color: #cbb88e;
  box-shadow: 0 12px 34px rgba(65, 48, 23, 0.18);
}

html[data-theme="leaf"] .toolbar-btn { color: #2f2619; }
html[data-theme="leaf"] .toolbar-btn:hover { background: rgba(135, 85, 28, 0.12); color: #664014; border-color: #b89155; }

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.toolbar-divider {
  width: 1px;
  height: 18px;
  background: var(--line);
  margin: 0 2px;
  flex-shrink: 0;
}

.toolbar-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink);
  padding: 6px 9px;
  border-radius: var(--radius-full);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.toolbar-btn:hover {
  background: var(--lamp-glow);
  color: var(--lamp-bright);
  border-color: var(--lamp-dim);
}

.toolbar-btn.active {
  background: var(--lamp);
  color: var(--bg-main);
  border-color: var(--lamp-bright);
  font-weight: 700;
  box-shadow: 0 0 10px var(--lamp-glow);
}

.toolbar-btn-icon {
  font-size: 14px;
}

/* Footer Component */
footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--ink-muted);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

footer b {
  color: var(--ink);
  font-weight: 600;
}

footer .footer-links {
  display: flex;
  gap: 1.4rem;
  margin-top: 0.3rem;
}

footer .footer-links a {
  color: var(--lamp);
  text-decoration: none;
  transition: color var(--transition-fast);
  font-weight: 500;
}

footer .footer-links a:hover {
  color: var(--lamp-bright);
  text-decoration: underline;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .reader-toolbar {
    bottom: 0.8rem;
    padding: 5px 6px;
    gap: 2px;
  }
  .toolbar-btn {
    padding: 5px 6px;
    font-size: 11px;
    gap: 3px;
  }
  .toolbar-divider {
    margin: 0;
  }
  .toolbar-btn-text-full {
    display: none;
  }
  .stats-strip {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ── Landscape reading mode (verse readers) ──────────────────────
   Activated by seekerblog-landscape.js, which toggles data-ls on
   <html> via matchMedia rather than a bare @media query, so JS
   paging logic and this CSS never disagree about whether it's on. */
html[data-ls="1"] body {
  padding: 0 !important;
}
html[data-ls="1"] header,
html[data-ls="1"] footer,
html[data-ls="1"] .reader-toolbar,
html[data-ls="1"] .iast,
html[data-ls="1"] .gloss {
  display: none !important;
}
html[data-ls="1"] main {
  justify-content: center !important;
  overflow: hidden !important;
  padding: .5rem max(.75rem, env(safe-area-inset-right)) .5rem max(.75rem, env(safe-area-inset-left)) !important;
}
html[data-ls="1"] .stage {
  max-width: none !important;
}
html[data-ls="1"] {
  --verse: clamp(1.15rem, 4.6svh, 2.1rem) !important;
}
html[data-ls="1"] .deva {
  line-height: 1.5 !important;
}
html[data-ls="1"] .marker {
  position: absolute;
  top: .4rem;
  left: .6rem;
  margin-bottom: 0 !important;
}
html[data-ls="1"] .deva[data-paged="1"] .vline {
  display: none;
}
html[data-ls="1"] .deva[data-paged="1"] .vline.ls-on {
  display: block;
}

.ls-bar {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(11, 19, 43, 0.94);
  border: 1px solid var(--line-bright);
  border-radius: 999px;
  padding: 6px 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65), 0 0 20px var(--lamp-glow);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.ls-bar.show {
  opacity: 1;
  pointer-events: auto;
}
.ls-btn {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  border: none;
  background: none;
  display: grid;
  place-items: center;
  color: var(--ink);
  cursor: pointer;
}
.ls-btn:hover {
  background: var(--lamp-glow);
  color: var(--lamp-bright);
}
.ls-btn:disabled {
  opacity: .35;
  pointer-events: none;
}
.ls-btn svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#lsPlay svg {
  fill: currentColor;
  stroke: none;
}
.ls-btn-txt {
  width: auto;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-ui);
}
.ls-div {
  width: 1px;
  height: 18px;
  background: var(--line);
  margin: 0 2px;
  flex-shrink: 0;
}
.ls-pageind {
  opacity: .75;
}

/* ── Hands-free gesture control (seekerblog-gesture.js) ───────────
   Markup for the hidden camera element and the status pill is injected
   by seekerblog-gesture.js; only the "Gesture" toolbar button reuses the
   existing .toolbar-btn family untouched. Colours below intentionally
   use the page's own inline theme vars (--bg2/--line/--fg2/--accent),
   not this sheet's --lamp/--ink globals, so the pill follows whichever
   of Night/Leaf the reader has chosen for that page. */
.sbg-cam {
  /* Not display:none -- iOS Safari stops delivering decoded frames to a
     video element that's removed from layout. */
  position: fixed;
  top: 0;
  left: 0;
  width: 2px;
  height: 2px;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}

.sbg-status {
  position: fixed;
  left: 50%;
  bottom: 4.4rem; /* clears .reader-toolbar */
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  z-index: 18; /* below the page's .scrim (19) / .sheet (20) */
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--fg2);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
  transition: opacity var(--transition-fast);
}
.sbg-status[hidden] {
  display: none;
}

.sbg-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fg2);
  flex-shrink: 0;
}
.sbg-status[data-s="live"] .sbg-dot,
.sbg-status[data-s="hold"] .sbg-dot,
.sbg-status[data-s="fired"] .sbg-dot {
  background: var(--accent);
}
.sbg-status[data-s="live"] .sbg-dot {
  animation: sbgPulse 2.4s ease-in-out infinite;
}
@keyframes sbgPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
.sbg-status[data-s="denied"],
.sbg-status[data-s="error"] {
  border-color: var(--accent);
  color: var(--fg);
}

.toolbar-btn.sbg-hint {
  border-color: var(--lamp-dim);
  border-style: dashed;
}

html[data-ls="1"] .sbg-status {
  bottom: .8rem;
}
