/* ═══════════════════════════════════════════════════════════════
   dhivehiNews.com v2 — "Midnight Editorial" Design System
   A refined dark editorial theme with teal accents
   ═══════════════════════════════════════════════════════════════ */

/* ─── Design Tokens ─── */
:root {
  color-scheme: dark;

  /* Typography */
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, monospace;

  /* Surfaces */
  --bg:          #08090d;
  --bg-raised:   #0e1017;
  --bg-card:     #12141c;
  --bg-hover:    #181b25;

  /* Borders & Dividers */
  --border:      rgba(255, 255, 255, 0.07);
  --border-hover:rgba(255, 255, 255, 0.14);
  --divider:     rgba(255, 255, 255, 0.05);

  /* Text */
  --text:        #eaedf3;
  --text-secondary: rgba(234, 237, 243, 0.68);
  --text-muted:  rgba(234, 237, 243, 0.42);

  /* Accent — Teal / Emerald */
  --accent:       #2dd4a8;
  --accent-hover: #5eead4;
  --accent-dim:   rgba(45, 212, 168, 0.12);
  --accent-glow:  rgba(45, 212, 168, 0.25);

  /* Danger / Live */
  --live:         #ef4444;
  --live-dim:     rgba(239, 68, 68, 0.15);

  /* Radii */
  --r-sm:  8px;
  --r-md:  14px;
  --r-lg:  22px;
  --r-xl:  32px;
  --r-full:999px;

  /* Shadows */
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.25);
  --shadow-md:  0 8px 30px rgba(0,0,0,0.35);
  --shadow-lg:  0 20px 60px rgba(0,0,0,0.45);
  --shadow-glow:0 0 40px var(--accent-glow);

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 150ms var(--ease);
  --t-norm: 280ms var(--ease);
  --t-slow: 450ms var(--ease);

  /* Layout */
  --shell: min(1280px, 92%);
  --gap:  1.25rem;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle ambient glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 60% 50% at 15% 10%, rgba(45,212,168,0.06), transparent),
    radial-gradient(ellipse 50% 40% at 85% 80%, rgba(45,212,168,0.04), transparent);
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; border: none; cursor: pointer; background: none; }

/* ─── Focus ─── */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ─── Shell (Container) ─── */
.shell {
  width: var(--shell);
  max-width: 100%;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2rem);
}

/* ═══════════════════════════════════════════════════════════════
   HEADER / MASTHEAD
   ═══════════════════════════════════════════════════════════════ */
.masthead {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 9, 13, 0.82);
  backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--divider);
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.brand-title {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
}

.brand-title span {
  color: var(--accent);
}

.masthead-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.masthead-link {
  padding: 0.4rem 0.75rem;
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--t-fast), background var(--t-fast);
  letter-spacing: 0.02em;
}

.masthead-link:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

/* ═══════════════════════════════════════════════════════════════
   HERO / FEATURED SECTION
   ═══════════════════════════════════════════════════════════════ */
.hero-section {
  margin-top: clamp(1.25rem, 3vw, 2.5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--gap);
  min-height: 380px;
}

/* Main hero card (first article) */
.hero-main {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: border-color var(--t-norm);
}

.hero-main:hover {
  border-color: var(--border-hover);
}

.hero-main .hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity var(--t-slow), transform var(--t-slow);
}

.hero-main:hover .hero-img {
  opacity: 1;
  transform: scale(1.03);
}

.hero-main .hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    rgba(8, 9, 13, 0.95) 0%,
    rgba(8, 9, 13, 0.5) 40%,
    rgba(8, 9, 13, 0.1) 100%
  );
  z-index: 1;
}

.hero-main .hero-content {
  position: relative;
  z-index: 2;
  padding: clamp(1.25rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.hero-main .hero-content .story-category {
  align-self: flex-start;
}

.hero-main .hero-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}

.hero-main .hero-title a:hover {
  color: var(--accent);
}

.hero-main .hero-excerpt {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Side stack (2nd & 3rd articles) */
.hero-side {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.hero-side-card {
  position: relative;
  flex: 1;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: border-color var(--t-norm), transform var(--t-norm);
}

.hero-side-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
}

.hero-side-card .hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.75;
  transition: opacity var(--t-slow), transform var(--t-slow);
}

.hero-side-card:hover .hero-img {
  opacity: 0.9;
  transform: scale(1.05);
}

.hero-side-card .hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(8,9,13,0.92) 0%, rgba(8,9,13,0.3) 60%, transparent 100%);
  z-index: 1;
}

.hero-side-card .hero-content {
  position: relative;
  z-index: 2;
  padding: clamp(1rem, 2vw, 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.hero-side-card .hero-title {
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
}

.hero-side-card .hero-title a:hover {
  color: var(--accent);
}

/* Hero fallback when no image */
.hero-main.no-image,
.hero-side-card.no-image {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(45,212,168,0.05) 100%);
}

.hero-main.no-image .hero-content,
.hero-side-card.no-image .hero-content {
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════
   STATS BAR
   ═══════════════════════════════════════════════════════════════ */
.stats-bar {
  margin-top: clamp(1rem, 2.5vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.25rem;
  border-radius: var(--r-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.stats-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.stat-pill strong {
  color: var(--text);
  font-weight: 600;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 8px var(--live);
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* ═══════════════════════════════════════════════════════════════
   CATEGORY FILTER
   ═══════════════════════════════════════════════════════════════ */
.filter-section {
  margin-top: clamp(1.25rem, 3vw, 2rem);
}

.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

.filter-active {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
}

.category-scroll {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.chip {
  padding: 0.5rem 1rem;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: all var(--t-fast);
  cursor: pointer;
}

.chip:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: rgba(255,255,255,0.03);
}

.chip.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 4px 16px var(--accent-glow);
}

/* ═══════════════════════════════════════════════════════════════
   FEED / ARTICLE GRID
   ═══════════════════════════════════════════════════════════════ */
.feed-section {
  margin-top: clamp(1.5rem, 4vw, 3rem);
}

.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.feed-title {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text);
}

.feed-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.4rem 0.85rem;
  border-radius: var(--r-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.feed-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* Article Grid */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--gap);
}

/* ─── Story Card ─── */
.story-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform var(--t-norm), border-color var(--t-norm), box-shadow var(--t-norm);
}

.story-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

/* Card with image */
.story-card.has-media {
  position: relative;
}

.story-card .card-image-wrap {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: var(--bg-raised);
}

.story-card .card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
}

.story-card:hover .card-image-wrap img {
  transform: scale(1.06);
}

.story-card .card-image-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(8,9,13,0.4) 100%);
}

/* Card without image — use CSS background */
.story-card.has-media.css-bg::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  background-image: var(--card-image, none);
  background-size: cover;
  background-position: center;
  opacity: 0.9;
  transition: opacity var(--t-slow), transform var(--t-slow);
}

.story-card.has-media.css-bg:hover::before {
  opacity: 1;
  transform: scale(1.05);
}

.story-card.has-media.css-bg::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(180deg, transparent 40%, rgba(8,9,13,0.5) 100%);
}

/* Card body */
.story-body {
  padding: 1.15rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}

.story-card.has-media.css-bg .story-body {
  margin-top: 140px;
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  margin-top: 160px;
  padding-top: 1rem;
}

.story-category {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--r-sm);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: var(--accent-dim);
  color: var(--accent);
  align-self: flex-start;
  border: 1px solid rgba(45,212,168,0.15);
}

.story-title {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

.story-title a {
  color: var(--text);
  transition: color var(--t-fast);
}

.story-title a:hover {
  color: var(--accent);
}

.story-excerpt {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--divider);
}

.story-meta time {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* ═══════════════════════════════════════════════════════════════
   LOADER / SENTINEL
   ═══════════════════════════════════════════════════════════════ */
.feed-loader {
  margin: 2.5rem auto 1rem;
  text-align: center;
  color: var(--text-muted);
  display: none;
}

.feed-loader.active { display: block; }

.loader-ring {
  width: 36px;
  height: 36px;
  margin: 0 auto 0.5rem;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.sentinel { width: 100%; height: 1px; }

/* ═══════════════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════════════ */
.pager {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  transition: all var(--t-fast);
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 20px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-ghost {
  border-color: var(--border);
  color: var(--text-secondary);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: rgba(255,255,255,0.03);
}

.btn-small {
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
}

.btn svg {
  width: 16px;
  height: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
.site-footer {
  margin-top: 5rem;
  padding: 2.5rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--divider);
}

/* ═══════════════════════════════════════════════════════════════
   ARTICLE PAGE
   ═══════════════════════════════════════════════════════════════ */

/* Reading progress bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 999;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  box-shadow: 0 0 12px var(--accent-glow);
  transition: width 60ms linear;
}

/* Article stage */
main.article-stage {
  margin-top: clamp(1.5rem, 5vw, 3rem);
  display: grid;
  gap: 1.5rem;
}

main.article-stage > article {
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
}

/* Article header */
.article-header-panel {
  text-align: center;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
}

.article-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.brand-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--r-full);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  color: var(--text-secondary);
}

.pill-live {
  border-color: rgba(239,68,68,0.3);
  background: var(--live-dim);
  color: var(--text);
}

.article-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  background: var(--accent-dim);
  margin-bottom: 0.75rem;
}

.article-title {
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  margin: 0.6rem 0 0.75rem;
  color: var(--text);
}

.article-meta {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.82rem;
}

/* Hero image */
.article-hero {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.article-hero img {
  width: 100%;
  height: min(55vh, 480px);
  object-fit: cover;
  display: block;
}

.article-hero-badge {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  z-index: 2;
}

/* Article body */
.article-body {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  padding: clamp(1.5rem, 4vw, 2.75rem);
  line-height: 1.85;
}

.article-body p,
.article-body li {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.88);
}

.article-body p {
  margin-bottom: 1.3rem;
}

.article-body h2,
.article-body h3,
.article-body h4 {
  margin-top: 2rem;
  margin-bottom: 0.85rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

.article-body blockquote {
  margin: 1.8rem 0;
  padding: 1.2rem 1.5rem;
  border-radius: var(--r-md);
  background: var(--accent-dim);
  border-left: 4px solid var(--accent);
  color: var(--text);
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body a:hover {
  color: var(--accent-hover);
}

/* Gallery */
.article-gallery {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
}

.gallery-title {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
}

.gallery-item {
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: border-color var(--t-fast), transform var(--t-fast);
}

.gallery-item:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.gallery-item figure {
  margin: 0;
  cursor: zoom-in;
}

.gallery-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  transition: transform var(--t-slow);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item figcaption {
  padding: 0.6rem 0.85rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Inline images */
.article-inline-image {
  margin: 1.8rem 0;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  cursor: zoom-in;
  transition: border-color var(--t-fast);
}

.article-inline-image:hover {
  border-color: var(--border-hover);
}

.article-inline-image img {
  width: 100%;
  height: auto;
  display: block;
}

.article-inline-image figcaption {
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Callout */
.callout {
  margin-top: 2rem;
  padding: 1.3rem 1.5rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(45,212,168,0.04), rgba(45,212,168,0.01));
}

.callout strong {
  display: block;
  margin-bottom: 0.4rem;
  letter-spacing: 0.2em;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.return-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: 0.85rem;
  transition: color var(--t-fast);
}

.return-link:hover {
  color: var(--accent-hover);
}

.return-link svg {
  width: 16px;
  height: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   LIGHTBOX
   ═══════════════════════════════════════════════════════════════ */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease);
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-frame {
  position: relative;
  max-width: min(90vw, 1100px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  color: #fff;
}

.lightbox-frame img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
}

.lightbox-caption {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.8);
  letter-spacing: 0.06em;
  text-align: center;
}

.lightbox-close,
.lightbox-control {
  position: absolute;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background var(--t-fast);
}

.lightbox-close:hover,
.lightbox-control:hover {
  background: rgba(0, 0, 0, 0.85);
}

.lightbox-close { top: -1.5rem; right: -1.5rem; }
.lightbox-control.prev { left: -60px; top: 50%; transform: translateY(-50%); }
.lightbox-control.next { right: -60px; top: 50%; transform: translateY(-50%); }
.lightbox-disabled { opacity: 0.35; pointer-events: none; }

/* ═══════════════════════════════════════════════════════════════
   DHIVEHI SCRIPTS
   ═══════════════════════════════════════════════════════════════ */
.dhivehi-text,
.dhivehi-paragraph {
  font-family: "mv-faseyha", "MV Faseyha", "Faruma", var(--sans);
  direction: rtl;
  text-align: right;
}

.dhivehi-heading {
  font-family: "MV Eamaan XP", "mv-waheed", "MV Waheed", var(--sans);
  direction: rtl;
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════════
   MOSAIC GRID
   ═══════════════════════════════════════════════════════════════ */
.mozi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  width: 100%;
  height: 100%;
  min-height: 300px;
  background: #000;
  border-radius: var(--r-xl);
  overflow: hidden;
  position: relative;
}

.mozi-item {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  opacity: 0.8;
  transition: opacity var(--t-norm), transform var(--t-norm);
}

.mozi-item:hover {
  opacity: 1;
  z-index: 2;
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

.mozi-thumb {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s var(--ease);
}

.mozi-item:hover .mozi-thumb {
  transform: scale(1.1);
}

/* ═══════════════════════════════════════════════════════════════
   BROWSE TOPICS (Article page bottom)
   ═══════════════════════════════════════════════════════════════ */
.browse-section {
  margin-top: 3rem;
}

.browse-panel {
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
}

.browse-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ═══════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
}

.empty-state .empty-label {
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-main {
    min-height: 280px;
  }

  .hero-side {
    flex-direction: row;
  }

  .hero-side-card {
    min-height: 200px;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .story-title {
    font-size: 1.2rem;
  }

  .masthead-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .article-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .article-body {
    padding: 1.25rem;
  }

  .mozi-grid {
    grid-template-columns: repeat(3, 1fr);
    min-height: 250px;
  }
}

@media (max-width: 540px) {
  .hero-side {
    flex-direction: column;
  }

  .category-scroll {
    padding-bottom: 0.5rem;
  }

  .article-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .stats-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .mozi-grid {
    grid-template-columns: repeat(2, 1fr);
    min-height: 200px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.story-card {
  animation: fadeInUp 0.5s var(--ease) both;
}

.story-card:nth-child(1) { animation-delay: 0.05s; }
.story-card:nth-child(2) { animation-delay: 0.1s; }
.story-card:nth-child(3) { animation-delay: 0.15s; }
.story-card:nth-child(4) { animation-delay: 0.2s; }
.story-card:nth-child(5) { animation-delay: 0.25s; }
.story-card:nth-child(6) { animation-delay: 0.3s; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* Selection */
::selection {
  background: rgba(45,212,168,0.25);
  color: var(--text);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .story-card:hover { transform: none; }
}
