:root {
  --red:        #dc143c;
  --red-dark:   #a50e2d;
  --red-light:  #fff0f3;
  --blue:       #003893;
  --blue-light: #eef2ff;
  --teal:       #0d9488;
  --green:      #16a34a;

  --bg:         #ffffff;
  --bg-page:    #f4f5f7;
  --bg-soft:    #f8f9fa;
  --bg-card:    #ffffff;
  --border:     #e5e7eb;
  --border-soft:#f3f4f6;

  --text:       #111827;
  --text-2:     #374151;
  --text-3:     #6b7280;
  --text-4:     #9ca3af;

  --footer-bg:   #111827;
  --footer-text: rgba(255,255,255,0.75);

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:  0 10px 30px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.03);

  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  16px;
}

[data-theme="dark"] {
  --red:        #ff6b81;
  --red-dark:   #ff8fa0;
  --red-light:  rgba(220,20,60,0.14);
  --blue:       #7b93ff;
  --blue-light: rgba(0,56,147,0.22);
  --teal:       #2dd4bf;
  --green:      #4ade80;

  --bg:         #16171a;
  --bg-page:    #0f1012;
  --bg-soft:    #1c1d20;
  --bg-card:    #1c1d20;
  --border:     #2c2d31;
  --border-soft:#25262a;

  --text:       #f3f4f6;
  --text-2:     #d1d5db;
  --text-3:     #9ca3af;
  --text-4:     #6b7280;

  --footer-bg:   #0a0b0d;
  --footer-text: rgba(255,255,255,0.7);

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.35), 0 1px 2px rgba(0,0,0,0.25);
  --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.3);
  --shadow-lg:  0 10px 30px rgba(0,0,0,0.5), 0 4px 8px rgba(0,0,0,0.3);
}

/* Fallback for no-JS visitors: honor system preference until the init script runs */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --red:        #ff6b81;
    --red-dark:   #ff8fa0;
    --red-light:  rgba(220,20,60,0.14);
    --blue:       #7b93ff;
    --blue-light: rgba(0,56,147,0.22);
    --teal:       #2dd4bf;
    --green:      #4ade80;
    --bg:         #16171a;
    --bg-page:    #0f1012;
    --bg-soft:    #1c1d20;
    --bg-card:    #1c1d20;
    --border:     #2c2d31;
    --border-soft:#25262a;
    --text:       #f3f4f6;
    --text-2:     #d1d5db;
    --text-3:     #9ca3af;
    --text-4:     #6b7280;
    --footer-bg:   #0a0b0d;
    --footer-text: rgba(255,255,255,0.7);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: 'Inter', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a { text-decoration: none; }

.wrap {
  max-width: none;
  margin: 0 auto;
  padding: 0 32px;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Nav */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 18px 32px;
}

.brand-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.brand-logo-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #0b0b0b;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.brand-logo-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.brand {
  color: var(--red);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

/* Language toggle (English default, Nepali via data-lang="np") */
html:not([data-lang="np"]) [data-lang-np] { display: none; }
html[data-lang="np"] [data-lang-en] { display: none; }

.nav-right { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: 0 0 auto; }

.lang-toggle {
  height: 36px;
  padding: 0 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-2);
  font-family: 'Inter', 'Noto Sans Devanagari', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  margin-left: 4px;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.lang-toggle:hover { border-color: var(--red); color: var(--red); }

@media (max-width: 700px) {
  .topnav { gap: 12px; }
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 6px;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.theme-toggle:hover { border-color: var(--red); color: var(--red); }

.theme-toggle svg { width: 17px; height: 17px; }

.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* Thin tricolor accent bar (replaces the old three-bar flag stripe) */
.accent-bar {
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--red) 0%, var(--red) 40%, var(--blue) 40%, var(--blue) 75%, var(--text-4) 75%, var(--text-4) 100%);
  opacity: 0.9;
}

/* Page shell: single-column vertical tab list on the left, main content on
   the right. The active tab's background matches the page canvas (--bg-page)
   and its right border is erased + pulled 1px past the sidebar's own right
   edge, so the tab visually fuses with -- looks "grown out of" -- whatever
   page content is currently showing, folder-tab style. Inactive tabs keep
   the divider border, reading as separate from the content. */
.page-shell {
  display: flex;
  align-items: flex-start;
  max-width: none;
  margin: 0 auto;
  padding: 32px 32px 80px;
}

.side-nav {
  /* Shrink-wrap to the widest tab label rather than a fixed column width --
     keeps the sidebar as narrow as possible so main-panel gets the rest. */
  flex: 0 0 auto;
  width: max-content;
  position: sticky;
  top: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  padding: 8px 0;
}

.side-nav-tabs { display: flex; flex-direction: column; gap: 2px; }

.side-nav-tab {
  display: block;
  padding: 9px 14px;
  margin-right: -1px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-3);
  background: transparent;
  white-space: nowrap;
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
  border-right: 1px solid var(--border);
  transition: all 0.15s ease;
}

.side-nav-tab:hover { color: var(--red); background: var(--red-light); }

.side-nav-tab.active {
  color: var(--red);
  font-weight: 800;
  background: var(--bg-page);
  border-top-color: var(--border);
  border-bottom-color: var(--border);
  border-right-color: var(--bg-page);
}

.main-panel {
  flex: 1 1 auto;
  min-width: 0;
  padding-left: 14px;
}

@media (max-width: 780px) {
  .page-shell { flex-direction: column; padding: 20px 20px 60px; }
  .side-nav {
    position: static;
    width: 100%;
    flex: 0 0 auto;
    border-radius: var(--radius-lg);
    border-right: 1px solid var(--border);
    padding: 8px;
  }
  .side-nav-tabs { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .side-nav-tab {
    margin-right: 0;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
  }
  .side-nav-tab.active {
    border-color: var(--border);
    background: var(--red-light);
    border-right-color: var(--border);
  }
  .main-panel { padding-left: 0; padding-top: 20px; }
}

/* Nepal Today: centered title above two equal-width boxes (word cloud + sentiment).
   .page-hero-head/.page-hero-title share the same centered big-headline style
   for other page heroes (e.g. Visual Nepal's "Nepal in Visual"). */
.nepal-today-head, .page-hero-head {
  text-align: center;
  padding: 44px 0 20px;
}

.nepal-today-title, .page-hero-title {
  margin: 0 0 14px;
  color: var(--text);
  font-weight: 800;
  font-size: 2.4rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.page-hero-subtitle {
  margin: 0 auto;
  max-width: 56ch;
  color: var(--text-3);
  font-size: 1.02rem;
  line-height: 1.6;
}
.page-hero-subtitle a { color: var(--red); font-weight: 700; }
.page-hero-subtitle a:hover { color: var(--red-dark); }

.nepal-today-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
  padding-bottom: 8px;
}

.wordcloud-col { min-width: 0; display: flex; flex-direction: column; }


.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(22,163,74,0.18);
  flex: none;
  vertical-align: middle;
  margin-bottom: 2px;
  animation: blink 1.8s ease-in-out infinite;
}

.pulse-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  /* Match .sentiment-col's sizing so the two boxes come out exactly the
     same width AND height -- both stretch to fill the grid row, and both
     center their core content (canvas / gauge image) in the leftover
     space via their inner cell, instead of the word cloud box just sizing
     to its own intrinsic canvas height. */
  flex: 1 1 auto;
  min-height: 0;
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

.wordcloud-cell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Shared eyebrow label for the word cloud + sentiment boxes -- bigger and
   centered, unlike the old small left-aligned tag it replaced. */
.box-eyebrow {
  display: block;
  text-align: center;
  color: var(--red);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  margin: 2px 0 10px;
}

.pulse-card canvas { display: block; max-width: 100%; max-height: 100%; }

.box-copyright {
  margin: 10px 0 0;
  text-align: center;
  color: var(--text-3);
  font-size: 0.74rem;
  font-weight: 600;
}

@media (max-width: 780px) {
  .nepal-today-grid { grid-template-columns: 1fr; padding-top: 8px; }
  .nepal-today-head { padding-top: 28px; }
  .nepal-today-title { font-size: 1.7rem; }
}

/* Cards */
.card-grid { display: flex; flex-direction: column; gap: 18px; }

.card, .post-card, .page-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(12px);
  animation: fadeInUp 0.5s ease forwards;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: rgba(220,20,60,0.25);
}

.card-title { margin: 0 0 6px; font-size: 1.2rem; font-weight: 700; color: var(--text); }

.card-date {
  margin: 0 0 12px;
  font-size: 0.78rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.card-excerpt { margin: 0 0 14px; color: var(--text-2); line-height: 1.6; }

.card-link { color: var(--red); font-weight: 700; font-size: 0.88rem; }

/* Featured (latest) card */
.featured-card { padding: 40px 44px; min-height: 220px; margin-bottom: 4px; }
.featured-card .card-title { font-size: 1.7rem; line-height: 1.25; margin-bottom: 10px; }
.featured-card .card-date { font-size: 0.85rem; }
.featured-card .card-excerpt { font-size: 1rem; }

/* Section divider */
.section-divider { display: flex; align-items: center; gap: 12px; margin: 32px 0 16px; }
.section-divider::before, .section-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.section-label {
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}

/* Mini grid: last 10 days, 5 columns x 2 rows */
.mini-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }

.mini-card {
  padding: 10px 0 0;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  aspect-ratio: 1 / 1.3;
  overflow: hidden;
}
.mini-card:hover { border: none; }
.mini-card .card-date { font-size: 0.65rem; margin: 0 0 4px; flex: 0 0 auto; padding: 0 10px; }
.mini-card .card-title {
  font-size: 0.83rem;
  margin: 0 0 6px;
  flex: 0 0 auto;
  width: 100%;
  padding: 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mini-wc {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  display: block;
}

.mini-visits {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 10px 8px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-3);
}
.mini-visits svg { width: 11px; height: 11px; flex-shrink: 0; opacity: 0.75; }

.archive-visits {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-3);
  margin: -6px 0 12px;
}
.archive-visits svg { width: 11px; height: 11px; flex-shrink: 0; opacity: 0.75; }


.archive-empty { color: var(--text-3); text-align: center; padding: 20px 0; }

@media (max-width: 700px) {
  .mini-grid { grid-template-columns: repeat(2, 1fr); }
}

.post-card, .page-card { animation-delay: 0s; }

.page-content-lead { color: var(--text-2); font-size: 1.02rem; line-height: 1.65; margin: 0 0 20px; }

/* Visual Nepal: two equal-width map cards, one row */
.visual-nepal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 4px 0 20px;
}
.visual-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.visual-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: rgba(220,20,60,0.25);
}
/* The clickable map area (title/preview/description) -- a link nested
   inside the .visual-card div rather than the div itself being the link,
   so the share-row's buttons below it aren't nested inside an <a> (which
   would make every button click also trigger the card's navigation). */
.visual-card-link { display: block; text-decoration: none; color: inherit; }
.visual-card-share-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 20px 18px;
}

/* Single share-button row used on standalone tool pages (Date Converter) --
   sits right under its tool's box, aligned to the bottom-right corner. */
.tool-share-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 14px 0 28px;
}
.visual-card-preview {
  position: relative;
  height: 260px;
  overflow: hidden;
  background: #0a0e0f;
}
.visual-card-preview iframe {
  position: absolute;
  top: 0;
  left: 0;
  border: 0;
  pointer-events: none;
  transform-origin: top left;
}
.visual-card-body { padding: 18px 20px 12px; }
.visual-card-title { margin: 0; font-size: 1.08rem; font-weight: 800; color: var(--text); line-height: 1.3; }
.visual-card-footer { padding: 14px 20px 22px; }
.visual-card-desc { margin: 0 0 12px; font-size: 0.86rem; line-height: 1.55; color: var(--text-2); }
.visual-card-cta { color: var(--red); font-weight: 700; font-size: 0.85rem; }
.visual-nepal-note {
  color: var(--text-3);
  font-size: 0.8rem;
  line-height: 1.6;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
@media (max-width: 780px) {
  .visual-nepal-grid { grid-template-columns: 1fr; }
  .visual-card-preview { height: 220px; }
}

/* Visual Nepal: individual full-page map viewer (wraps the standalone map
   app in an iframe so the site header + sidebar nav stay visible around it,
   instead of navigating away to a bare, chrome-less file). */
.map-page-head { padding-top: 8px; }
/* Height is set inline by JS once the (same-origin) iframe's own content
   finishes loading, matched to its real scrollHeight -- so the outer page
   grows to fit the map + its info content instead of clipping it inside a
   fixed-height, internally-scrolling box. min-height is just the pre-JS /
   no-JS fallback. */
.map-embed-wrap {
  width: 100%;
  min-height: 480px;
  margin: 4px 0 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.map-embed-wrap iframe { display: block; width: 100%; height: 100%; border: 0; }
.map-page-desc { max-width: 70ch; }

/* Visual Nepal card: static image preview (Nepal in Relief) instead of the
   live-map iframe the other two cards use -- same box, same hover/scale
   treatment, just an <img> filling it with object-fit: cover. */
.visual-card-preview-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  display: block;
}

/* Nepal in Relief detail page: hero relief map + 7-up province thumbnail
   grid, each thumbnail opening a same-page lightbox for the full-res image. */
.relief-hero {
  position: relative;
  margin: 4px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: #0a0e0f;
}
.relief-hero img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 82vh;
  object-fit: contain;
  margin: 0 auto;
  cursor: zoom-in;
  background: #0a0e0f;
}
.relief-hero-caption {
  padding: 12px 20px 14px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 0.82rem;
  line-height: 1.55;
}
.relief-hero-caption strong { color: var(--text-2); }

.relief-grid-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 14px;
  flex-wrap: wrap;
}
.relief-grid-title { margin: 0; font-size: 1.15rem; font-weight: 800; color: var(--text); }
.relief-grid-hint { margin: 0; font-size: 0.82rem; color: var(--text-3); }

/* Seven provinces in a grid that wraps to fit -- each tile stays at least
   400px wide (per the terrain-detail requirement) rather than shrinking to
   fit a fixed column count, which is what a real "7-up" would force on
   anything narrower than a very wide desktop. */
.relief-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 20px;
  margin: 0 0 30px;
}
.relief-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: zoom-in;
  text-align: left;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  font: inherit;
  color: inherit;
}
.relief-thumb:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: rgba(220,20,60,0.25);
}
.relief-thumb img { display: block; width: 100%; height: auto; }
.relief-thumb-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.relief-thumb-name { font-weight: 800; font-size: 0.98rem; color: var(--text); }
.relief-thumb-zoom {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--red);
  white-space: nowrap;
}

@media (max-width: 480px) {
  .relief-grid { grid-template-columns: 1fr; }
}

/* Simple click-to-enlarge lightbox -- one full-res <img>, no carousel.
   Zoom is scroll-wheel driven: the viewport is a real scrollable element
   and wheel just resizes the image (keeping the point under the cursor
   fixed via scrollLeft/scrollTop math), so panning after zooming in is
   just native scrolling -- two-finger trackpad scroll, the scrollbar, or
   click-and-drag (added in JS) -- rather than a custom transform. */
.relief-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  flex-direction: column;
  padding: 28px;
  background: rgba(8,9,11,0.88);
}
.relief-lightbox.is-open { display: flex; }
.relief-lightbox-viewport {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
}
/* Flexbox centering clips the start of overflowed content, so once zoomed
   switch to top-left alignment -- the scroll math in JS already accounts
   for this so the zoomed-to point stays put when the class flips. */
.relief-lightbox-viewport.is-zoomed {
  align-items: flex-start;
  justify-content: flex-start;
  cursor: grab;
}
.relief-lightbox-viewport.is-panning { cursor: grabbing; }
.relief-lightbox-viewport::-webkit-scrollbar { width: 10px; height: 10px; }
.relief-lightbox-viewport::-webkit-scrollbar-track { background: transparent; }
.relief-lightbox-viewport::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 6px; }
.relief-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  user-select: none;
  -webkit-user-drag: none;
}
.relief-lightbox-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  text-align: center;
  color: #f3f4f6;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.relief-lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.08);
  color: #f3f4f6;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.relief-lightbox-close:hover { background: rgba(255,255,255,0.18); }


/* Date Converter & Age Calculator */
.converters-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto 28px;
  align-items: stretch;
}
.converters-row .converter-card { max-width: none; margin: 0; width: 100%; height: 100%; }
.converter-card {
  max-width: 620px;
  margin: 0 auto 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.converter-card-title {
  margin: 0 0 16px;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text);
  text-align: center;
}
.converter-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 4px;
}
.converter-tab {
  flex: 1;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 9px 10px;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text-3);
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}
.converter-tab.active { background: var(--red); color: #fff; }
.converter-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.converter-panel { margin-bottom: 18px; }
.converter-input, .converter-select {
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}
.converter-select-row { display: flex; gap: 8px; }
.converter-select-row .converter-select { flex: 1; min-width: 0; }
.converter-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  margin-bottom: 14px;
}
.converter-result-bs, .converter-result-ad { flex: 1; min-width: 0; text-align: center; }
.converter-result-label {
  display: block;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  margin-bottom: 6px;
}
.converter-result-value { display: block; font-size: 1.02rem; font-weight: 800; color: var(--text); line-height: 1.35; }
.converter-result-divider { color: var(--red); font-weight: 800; font-size: 1.1rem; flex: none; }
.converter-today-btn {
  display: block;
  margin: 0 auto;
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--red);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.converter-today-btn:hover { border-color: var(--red); background: var(--red-light); }

.calendars-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 1100px;
  margin: 4px auto 20px;
  align-items: start;
}
.mini-calendar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px 16px 18px;
}
.mini-calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.mini-calendar-title { font-weight: 800; font-size: 0.96rem; color: var(--text); }
.cal-nav {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-2);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.cal-nav:hover { border-color: var(--red); color: var(--red); }
.mini-calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.mini-calendar-weekdays span {
  text-align: center;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  padding: 4px 0;
}
.mini-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-day {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.cal-day:hover { background: var(--red-light); color: var(--red); }
.cal-day.empty { cursor: default; pointer-events: none; }
.cal-day.today { border-color: var(--red); }
.cal-day.selected { background: var(--red); color: #fff; }

@media (max-width: 780px) {
  .calendars-grid { grid-template-columns: 1fr; }
  .converters-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .converter-select-row { flex-direction: column; }
}

.post-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--red-light);
  border: 1px solid rgba(220,20,60,0.2);
  color: var(--red);
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.post-title, .page-title { margin: 0 0 6px; font-size: 1.7rem; font-weight: 800; letter-spacing: -0.01em; }

.post-date {
  color: var(--text-3);
  margin: 0 0 24px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.post-content p, .page-content p { line-height: 1.75; margin: 0 0 18px; color: var(--text-2); }

.post-content h2 {
  margin: 30px 0 12px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--red);
  border-bottom: 2px solid var(--red-light);
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.post-content h2:first-child { margin-top: 0; }

.post-content h2 img {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  flex: none;
}

.post-content ol, .post-content ul { padding-left: 20px; margin: 0 0 20px; }

.post-content li { margin-bottom: 12px; line-height: 1.65; color: var(--text-2); }

.post-content li strong { color: var(--text); }

.post-content li code {
  display: inline-block;
  background: var(--blue-light);
  color: var(--blue);
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-weight: 700;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 20px;
  margin-right: 8px;
  vertical-align: middle;
}

.post-content a, .page-content a { color: var(--red); font-weight: 500; }

/* Share buttons */
.share-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.share-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  margin-right: 2px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-2);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.share-btn svg { width: 14px; height: 14px; }

.share-btn:hover {
  background: var(--red-light);
  border-color: var(--red);
  color: var(--red);
  transform: translateY(-1px);
}

.share-btn:disabled { opacity: 0.5; cursor: wait; transform: none; }

.outlet-box { position: relative; }

.outlet-share-row {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  z-index: 2;
}

.outlet-share-row .share-btn {
  width: 26px;
  height: 26px;
  background: var(--bg-card);
}

.outlet-share-row .share-btn svg { width: 12px; height: 12px; }

@media (max-width: 620px) {
  .outlet-share-row { position: static; justify-content: flex-end; margin-bottom: 10px; }
}

/* Outlet boxes: narrow rotated-label sidebar + wide headline column */
.outlet-box {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin: 0 0 22px;
}

.outlet-side {
  flex: 0 0 60px;
  width: 60px;
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 20px 0;
}

.outlet-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  flex: none;
}

.outlet-name {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--text-2);
  white-space: nowrap;
}

.outlet-items {
  flex: 1;
  min-width: 0;
  padding: 24px 46px 24px 26px;
}

.outlet-items ol, .outlet-items ul { margin: 0; padding-left: 20px; }
.outlet-items li {
  margin-bottom: 14px;
  padding: 4px 6px;
  margin-left: -6px;
  margin-right: -6px;
  border-radius: 8px;
  transition: background-color .2s ease;
  cursor: default;
}
.outlet-items li:last-child { margin-bottom: 0; }
.outlet-items li:hover,
.outlet-items li.expanded {
  background: var(--bg-soft);
}
.hl-detail {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  color: var(--text-2);
  font-size: 0.85rem;
  line-height: 1.55;
  transition: max-height .35s ease, opacity .25s ease, margin-top .35s ease;
}
.hl-detail p { margin: 0; }
.outlet-items li:hover .hl-detail,
.outlet-items li.expanded .hl-detail {
  max-height: 260px;
  opacity: 1;
  margin-top: 8px;
}
.outlet-items li:hover strong,
.outlet-items li.expanded strong { color: var(--red); }

@media (max-width: 620px) {
  .outlet-box { flex-direction: column; }
  .outlet-side {
    flex-direction: row;
    width: 100%;
    flex: 0 0 auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    justify-content: flex-start;
  }
  .outlet-name { writing-mode: horizontal-tb; transform: none; }
  .outlet-items { padding: 18px 20px; }
}

.back-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--red);
  font-weight: 700;
  font-size: 0.9rem;
}

.back-link:hover { color: var(--red-dark); }

/* --- National Sentiment Quantified (homepage, next to word cloud, today only) --- */
.sentiment-outer-col { min-width: 0; display: flex; flex-direction: column; }
.sentiment-col {
  min-width: 0;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  padding: 16px 16px 14px; overflow: hidden;
  /* Grow to fill the grid-stretched column height, so this box matches the
     word cloud box's height exactly. */
  flex: 1 1 auto;
  min-height: 0;
}
.gauge-cell { display: flex; align-items: center; justify-content: center; min-height: 0; overflow: hidden; }
.gauge-cell.today { flex: 1 1 auto; }
.gauge-cell img { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; }
/* The gauge PNG is generated in both a light- and dark-theme color variant
   (transparent background either way); only one shows at a time. */
.gauge-cell .gauge-dark { display: none; }
[data-theme="dark"] .gauge-cell .gauge-light { display: none; }
[data-theme="dark"] .gauge-cell .gauge-dark { display: block; }
/* .sentiment-share-row now matches .share-row's default margin-top (14px) so the two homepage boxes come out exactly equal height. */
/* Full-width "Latest digest" card, below the Nepal Today grid */
.featured-card-full { width: 100%; box-sizing: border-box; }
@media (max-width: 780px) {
  .gauge-cell.today { height: 300px; }
}


/* Footer */
.site-footer { background: var(--footer-bg); padding: 0; margin-top: 24px; }

.footer-inner {
  display: flex;
  align-items: stretch;
  text-align: left;
}

.footer-logo-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 20px;
  border-right: 1px solid rgba(255,255,255,0.1);
}

.footer-logo { height: 75%; width: auto; max-width: 100%; object-fit: contain; display: block; }

.footer-middle {
  flex: 3 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 44px;
}

.footer-desc {
  color: var(--footer-text);
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 0 16px;
  line-height: 1.65;
}

.footer-divider { width: 64px; height: 1px; background: rgba(255,255,255,0.16); margin: 0 0 16px; }

.footer-sources {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 16px 18px;
  border-left: 1px solid rgba(255,255,255,0.1);
}

.footer-sources-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  text-align: center;
}

.footer-source-item {
  color: var(--footer-text);
  font-size: 0.76rem;
  font-weight: 500;
  text-align: center;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.footer-contact { margin: 0 0 6px; color: rgba(255,255,255,0.85); font-size: 0.95rem; }

.footer-contact a { color: #fff; font-weight: 600; }

.footer-copy { color: rgba(255,255,255,0.4); font-size: 0.78rem; margin: 0; }

@media (max-width: 700px) {
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-logo-col {
    width: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 24px 0;
    justify-content: center;
  }
  .footer-logo { height: 48px; max-width: none; }
  .footer-middle { align-items: center; padding: 24px 20px; }
  .footer-divider { margin: 0 auto 12px; }
  .footer-sources {
    width: auto;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 10px;
  }
  .footer-sources-label { justify-content: center; width: 100%; margin-bottom: 4px; }
  .footer-source-item {
    width: auto;
    padding: 2px 9px;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 20px;
  }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  .brand { font-size: 1.05rem; }
  .card, .post-card, .page-card { padding: 20px 20px; }
}

.scroll-top-btn {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s, background 0.2s ease;
  z-index: 500;
}
.scroll-top-btn svg { width: 18px; height: 18px; }
.scroll-top-btn.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.scroll-top-btn:hover { background: var(--red-dark); }

@media (max-width: 600px) {
  .scroll-top-btn { right: 14px; bottom: 14px; width: 38px; height: 38px; }
}

/* ---------------------------------------------------------------------
   Category digest (topic-based grouping, added alongside .outlet-box)
--------------------------------------------------------------------- */
.post-summary {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-2);
  margin: 0 0 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-soft);
}

.category-box.outlet-box { flex-direction: column; }

.category-box .outlet-side {
  flex-direction: row;
  width: 100%;
  flex: 0 0 auto;
  border-right: none;
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
}

.category-box .outlet-name {
  writing-mode: horizontal-tb;
  transform: none;
  font-size: 1rem;
  white-space: normal;
}

.category-box .outlet-items { padding: 6px 46px 22px 20px; }

@media (max-width: 620px) {
  .category-box .outlet-items { padding: 6px 20px 18px; }
}

.category-priority-badge {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.category-hint {
  font-size: 0.7rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  margin: 14px 0 10px;
}

.category-box .outlet-items li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.category-box .outlet-items li > div:first-child { flex: 1 1 auto; min-width: 0; }

.story-summary {
  color: var(--text-2);
  font-size: 0.85rem;
  line-height: 1.55;
  margin: 4px 0 0;
}

.story-icons {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  align-items: flex-start;
  flex-wrap: wrap;
  max-width: 130px;
  justify-content: flex-end;
  margin-top: 2px;
}

.story-icons a {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  flex: none;
}

.story-icons img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }

@media (max-width: 620px) {
  .category-box .outlet-items li { flex-direction: column; }
  .story-icons { max-width: none; justify-content: flex-start; margin-top: 6px; }
}

/* Small, faded list of covered outlets under the "Read full digest" link
   on the latest-digest featured card (home page + top of News Portal page). */
.card-sources {
  margin: 12px 0 0;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--text-3);
  opacity: 0.75;
  font-weight: 500;
}

.footer-email-link { text-decoration: none; }
.footer-email-link:hover { color: #fff; text-decoration: underline; }

/* Newsletter signup (Buttondown embed form) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.newsletter-signup {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px 20px;
  margin: 0 0 28px;
}
.newsletter-signup-title {
  margin: 0 0 6px;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text);
}
.newsletter-signup-desc {
  margin: 0 0 16px;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text-2);
  max-width: 560px;
}
.newsletter-signup-form {
  display: flex;
  gap: 8px;
  max-width: 480px;
}
.newsletter-signup-input {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}
.newsletter-signup-btn {
  flex: none;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}
.newsletter-signup-btn:hover { background: var(--red-dark); }
.newsletter-signup-btn:disabled { opacity: 0.6; cursor: wait; }
.newsletter-signup-status {
  margin: 10px 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-3);
  min-height: 1.2em;
}
.newsletter-signup--footer {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.newsletter-signup--footer .newsletter-signup-desc { color: var(--text-3); margin-left: auto; margin-right: auto; }
.newsletter-signup--footer .newsletter-signup-status { text-align: center; }
@media (max-width: 560px) {
  .newsletter-signup-form { flex-direction: column; }
  .newsletter-signup-btn { width: 100%; }
}
