/* ============================================================
   DataLab.AffluenceQ — Extended Sections (Rural / Household /
   Markets / Public Finance / World)
   Self-contained styling, prefixed dq-, matching the site's
   black + white + gold design system.
   ============================================================ */

.dq-section {
  padding: 6rem 1.5rem 4rem;
  max-width: 1440px;
  margin: 0 auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  scroll-margin-top: 90px;
}
@media (min-width: 1024px) {
  .dq-section { padding: 7rem 2.5rem 5rem; }
}

/* --- Section header --- */
.dq-kicker {
  font-family: var(--font-sans, "Inter", system-ui, sans-serif);
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: hsl(43, 74%, 55%);
  margin: 0 0 1rem;
}
.dq-title {
  font-family: var(--font-serif, "Playfair Display", Georgia, serif);
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 600;
  line-height: 1.12;
  color: #fff;
  margin: 0 0 1.1rem;
  letter-spacing: -0.01em;
}
.dq-desc {
  font-family: var(--font-sans, "Inter", system-ui, sans-serif);
  font-size: 1.06rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.62);
  max-width: 46rem;
  margin: 0 0 3rem;
}

/* --- Stat grid --- */
.dq-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
@media (min-width: 640px)  { .dq-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .dq-grid.dq-cols-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .dq-grid.dq-cols-4 { grid-template-columns: repeat(4, 1fr); } }

.dq-card {
  position: relative;
  background: #000;
  padding: 1.9rem 1.7rem 1.6rem;
  transition: background 0.35s ease;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.dq-card:hover { background: #0b0b0b; }

/* --- Top-right source badge (LocationQ pattern) ---
   Text is derived from the card's own declared src — never invented. */
.dq-src-badge {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  font-family: var(--font-sans, "Inter", system-ui, sans-serif);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: hsl(43, 74%, 55%);
  border: 1px solid hsla(43, 74%, 55%, 0.45);
  background: rgba(0, 0, 0, 0.35);
  border-radius: 5px;
  padding: 4px 9px;
  white-space: nowrap;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dq-src-badge.dq-src-assumed {
  color: rgba(255, 255, 255, 0.55);
  border-color: rgba(255, 255, 255, 0.3);
}

.dq-card-label {
  font-family: var(--font-sans, "Inter", system-ui, sans-serif);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.48);
  padding-right: 4.5rem; /* keep clear of the source badge */
}
.dq-card-value {
  font-family: var(--font-serif, "Playfair Display", Georgia, serif);
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
  font-weight: 600;
  line-height: 1.1;
  color: #fff;
}
.dq-card-value .dq-unit {
  font-size: 0.55em;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  margin-left: 0.3rem;
}
.dq-card-sub {
  font-family: var(--font-sans, "Inter", system-ui, sans-serif);
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.55);
}
.dq-card-delta {
  font-family: var(--font-sans, "Inter", system-ui, sans-serif);
  font-size: 0.85rem;
  font-weight: 600;
  color: hsl(43, 74%, 58%);
}
.dq-card-src {
  margin-top: auto;
  padding-top: 0.8rem;
  font-family: var(--font-sans, "Inter", system-ui, sans-serif);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* --- Benchmark history (period vs value) --- */
.dq-bench {
  margin-top: 0.4rem;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
}
.dq-bench-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 0;
  padding: 0.28rem 0;
  font-family: var(--font-sans, "Inter", system-ui, sans-serif);
  font-size: 0.82rem;
}
.dq-bench-row + .dq-bench-row {
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}
.dq-bench-period {
  color: rgba(255, 255, 255, 0.42);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.dq-bench-value {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 600;
  text-align: right;
}

/* --- Insight strip --- */
.dq-insight {
  margin-top: 2.2rem;
  padding: 1.1rem 1.4rem;
  border-left: 2px solid hsl(43, 74%, 45%);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-sans, "Inter", system-ui, sans-serif);
  font-size: 1rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.7);
}
.dq-insight strong {
  color: hsl(43, 74%, 58%);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* --- Entrance animation --- */
.dq-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.dq-reveal.dq-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Change chips: green up / red down / grey flat --- */
.dq-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 0.15rem;
}
.dq-chip {
  font-family: var(--font-sans, "Inter", system-ui, sans-serif);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.dq-chip .dq-chip-period {
  font-style: normal;
  font-weight: 500;
  opacity: 0.75;
  margin-left: 0.15rem;
}
.dq-chip.dq-up   { color: #3fbf6f; }
.dq-chip.dq-down { color: #e05252; }
.dq-chip.dq-flat { color: rgba(255, 255, 255, 0.45); }

/* --- Sparkline --- */
.dq-spark-wrap {
  margin-top: 0.5rem;
  line-height: 0;
}
.dq-spark { display: block; }

/* --- Gold top menu bar --- */
#root header {
  background: linear-gradient(100deg, hsl(43, 74%, 40%) 0%, hsl(41, 82%, 50%) 55%, hsl(36, 88%, 55%) 100%) !important;
  backdrop-filter: none !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.28) !important;
}
#root header a,
#root header span,
#root header button {
  color: rgba(0, 0, 0, 0.88) !important;
}
#root header [class*="bg-white"] {
  background-color: rgba(0, 0, 0, 0.85) !important;
}
#root header [class*="border-white"] {
  border-color: rgba(0, 0, 0, 0.22) !important;
}
#root header a:hover {
  color: #000 !important;
}


/* --- Mobile menu panel --- */
.dq-mobile-menu {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  z-index: 99;
  display: none;
  flex-direction: column;
  padding: 0.9rem 1.5rem 1.3rem;
  background: rgba(6, 6, 6, 0.98);
  border-bottom: 2px solid hsl(43, 74%, 45%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}
.dq-mobile-menu.dq-open { display: flex; }
@media (min-width: 1024px) {
  .dq-mobile-menu { display: none !important; }
}
.dq-mobile-link {
  font-family: var(--font-sans, "Inter", system-ui, sans-serif);
  font-size: 1.05rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 0.7rem 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  transition: color 0.2s ease, padding-left 0.2s ease;
}
.dq-mobile-link:last-child { border-bottom: none; }
.dq-mobile-link:hover,
.dq-mobile-link:active {
  color: hsl(43, 74%, 58%);
  padding-left: 0.6rem;
}

/* --- Footer layout fixes --- */
#root footer [class*="justify-between"] {
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 1.1rem !important;
}
#root footer [class*="justify-between"] p {
  max-width: 46rem;
}

/* ============================================================
   Uniform section headers — bundle sections (#economy, #upi,
   #cards, #work) get the exact dq-kicker / dq-title / dq-desc
   styling so every section header on the page looks identical.
   ============================================================ */
#economy span[class*="tracking-[0.2em]"][class*="uppercase"],
#upi span[class*="tracking-[0.2em]"][class*="uppercase"],
#cards span[class*="tracking-[0.2em]"][class*="uppercase"],
#work span[class*="tracking-[0.2em]"][class*="uppercase"] {
  font-family: var(--font-sans, "Inter", system-ui, sans-serif) !important;
  font-size: 0.78rem !important;
  letter-spacing: 0.28em !important;
  text-transform: uppercase;
  color: hsl(43, 74%, 55%) !important;
  margin: 0 0 1rem !important;
}
#economy h2[class*="font-serif"],
#upi h2[class*="font-serif"],
#cards h2[class*="font-serif"],
#work h2[class*="font-serif"] {
  font-family: var(--font-serif, "Playfair Display", Georgia, serif) !important;
  font-size: clamp(2rem, 4.5vw, 3.4rem) !important;
  font-weight: 600 !important;
  line-height: 1.12 !important;
  color: #fff !important;
  margin: 0 0 1.1rem !important;
  letter-spacing: -0.01em !important;
}
#economy p[class*="max-w-lg"],
#upi p[class*="max-w-lg"],
#cards p[class*="max-w-lg"],
#work p[class*="max-w-lg"] {
  font-family: var(--font-sans, "Inter", system-ui, sans-serif) !important;
  font-size: 1.06rem !important;
  line-height: 1.7 !important;
  color: rgba(255, 255, 255, 0.62) !important;
  max-width: 46rem !important;
}

/* --- Uniform section blocks: same 1440px centered container,
       same padding rhythm and divider as .dq-section, so the
       left edges of every block on the page align exactly --- */
#economy, #upi, #cards, #work {
  max-width: 1440px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 6rem 1.5rem 4rem !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  scroll-margin-top: 90px;
}
@media (min-width: 1024px) {
  #economy, #upi, #cards, #work {
    padding: 7rem 2.5rem 5rem !important;
  }
}
