/* ============================================================
   research-report.css — Shared styles for Picasso Dental Research reports
   ============================================================
   Each page overrides :root variables (--accent, --accent-light, --cover-gradient,
   --cover-print-bg, --btn-hover) and adds market-specific rules inline.
   ============================================================ */

/* --- DEFAULT VARIABLES (green theme — override per page) --- */
:root {
  --bg: #faf9f6;
  --card: #fff;
  --border: #e2ddd5;
  --text: #1a1a1a;
  --muted: #6b6459;
  --accent: #1a5632;
  --accent2: #b8860b;
  --accent-light: #e8f0eb;
  --red: #c0392b;
  --blue: #2c5282;
  --green: #1a5632;
  --highlight: #fffde7;
  --cover-gradient: linear-gradient(135deg, #0d2818 0%, #1a5632 40%, #2d7a4f 100%);
  --cover-print-bg: #1a5632;
  --btn-hover: #134025;
}

/* --- RESET --- */
html { scroll-behavior: smooth; }
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
}

/* --- SKIP LINK --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 0 0 6px 6px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 10000;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* --- COVER --- */
.cover {
  background: var(--cover-gradient);
  color: #fff;
  padding: 4rem 2rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cover::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--accent2), #d4a017, var(--accent2));
}
.cover .badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.cover h1 {
  font-family: 'Source Serif 4', serif;
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.2;
  max-width: 850px;
  margin: 0 auto 1rem;
}
.cover .sub {
  font-size: 1.05rem;
  opacity: 0.85;
  max-width: 700px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}
.cover .meta {
  font-size: 0.82rem;
  opacity: 0.6;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 1.2rem;
  max-width: 600px;
  margin: 0 auto;
}

/* --- CITATION BLOCK & BYLINE (inside cover) --- */
.citation-block {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin: 0 auto 1.5rem;
  max-width: 750px;
  font-size: 0.92rem;
  line-height: 1.6;
  font-style: italic;
  color: rgba(255, 255, 255, 0.9);
}
.byline {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 0.5rem;
}
.byline a { color: #fff; text-decoration: underline; }

/* --- CONTAINER --- */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

/* --- EXECUTIVE SUMMARY --- */
.exec {
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  border-radius: 0 8px 8px 0;
}
.exec h2 {
  font-family: 'Source Serif 4', serif;
  font-size: 1.3rem;
  color: var(--accent);
  margin-bottom: 0.8rem;
}
.exec p { font-size: 0.95rem; color: #333; }

/* --- HEADINGS --- */
h2.section-title {
  font-family: 'Source Serif 4', serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--accent);
  margin: 2.5rem 0 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border);
}
h3 {
  font-family: 'Source Serif 4', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.8rem 0 0.6rem;
}
h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent2);
  margin: 1.2rem 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
p { margin-bottom: 0.9rem; font-size: 0.95rem; }
a { color: var(--blue); }
a:hover { text-decoration: underline; }
.small { font-size: 0.85rem; color: var(--muted); }
strong { font-weight: 600; }

/* --- KEY STATS GRID --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem;
  text-align: center;
}
.stat-card .num {
  font-family: 'Source Serif 4', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}
.stat-card .label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.3rem;
}

/* --- TABLES --- */
.table-wrap {
  overflow-x: auto;
  margin: 1.2rem 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
}
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
thead { background: #f0ede8; }
th {
  text-align: left;
  padding: 0.7rem 1rem;
  font-weight: 600;
  color: var(--accent);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
}
td {
  padding: 0.65rem 1rem;
  border-top: 1px solid #f0ede8;
  vertical-align: top;
}
tr:hover td { background: #faf8f4; }
caption {
  font-size: 0.82rem;
  color: var(--muted);
  text-align: left;
  padding: 0.5rem 1rem;
  caption-side: top;
  font-weight: 500;
}

/* --- PRICE COLOURS (shared) --- */
.price-vn { color: var(--green); font-weight: 600; }
.savings { color: var(--accent2); font-weight: 700; }

/* --- CALLOUT --- */
.callout {
  background: var(--highlight);
  border: 1px solid #ede9c0;
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0;
}
.callout.blue { background: #edf2ff; border-color: #c3d4f7; }
.callout.green { background: var(--accent-light); border-color: #b4d7c2; }
.callout .title { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.4rem; }

/* --- FIGURES --- */
.figure { margin: 1.5rem 0; text-align: center; }
.figure .caption {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 0.5rem;
}

/* --- BAR CHART --- */
.bar-chart { margin: 1rem 0; }
.bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}
.bar-label {
  width: 160px;
  flex-shrink: 0;
  text-align: right;
  padding-right: 12px;
  font-weight: 500;
}
.bar-track {
  flex: 1;
  background: #f0ede8;
  border-radius: 4px;
  height: 28px;
  position: relative;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  transition: width 0.6s;
}
.bar-fill.vn { background: linear-gradient(90deg, #1a5632, #2d7a4f); }
.bar-fill.save { background: linear-gradient(90deg, #b8860b, #d4a017); }

/* --- TOC --- */
.toc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem 2rem;
  margin: 1.5rem 0;
}
.toc h3 { margin-top: 0; color: var(--accent); font-size: 1rem; }
.toc ol { margin-left: 1.2rem; font-size: 0.9rem; line-height: 2; }
.toc a { color: var(--blue); text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* --- FOOTNOTES --- */
.footnotes {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}
.footnotes p { margin-bottom: 0.4rem; }

/* --- FOOTER --- */
.footer {
  margin-top: 3rem;
  padding: 2rem;
  background: #f0ede8;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  border-top: 2px solid var(--border);
}

/* --- CTA BLOCK --- */
.cta-block {
  background: var(--cover-gradient);
  color: #fff;
  border-radius: 12px;
  padding: 2.5rem;
  text-align: center;
  margin: 2.5rem 0;
}
.cta-block h3 { color: #fff; margin: 0 0 0.8rem; font-size: 1.3rem; }
.cta-block p { color: rgba(255, 255, 255, 0.85); margin-bottom: 1.5rem; }
.cta-btn {
  display: inline-block;
  background: var(--accent2);
  color: #fff;
  padding: 12px 32px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: background 0.2s;
}
.cta-btn:hover { background: #d4a017; text-decoration: none; }

/* --- BACK TO TOP --- */
.back-to-top {
  position: fixed;
  bottom: 2rem; right: 2rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--btn-hover); }

/* --- MOBILE --- */
@media (max-width: 700px) {
  .cover h1 { font-size: 1.8rem; }
  .container { padding: 1rem; }
  .bar-label { width: 110px; font-size: 0.78rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 400px) {
  .bar-row { flex-wrap: wrap; margin-bottom: 0.7rem; }
  .bar-label { width: 100%; text-align: left; padding-right: 0; padding-bottom: 2px; font-size: 0.75rem; }
  .bar-track { width: 100%; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* --- REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* --- PRINT --- */
@media print {
  html { scroll-behavior: auto; }
  .skip-link, .cover::after, .back-to-top, .cta-block { display: none !important; }
  body { font-size: 11pt; line-height: 1.5; color: #000; background: #fff; }
  .cover {
    background: var(--cover-print-bg) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    padding: 2rem 1.5rem 1.5rem;
  }
  .container { max-width: 100%; padding: 0 1cm; }
  .bar-fill { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #555; }
  .callout, .exec, .stat-card, .table-wrap { break-inside: avoid; }
  .footer { font-size: 9pt; }
}
