/* ════════════════════════════════════════════════════════════════
   Dawaadost — styling layered on Tailwind (CDN)
   Two per-market themes via channel RGB variables (rgb(var(--x) / a))
   ════════════════════════════════════════════════════════════════ */

/* India (default) — festive rani-pink + teal + violet on soft blush,
   with a marigold flourish. Deliberately vibrant and "fun". */
:root,
[data-market="in"] {
  --background: 255 244 248;
  --surface: 255 244 248;
  --surface-bright: 255 252 253;
  --surface-lowest: 255 255 255;
  --surface-low: 252 235 242;
  --surface-container: 250 224 236;
  --surface-high: 246 210 226;
  --surface-highest: 241 196 216;
  --surface-variant: 246 210 226;
  --ink: 58 13 41;
  --ink-soft: 122 59 91;
  --ink-faint: 174 124 149;
  --primary: 219 39 119;
  --primary-bright: 236 72 153;
  --on-primary: 255 255 255;
  --on-primary-container: 80 7 36;
  --primary-dim: 249 168 212;
  --primary-soft: 252 231 243;
  --secondary: 12 166 120;
  --secondary-deep: 8 110 79;
  --secondary-container: 195 250 232;
  --secondary-soft: 211 249 238;
  --secondary-dim: 99 230 190;
  --tertiary: 124 58 237;
  --on-tertiary: 255 255 255;
  --outline: 174 124 149;
  --outline-variant: 242 207 224;
  --ink-surface: 54 8 42;
  --ink-surface-bright: 78 19 64;
  --error: 201 42 42;
}

/* UK — cool blue / indigo-teal / coral on crisp white */
[data-market="uk"] {
  --background: 245 248 252;
  --surface: 245 248 252;
  --surface-bright: 252 253 255;
  --surface-lowest: 255 255 255;
  --surface-low: 238 244 251;
  --surface-container: 229 238 248;
  --surface-high: 218 230 244;
  --surface-highest: 205 221 239;
  --surface-variant: 205 221 239;
  --ink: 20 32 46;
  --ink-soft: 60 75 92;
  --ink-faint: 107 123 140;
  --primary: 25 113 194;
  --primary-bright: 34 139 230;
  --on-primary: 255 255 255;
  --on-primary-container: 10 37 64;
  --primary-dim: 165 216 255;
  --primary-soft: 208 235 255;
  --secondary: 12 166 120;
  --secondary-deep: 7 110 79;
  --secondary-container: 195 250 232;
  --secondary-soft: 211 249 238;
  --secondary-dim: 99 230 190;
  --tertiary: 255 107 87;
  --on-tertiary: 255 255 255;
  --outline: 107 123 140;
  --outline-variant: 194 212 232;
  --ink-surface: 22 32 43;
  --ink-surface-bright: 36 51 67;
  --error: 224 49 49;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: rgb(var(--background));
  color: rgb(var(--ink));
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.3s ease;
}

/* ── layout safety net ──────────────────────────────────────────
   The page styling comes from the Tailwind Play CDN, which generates
   utility classes at runtime and can be slow, rate-limited or blocked
   on the live host — when that happens the flex/grid stacks collapse
   (e.g. the brand and the "Most read" list flow inline). These rules
   mirror Tailwind's own structural utilities from the reliably-loaded
   stylesheet, so the layout holds regardless. They are harmless no-ops
   whenever the CDN has applied them. */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.block { display: block; }
.hidden { display: none; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-grow { flex-grow: 1; }
.shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-baseline { align-items: baseline; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 640px) {
  .sm\:flex { display: flex; }
  .sm\:inline { display: inline; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
  .md\:flex { display: flex; }
  .md\:hidden { display: none; }
}
@media (min-width: 1024px) {
  .lg\:block { display: block; }
  .lg\:flex { display: flex; }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .lg\:col-span-2 { grid-column: span 2 / span 2; }
  .lg\:col-span-4 { grid-column: span 4 / span 4; }
  .lg\:col-span-8 { grid-column: span 8 / span 8; }
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  vertical-align: middle;
  user-select: none;
}
.ms-fill { font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24; }

::selection { background: rgb(var(--primary-soft)); color: rgb(var(--primary)); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: rgb(var(--surface-low)); }
::-webkit-scrollbar-thumb { background: rgb(var(--outline-variant)); border-radius: 9999px; border: 3px solid rgb(var(--surface-low)); }
::-webkit-scrollbar-thumb:hover { background: rgb(var(--primary-dim)); }

a { text-decoration: none; color: inherit; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

#read-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, rgb(var(--primary-bright)), rgb(var(--primary)));
  z-index: 60; transition: width 0.08s linear;
}

.ad-hatch { background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgb(var(--ink) / 0.03) 10px, rgb(var(--ink) / 0.03) 20px); }

/* ── featured lead panel ─────────────────────────────────────── */
.featured-panel {
  background: linear-gradient(135deg, rgb(var(--surface-container) / 0.8), rgb(var(--surface-low) / 0.5));
  border: 1px solid rgb(var(--outline-variant) / 0.6);
}
.featured-panel:hover { border-color: rgb(var(--primary) / 0.5); }
/* India: festive pink → marigold flourish in the hero */
[data-market="in"] .featured-panel {
  background: linear-gradient(135deg, #fde4f1 0%, #ffe9c7 55%, #ffd6c2 100%);
  border-color: rgb(var(--primary) / 0.22);
}
.region-flag { font-size: 1.05rem; }

/* ── tabs ─────────────────────────────────────────────────────── */
.tablist { display: flex; flex-wrap: wrap; gap: 0.4rem; border-bottom: 1px solid rgb(var(--outline-variant) / 0.6); margin-bottom: 1rem; }
.tab-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0.9rem; border-radius: 0.6rem 0.6rem 0 0;
  font-weight: 600; font-size: 0.9rem; color: rgb(var(--ink-faint));
  border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  background: transparent; cursor: pointer; transition: 0.18s;
}
.tab-btn:hover { color: rgb(var(--primary)); }
.tab-btn.is-active { color: rgb(var(--primary)); border-bottom-color: rgb(var(--primary)); background: rgb(var(--primary) / 0.06); }

/* ── chips / medicine bits ────────────────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0.6rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: rgb(var(--surface-container)); color: rgb(var(--ink-soft)); }
.chip-use { background: rgb(var(--secondary-soft) / 0.7); color: rgb(var(--secondary-deep)); }
.med-points { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.5rem; }
.med-points li { position: relative; padding-left: 1.4rem; color: rgb(var(--ink-soft)); font-size: 0.95rem; line-height: 1.6; }
.med-points li::before { content: ""; position: absolute; left: 0.2rem; top: 0.6em; width: 0.45rem; height: 0.45rem; border-radius: 999px; background: rgb(var(--primary-bright)); }
.med-prose { font-size: 0.97rem; line-height: 1.72; color: rgb(var(--ink-soft)); }
.med-prose p + p { margin-top: 0.85em; }
.med-prose strong { color: rgb(var(--ink)); font-weight: 700; }
.med-prose em { font-style: italic; }
.med-prose a { color: rgb(var(--primary)); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

.med-chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.8rem; border-radius: 999px; background: rgb(var(--surface-lowest)); border: 1px solid rgb(var(--outline-variant) / 0.6); font-weight: 600; font-size: 0.85rem; color: rgb(var(--ink)); transition: 0.2s; }
.med-chip:hover { border-color: rgb(var(--tertiary)); color: rgb(var(--tertiary)); transform: translateY(-1px); }

/* ── BMI tool ─────────────────────────────────────────────────── */
.bmi-card { background: rgb(var(--surface-lowest)); border: 1px solid rgb(var(--outline-variant) / 0.6); border-radius: 1rem; padding: 1.5rem; box-shadow: 0 4px 18px -10px rgb(var(--ink) / 0.12); }
.bmi-field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; font-weight: 600; color: rgb(var(--ink-soft)); }
.bmi-field input { font-size: 1.05rem; font-weight: 500; color: rgb(var(--ink)); padding: 0.6rem 0.8rem; border: 1px solid rgb(var(--outline-variant)); border-radius: 0.6rem; background: rgb(var(--surface-bright)); outline: none; }
.bmi-field input:focus { border-color: rgb(var(--primary)); box-shadow: 0 0 0 3px rgb(var(--primary) / 0.12); }
.bmi-out { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid rgb(var(--outline-variant) / 0.5); text-align: center; }
.bmi-value { font-size: 2.6rem; font-weight: 800; line-height: 1; color: rgb(var(--primary)); letter-spacing: -0.02em; }
.bmi-cat { margin-top: 0.5rem; font-weight: 700; font-size: 0.95rem; color: rgb(var(--ink-faint)); display: inline-block; padding: 0.2rem 0.7rem; border-radius: 999px; }
.bmi-cat.cat-under { background: rgb(var(--secondary) / 0.12); color: rgb(var(--secondary-deep)); }
.bmi-cat.cat-healthy { background: rgb(var(--secondary) / 0.16); color: rgb(var(--secondary-deep)); }
.bmi-cat.cat-over { background: rgb(var(--primary) / 0.12); color: rgb(var(--primary)); }
.bmi-cat.cat-obese { background: rgb(var(--tertiary) / 0.14); color: rgb(var(--tertiary)); }
.bmi-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.bmi-table td { padding: 0.6rem 0.2rem; border-top: 1px solid rgb(var(--outline-variant) / 0.5); color: rgb(var(--ink-soft)); }
.bmi-table td:first-child { font-weight: 600; color: rgb(var(--ink)); }
.bmi-table td:last-child { text-align: right; white-space: nowrap; }
.bmi-table tr:first-child td { border-top: 0; }
.bmi-dot { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 999px; margin-right: 0.5rem; vertical-align: middle; }
.bmi-dot.cat-under { background: rgb(var(--secondary-dim)); }
.bmi-dot.cat-healthy { background: rgb(var(--secondary)); }
.bmi-dot.cat-over { background: rgb(var(--primary-bright)); }
.bmi-dot.cat-obese { background: rgb(var(--tertiary)); }
.bmi-analysis { margin-top: 1.25rem; padding: 1rem 1.1rem; border-radius: 0.75rem; background: rgb(var(--secondary-soft) / 0.35); border: 1px solid rgb(var(--secondary) / 0.2); }
.bmi-analysis[hidden] { display: none; }
.bmi-analysis h3 { display: flex; align-items: center; gap: 0.45rem; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: rgb(var(--secondary-deep)); margin: 0 0 0.5rem; }
.bmi-analysis p { font-size: 0.95rem; line-height: 1.65; color: rgb(var(--ink-soft)); margin: 0; }
.bmi-analysis p[hidden] { display: none; }

/* ── comparison table ─────────────────────────────────────────── */
.compare-wrap { overflow-x: auto; border: 1px solid rgb(var(--outline-variant) / 0.6); border-radius: 0.75rem; }
.compare { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 720px; }
.compare th { text-align: left; background: rgb(var(--surface-container)); color: rgb(var(--ink)); font-weight: 700; padding: 0.7rem 0.9rem; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.compare td { padding: 0.7rem 0.9rem; border-top: 1px solid rgb(var(--outline-variant) / 0.5); color: rgb(var(--ink-soft)); }
.compare tbody tr:hover { background: rgb(var(--primary) / 0.04); }
.pill-single, .pill-dual { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.pill-single { background: rgb(var(--secondary-soft) / 0.8); color: rgb(var(--secondary-deep)); }
.pill-dual { background: rgb(var(--tertiary) / 0.14); color: rgb(var(--tertiary)); }

/* ── share buttons ────────────────────────────────────────────── */
.share-btn { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.75rem; border-radius: 0.5rem; border: 1px solid rgb(var(--outline-variant) / 0.7); color: rgb(var(--ink-soft)); font-size: 0.875rem; background: transparent; cursor: pointer; transition: 0.2s; }
.share-btn:hover { border-color: rgb(var(--primary)); color: rgb(var(--primary)); }

/* ── article prose ────────────────────────────────────────────── */
.prose-article { color: rgb(var(--ink)); font-size: 1.05rem; line-height: 1.74; }
.prose-article > * + * { margin-top: 1.3em; }
.prose-article h2 { font-size: 1.4rem; font-weight: 700; line-height: 1.3; color: rgb(var(--ink)); margin-top: 2.1rem; letter-spacing: -0.01em; scroll-margin-top: 90px; }
.prose-article h3 { font-size: 1.15rem; font-weight: 700; line-height: 1.35; color: rgb(var(--ink)); margin-top: 1.5rem; }
.prose-article p { color: rgb(var(--ink-soft)); }
.prose-article .lead { font-size: 1.16rem; line-height: 1.6; color: rgb(var(--ink)); font-weight: 500; }
.prose-article strong { color: rgb(var(--ink)); font-weight: 700; }
.prose-article em { font-style: italic; }
.prose-article a { color: rgb(var(--primary)); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.prose-article ul { list-style: none; padding: 0; margin-top: 1.1em; display: flex; flex-direction: column; gap: 0.7em; }
.prose-article ul li { position: relative; padding-left: 1.7rem; color: rgb(var(--ink-soft)); }
.prose-article ul li::before { content: ""; position: absolute; left: 0.2rem; top: 0.62em; width: 0.5rem; height: 0.5rem; border-radius: 9999px; background: rgb(var(--primary-bright)); }

/* ── splash / region chooser ──────────────────────────────────── */
.splash {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  background: linear-gradient(135deg, #3a1d0b 0%, #6b2d0c 38%, #0c3a64 100%);
}
.splash-inner { width: 100%; max-width: 880px; text-align: center; animation: rise 0.6s cubic-bezier(0.22,1,0.36,1) both; }
.splash-brand { display: flex; align-items: center; justify-content: center; gap: 0.85rem; margin-bottom: 2.5rem; }
.splash-h1 { color: #fff; font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; }
.splash-p { color: rgba(255,255,255,0.82); margin-top: 0.6rem; font-size: 1.02rem; }
.choose-grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; margin-top: 2.25rem; }
@media (min-width: 640px) { .choose-grid { grid-template-columns: 1fr 1fr; } }
.choose-card { display: flex; flex-direction: column; gap: 0.3rem; align-items: flex-start; text-align: left; padding: 1.85rem; border-radius: 1.25rem; box-shadow: 0 18px 44px -14px rgba(0,0,0,0.5); border: 2px solid transparent; transition: 0.25s; }
.choose-card:hover { transform: translateY(-5px); box-shadow: 0 26px 50px -14px rgba(0,0,0,0.55); }
.choose-in { background: linear-gradient(150deg, #fff0f6 0%, #ffe3ef 55%, #ffe6c9 100%); border-color: #db2777; }
.choose-uk { background: linear-gradient(150deg, #f3f8ff, #dcebfb); border-color: #1971c2; }
.choose-flag { font-size: 2.6rem; line-height: 1; }
.choose-country { font-size: 1.55rem; font-weight: 800; }
.choose-in .choose-country { color: #a01155; }
.choose-uk .choose-country { color: #0a2540; }
.choose-sub { color: #7a3b5b; font-size: 0.9rem; }
.choose-uk .choose-sub { color: #44546a; }
.choose-go { margin-top: 0.8rem; display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; }
.choose-in .choose-go { color: #db2777; }
.choose-uk .choose-go { color: #1971c2; }

/* ── review mode (?review=1) — hidden for normal visitors ─────── */
.verify-tag { display: none; }
body.review-on .verify-tag {
  display: inline-flex; align-items: center; vertical-align: middle; margin-left: 0.35rem;
  padding: 0.05rem 0.4rem; border-radius: 0.35rem; background: #fde047; color: #713f12;
  font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
}
body.review-on [data-verify] { background: rgba(253, 224, 71, 0.16); outline: 1px dashed #ca8a04; outline-offset: 2px; border-radius: 3px; }

/* ── animations ───────────────────────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.animate-rise { animation: rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both; }
.animate-fade { animation: fade 0.4s ease both; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .animate-rise, .animate-fade, .choose-card { animation: none; transition: none; } }

/* ── mobile: swipeable tab strips + stacked comparison cards ───── */
@media (max-width: 640px) {
  /* tabs become a single horizontal swipe row instead of wrapping onto many lines */
  .tablist {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.3rem;
  }
  .tablist::-webkit-scrollbar { display: none; }
  .tab-btn { flex: 0 0 auto; white-space: nowrap; scroll-snap-align: start; }

  /* comparison table → one tidy card per medicine */
  .compare-wrap { overflow: visible; border: 0; border-radius: 0; }
  .compare { min-width: 0; font-size: 0.92rem; }
  .compare, .compare tbody, .compare tr, .compare td { display: block; width: 100%; }
  .compare thead { display: none; }
  .compare tr {
    border: 1px solid rgb(var(--outline-variant) / 0.6);
    border-radius: 0.75rem;
    background: rgb(var(--surface-lowest));
    padding: 0.85rem 1rem;
    margin-bottom: 0.85rem;
  }
  .compare tbody tr:hover { background: rgb(var(--surface-lowest)); }
  .compare td {
    border-top: 0;
    position: relative;
    padding: 0.32rem 0 0.32rem 42%;
    text-align: right;
    color: rgb(var(--ink));
  }
  .compare td::before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    top: 0.32rem;
    width: 40%;
    text-align: left;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: rgb(var(--ink-faint));
  }
  .compare td:first-child {
    padding: 0 0 0.55rem;
    text-align: left;
    font-size: 1.15rem;
    font-weight: 800;
    border-bottom: 1px solid rgb(var(--outline-variant) / 0.5);
    margin-bottom: 0.5rem;
  }
  .compare td:first-child::before { content: none; }
}
