/* ═══════════════════════════════════════════════════════════════
   phrma.in Design System
   Adapted from phrma.org — India's pharmaceutical industry showcase
   ═══════════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  /* Navy palette (from phrma.org #152535 family) */
  --navy-900: #0A1628;
  --navy-800: #0F2439;
  --navy-700: #152535;
  --navy-600: #1E344B;
  --navy-500: #2A4A66;

  /* Saffron accent (Indian identity — replaces phrma.org's magenta) */
  --saffron-600: #C05621;
  --saffron-500: #E8621C;
  --saffron-400: #F08C3A;
  --saffron-300: #FBBF6E;

  /* Blues for data */
  --blue-700: #1D4ED8;
  --blue-600: #2563EB;
  --blue-500: #3B82F6;
  --blue-400: #60A5FA;
  --blue-300: #93C5FD;
  --blue-200: #BFDBFE;

  /* Greens */
  --green-600: #059669;
  --green-500: #10B981;

  /* Reds */
  --red-500: #EF4444;

  /* Neutrals */
  --gray-50:  #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;

  --white: #FFFFFF;

  /* Chart palette */
  --chart-1: #2563EB;
  --chart-2: #E8621C;
  --chart-3: #059669;
  --chart-4: #8B5CF6;
  --chart-5: #EC4899;
  --chart-6: #F59E0B;

  /* Category colors */
  --cat-medicines: #2563EB;
  --cat-ingredients: #E8621C;
  --cat-surgical: #059669;
  --cat-herbal: #8B5CF6;

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;

  /* Layout */
  --max-w: 1200px;
  --max-w-narrow: 900px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--navy-600);
  line-height: 1.6;
  font-weight: 400;
  background: var(--white);
}

a { color: var(--saffron-500); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--saffron-600); }

img { max-width: 100%; display: block; }

/* ── Typography ─────────────────────────────────────────────── */
.t-hero {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.t-h1 {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.t-h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 300;
  line-height: 1.2;
}

.t-h3 {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.3;
}

.t-body { font-size: 1.0625rem; font-weight: 300; line-height: 1.7; letter-spacing: 0.01em; }
.t-small { font-size: 0.875rem; font-weight: 400; line-height: 1.5; }
.t-caption { font-size: 0.75rem; font-weight: 400; line-height: 1.4; color: var(--gray-500); }
.t-label { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gray-400); }

.t-stat {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--navy-800);
}

.t-stat-label {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
  margin-top: var(--sp-1);
}

/* ── Layout ─────────────────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--sp-6); }
.container--narrow { max-width: var(--max-w-narrow); }

.section { padding: var(--sp-16) 0; }
.section--alt { background: var(--gray-50); }
.section--dark { background: var(--navy-800); color: var(--white); }

.section__title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-400);
  margin-bottom: var(--sp-4);
}

.section__title--light { color: rgba(255,255,255,0.5); }

/* ── Site Header ────────────────────────────────────────────── */
.site-header {
  background: var(--navy-800);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  color: var(--white);
}

.site-header__logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-header__logo span { color: var(--saffron-400); }

.site-header__tagline {
  font-size: 0.75rem;
  font-weight: 300;
  color: rgba(255,255,255,0.5);
  border-left: 1px solid rgba(255,255,255,0.15);
  padding-left: var(--sp-3);
  display: none;
}

@media (min-width: 768px) {
  .site-header__tagline { display: block; }
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
}

.site-header__nav a {
  color: rgba(255,255,255,0.7);
  font-size: 0.875rem;
  font-weight: 400;
  transition: color 0.2s var(--ease);
  text-decoration: none;
}

.site-header__nav a:hover,
.site-header__nav a.active { color: var(--white); }

/* ── Hero (Country Page) ────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-700) 50%, var(--navy-600) 100%);
  color: var(--white);
  padding: var(--sp-12) 0 var(--sp-10);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(232,98,28,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero__eyebrow {
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--saffron-400);
  margin-bottom: var(--sp-3);
}

.hero__title {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 300;
  line-height: 1.1;
  margin-bottom: var(--sp-4);
}

.hero__title strong { font-weight: 600; }

.hero__subtitle {
  font-size: 1.0625rem;
  font-weight: 300;
  color: rgba(255,255,255,0.7);
  max-width: 600px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: var(--sp-2) var(--sp-4);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--white);
  margin-top: var(--sp-4);
}

.hero__dual-note {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.55);
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid rgba(255,255,255,0.1);
  line-height: 1.5;
}

.hero__dual-note strong { font-weight: 500; color: rgba(255,255,255,0.8); }

/* ── Stat Cards ─────────────────────────────────────────────── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  border-bottom: 1px solid var(--gray-200);
}

.stat-card {
  padding: var(--sp-6) var(--sp-5);
  text-align: center;
  border-right: 1px solid var(--gray-200);
}

.stat-card:last-child { border-right: none; }

@media (max-width: 640px) {
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .stat-card { border-bottom: 1px solid var(--gray-200); }
  .stat-card:nth-child(2) { border-right: none; }
}

/* ── Context Line ───────────────────────────────────────────── */
.context-line {
  padding: var(--sp-6) 0;
  font-size: 1rem;
  font-style: italic;
  font-weight: 300;
  color: var(--gray-600);
  line-height: 1.7;
  border-bottom: 1px solid var(--gray-200);
}

/* ── Chart Sections ─────────────────────────────────────────── */
.chart-section {
  padding: var(--sp-10) 0;
}

.chart-section + .chart-section { border-top: 1px solid var(--gray-100); }

.chart-section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
}

.chart-section__title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-400);
}

.chart-section__note {
  font-size: 0.75rem;
  color: var(--gray-400);
}

.chart-wrap {
  position: relative;
  width: 100%;
}

.chart-wrap--trend { height: 320px; }
.chart-wrap--category { height: 280px; }
.chart-wrap--products { height: 300px; }
.chart-wrap--odi { height: 260px; }

@media (max-width: 768px) {
  .chart-wrap--trend { height: 250px; }
  .chart-wrap--category { height: 220px; }
  .chart-wrap--products { height: 260px; }
  .chart-wrap--odi { height: 220px; }
}

/* ── Two-Column Grid ────────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-10);
}

@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; gap: var(--sp-8); }
}

/* ── Category Detail Pills ──────────────────────────────────── */
.cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  margin-top: var(--sp-4);
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.8125rem;
}

.cat-pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cat-pill__name { color: var(--gray-600); font-weight: 400; }
.cat-pill__val { color: var(--navy-800); font-weight: 600; }
.cat-pill__pct { color: var(--gray-400); font-weight: 400; }

/* ── ODI Section ────────────────────────────────────────────── */
.odi-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--sp-8);
  align-items: start;
}

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

.odi-detail__stat {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--navy-800);
  margin-bottom: var(--sp-3);
}

.odi-detail__companies {
  font-size: 0.8125rem;
  color: var(--gray-500);
  line-height: 1.7;
}

/* ── Site Footer ────────────────────────────────────────────── */
.site-footer {
  background: var(--navy-900);
  color: rgba(255,255,255,0.5);
  padding: var(--sp-10) 0 var(--sp-8);
}

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--sp-8);
}

.site-footer__brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
}

.site-footer__brand span { color: var(--saffron-400); }

.site-footer__sources {
  font-size: 0.75rem;
  line-height: 1.7;
  max-width: 500px;
}

.site-footer__links {
  display: flex;
  gap: var(--sp-6);
}

.site-footer__links a {
  color: rgba(255,255,255,0.5);
  font-size: 0.8125rem;
  transition: color 0.2s var(--ease);
}

.site-footer__links a:hover { color: var(--white); }

.site-footer__copyright {
  width: 100%;
  text-align: center;
  padding-top: var(--sp-8);
  margin-top: var(--sp-8);
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.6875rem;
}

/* ── Landing Page ───────────────────────────────────────────── */
.landing-hero {
  background: linear-gradient(135deg, var(--navy-800) 0%, #0D2847 50%, var(--navy-600) 100%);
  color: var(--white);
  padding: var(--sp-20) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.landing-hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(232,98,28,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.landing-hero__stat {
  font-size: clamp(4rem, 10vw, 7rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: var(--sp-6) 0;
  background: linear-gradient(135deg, var(--white) 0%, var(--saffron-300) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 300;
  color: rgba(255,255,255,0.65);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.landing-hero__source {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  margin-top: var(--sp-4);
}

/* Section cards */
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-6);
}

.section-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: var(--sp-8);
  transition: all 0.3s var(--ease);
  text-decoration: none;
  color: inherit;
  display: block;
}

.section-card:hover {
  border-color: var(--saffron-400);
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
  transform: translateY(-2px);
  color: inherit;
}

.section-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: var(--sp-5);
}

.section-card__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--navy-800);
  margin-bottom: var(--sp-2);
}

.section-card__desc {
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--gray-500);
  line-height: 1.6;
}

.section-card__count {
  margin-top: var(--sp-4);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--saffron-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Pill / tag */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--gray-100);
  border-radius: 20px;
  padding: var(--sp-1) var(--sp-3);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray-600);
}

.pill--soon {
  background: var(--saffron-300);
  color: var(--navy-800);
}

.pill--live {
  background: #D1FAE5;
  color: var(--green-600);
}

/* ── Print-Safe Overrides ───────────────────────────────────── */
@media print {
  .site-header, .site-footer { display: none; }
  body { font-size: 12px; margin: 0; padding: 0; }
  .container { padding: 0 16px; }
  .hero { padding: 12px 0 8px; }
  .hero__eyebrow { font-size: 0.65rem; margin-bottom: 4px; }
  .hero__title { font-size: 1.6rem; margin-bottom: 4px; }
  .hero__subtitle { font-size: 0.75rem; line-height: 1.4; }
  .hero__badge { margin-top: 6px; padding: 3px 8px; font-size: 0.6rem; gap: 4px; }
  .hero__dual-note { margin-top: 6px; padding-top: 6px; font-size: 0.6rem; line-height: 1.4; }
  .stats-bar { border-bottom: 1px solid #ddd; }
  .stat-card { padding: 8px 6px; }
  .t-stat { font-size: 1.2rem; }
  .t-stat-label { font-size: 0.5rem; letter-spacing: 0.04em; }
  .source-tag { font-size: 0.45rem; padding: 1px 4px; }
  .context-line { padding: 6px 0; font-size: 0.7rem; line-height: 1.4; }
  .chart-section { padding: 8px 0; }
  .chart-section + .chart-section { border-top: 1px solid #eee; }
  .chart-section__header { margin-bottom: 4px; }
  .chart-section__title { font-size: 0.6rem; }
  .chart-section__note { font-size: 0.55rem; }
  .chart-wrap--trend { height: 150px; }
  .chart-wrap--category { height: 130px; }
  .chart-wrap--products { height: 170px; }
  .chart-wrap--odi { height: 140px; }
  .cat-pills { margin-top: 4px; gap: 2px 8px; }
  .cat-pill { font-size: 0.6rem; }
  .two-col { gap: 12px; }
  .odi-grid { gap: 10px; }
  .odi-detail__stat { font-size: 0.8rem; margin-bottom: 4px; }
  .odi-detail__companies { font-size: 0.6rem; line-height: 1.5; }
  .t-small { font-size: 0.65rem; }
  .section { padding: 12px 0; }
  .donut-wrap { max-width: 160px !important; height: 160px !important; }
  .chart-section, .odi-grid {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .chart-section__header, .chart-section__title {
    break-after: avoid;
    page-break-after: avoid;
  }
}

/* ── Utility ────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.text-center { text-align: center; }
.text-saffron { color: var(--saffron-500); }
.text-muted { color: var(--gray-500); }
.fw-300 { font-weight: 300; }
.fw-600 { font-weight: 600; }
.fw-800 { font-weight: 800; }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
