/* Twemoji emoji images — scale to match surrounding text */
img.emoji { height: 0.85em !important; width: 0.85em !important; margin: 0 0.05em 0 0.1em !important; vertical-align: -0.05em !important; display: inline !important; }

:root {
  --bg: #f6f1e8;
  --paper: #fffdf9;
  --ink: #142235;
  --ink-soft: #556375;
  --line: #ddd5c8;
  --forest: #18372d;
  --forest-2: #21473a;
  --gold: #c9962c;
  --gold-soft: #ebc875;
  --white: #ffffff;
  --shadow: 0 20px 60px rgba(20,34,53,0.10);
  --max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  background: linear-gradient(to bottom, #f8f4ec, #f5efe5 35%, #f7f4ee 100%);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
p { margin: 0; }

.container {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

/* ── NAV ── */
.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
  background: rgba(24,55,45,0.90);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

nav {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  color: white;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: var(--forest);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
}

.brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
}

.brand-name span { color: var(--gold-soft); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  color: rgba(255,255,255,0.78);
  font-size: 14px;
  font-weight: 500;
}

.nav-links a:hover { color: white; }

.nav-cta {
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: #12261f !important;
  border-radius: 10px;
  font-weight: 700;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', serif;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
  color: var(--ink);
}

.section-kicker {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
  display: block;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid rgba(235,200,117,0.30);
  border-radius: 999px;
  background: rgba(235,200,117,0.12);
  color: var(--gold-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold-soft);
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  font-family: 'Inter', sans-serif;
  border: 0;
  cursor: pointer;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: #18291f;
  box-shadow: 0 12px 28px rgba(201,150,44,0.20);
}

.btn-forest {
  background: linear-gradient(135deg, var(--forest), var(--forest-2));
  color: white;
  box-shadow: 0 12px 28px rgba(24,55,45,0.22);
}

.btn-ghost {
  color: var(--ink);
  border: 1.5px solid var(--line);
  background: transparent;
}

/* ── BADGES ── */
.badge-ok { font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 999px; color: #155a42; background: #dff3ea; white-space: nowrap; }
.badge-warn { font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 999px; color: #8a5b14; background: #f7ebc8; white-space: nowrap; }
.badge-tag { font-size: 11px; color: var(--gold); border: 1px solid #ead7af; background: #fbf3df; padding: 5px 9px; border-radius: 999px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; }

/* ── CARDS ── */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(20,34,53,0.04);
}

.card-hover {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  border-color: #ceb27c;
  box-shadow: 0 20px 45px rgba(20,34,53,0.09);
}

/* ── AFFILIATE CTA BOXES ── */
.affiliate-box {
  background: linear-gradient(135deg, #f5ead4, #faf3e4);
  border: 1px solid #e5d0a0;
  border-radius: 18px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.affiliate-box.forest {
  background: linear-gradient(135deg, #16352b, #102821);
  border-color: rgba(255,255,255,0.10);
  color: white;
}

.affiliate-box p { font-size: 15px; line-height: 1.6; flex: 1; min-width: 200px; }
.affiliate-box.forest p { color: rgba(255,255,255,0.80); }

/* ── BREADCRUMBS ── */
/* Reset nav base styles that bleed in (height:72px / justify-content:space-between) */
.breadcrumb {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: auto;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.breadcrumb a:hover { color: var(--gold); }
.breadcrumb-sep { color: var(--line); }

/* ── TOC ── */
/* On desktop the sidebar handles navigation — hide the in-article TOC to prevent overlap */
@media (min-width: 901px) {
  .guide-layout article .toc { display: none; }
}

.toc {
  background: #f4f0e8;
  border-left: 3px solid var(--gold);
  border-radius: 0 14px 14px 0;
  padding: 20px 24px;
  margin: 32px 0;
}

.toc-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--ink);
}

.toc ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.toc li { font-size: 14px; }
.toc a { color: var(--forest); font-weight: 500; }
.toc a:hover { color: var(--gold); }

/* ── ARTICLE CONTENT ── */
.article-body {
  max-width: 740px;
  margin: 0 auto;
}

.article-body h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 48px 0 16px;
  color: var(--ink);
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.article-body h3 {
  font-size: 1.3rem;
  margin: 32px 0 12px;
  color: var(--ink);
}

.article-body p {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--ink-soft);
  margin-bottom: 18px;
}

.article-body strong { color: var(--ink); }

.article-body ul, .article-body ol {
  margin: 0 0 18px;
  padding-left: 22px;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.8;
}

.article-body li { margin-bottom: 6px; }

.article-body .highlight-box {
  background: #f0f8f4;
  border-left: 4px solid var(--forest);
  border-radius: 0 14px 14px 0;
  padding: 18px 22px;
  margin: 28px 0;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink);
}

.article-body .warning-box {
  background: #fdf5e4;
  border-left: 4px solid var(--gold);
  border-radius: 0 14px 14px 0;
  padding: 18px 22px;
  margin: 28px 0;
  font-size: 1rem;
  color: var(--ink);
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 14px;
}

.article-body th {
  background: var(--forest);
  color: white;
  padding: 12px 16px;
  text-align: left;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  letter-spacing: 0.03em;
}

.article-body td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}

.article-body tr:nth-child(even) td { background: #faf6ef; }

/* ── FAQ ── */
.faq-section { margin: 48px 0; }

.faq-title {
  font-size: clamp(1.6rem, 3vw, 2rem);
  margin-bottom: 28px;
  color: var(--ink);
}

.faq-item {
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}

.faq-q {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.faq-q::after {
  content: '+';
  font-family: 'Inter', sans-serif;
  font-size: 1.4rem;
  color: var(--gold);
  flex-shrink: 0;
}

.faq-a {
  font-size: 1rem;
  color: var(--ink-soft);
  line-height: 1.8;
  margin-top: 14px;
}

/* ── CARD / METRIC LAYOUT COLLISION FIXES ── */
.card,
.stat-card,
.snapshot-card,
.metric-card {
  height: auto;
  min-height: unset;
}

.card h3,
.stat-card h3,
.metric-title {
  line-height: 1.2;
  margin-bottom: 8px;
}

.card p,
.stat-card p,
.metric-subtext {
  line-height: 1.5;
}

.metric-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

@media (max-width: 768px) {
  .card,
  .stat-card,
  .snapshot-card {
    padding: 16px;
  }

  .metric-number {
    font-size: 1.6rem;
  }

  .metric-title,
  .card h3 {
    font-size: 1rem;
  }

  .metric-subtext,
  .card p {
    font-size: 0.92rem;
  }
}

/* ── COUNTRY GRID ── */
.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.country-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.country-card:hover {
  transform: translateY(-3px);
  border-color: #ceb27c;
  box-shadow: 0 16px 40px rgba(20,34,53,0.08);
}

.country-flag { font-size: 2.2rem; line-height: 1; }
.country-name { font-family: 'Playfair Display', serif; font-size: 1.3rem; color: var(--ink); }
.country-desc { font-size: 14px; color: var(--ink-soft); line-height: 1.6; flex: 1; }
.country-link { font-size: 13px; font-weight: 700; color: var(--forest); }

/* ── FOOTER ── */
footer { background: #101b2a; color: rgba(255,255,255,0.72); padding: 50px 0 30px; }

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 26px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-grid h4 {
  color: rgba(255,255,255,0.34);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  margin: 0 0 14px;
}

.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 14px; }
.footer-grid ul a:hover { color: var(--gold-soft); }
.footer-brand p { max-width: 34ch; color: rgba(255,255,255,0.48); margin-top: 12px; font-size: 13px; line-height: 1.7; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 22px;
  font-size: 12px;
  color: rgba(255,255,255,0.38);
  flex-wrap: wrap;
}

.footer-bottom .links { display: flex; gap: 18px; }
.footer-bottom a:hover { color: var(--gold-soft); }

/* ── RESPONSIVE ── */
@media (max-width: 1080px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .guide-layout { grid-template-columns: 1fr; }
  .guide-sidebar { position: static; }
  .at-a-glance { grid-template-columns: repeat(2, 1fr); }
}

/* ── MOBILE (≤ 760px) ── */
@media (max-width: 760px) {
  /* Nav */
  .nav-links { display: none; }
  nav { height: 60px; }
  .nav-cta { padding: 8px 14px; font-size: 13px; }

  /* Container */
  .container { width: calc(100% - 32px); }

  /* Guide hero — !important needed: page inline styles come after main.css in cascade */
  .guide-hero { padding: 36px 0 36px !important; }
  .guide-hero h1 { font-size: clamp(1.9rem, 7vw, 2.6rem); margin: 12px 0 14px; }
  .guide-meta { gap: 12px; font-size: 12px; margin-top: 16px; }
  .at-a-glance { grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; margin-top: 20px; }
  .glance-item strong { font-size: 1.2rem; }
  .glance-item span { font-size: 11px; }
  .key-number { padding: 10px 14px; margin-right: 8px; }
  .key-number strong { font-size: 1.5rem; }

  /* Guide layout — !important needed: page inline styles come after main.css in cascade */
  .guide-layout { gap: 28px; padding: 36px 0 52px !important; }
  .guide-sidebar { gap: 14px; }
  .sidebar-box { padding: 18px; border-radius: 14px; }

  /* Article body */
  .article-body { max-width: 100%; }
  .article-body h2 { font-size: clamp(1.4rem, 5vw, 1.8rem); margin: 36px 0 12px; }
  .article-body h3 { font-size: 1.15rem; margin: 26px 0 10px; }
  .article-body p { font-size: 1rem; line-height: 1.8; margin-bottom: 14px; }
  .article-body ul, .article-body ol { font-size: 1rem; padding-left: 18px; }

  /* Tables — horizontal scroll on mobile */
  .article-body table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; border-radius: 12px; }
  .article-body th, .article-body td { padding: 10px 12px; }

  /* Cards */
  .card { padding: 18px; border-radius: 16px; }
  .country-card { padding: 18px; gap: 10px; }
  .country-name { font-size: 1.15rem; }

  /* Affiliate box */
  .affiliate-box { flex-direction: column; padding: 18px 20px; gap: 14px; }
  .affiliate-box p { font-size: 14px; min-width: unset; }

  /* Footer */
  footer { padding: 36px 0 20px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
  .footer-grid h4 { margin-bottom: 10px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 6px; }
  .footer-bottom .links { gap: 12px; flex-wrap: wrap; }

  /* FAQ */
  .faq-q { font-size: 1rem; }
  .faq-item { padding: 16px 0; }

  /* TOC */
  .toc { padding: 16px 18px; margin: 24px 0; }

  /* Breadcrumb */
  .breadcrumb { font-size: 12px; gap: 6px; margin-bottom: 18px; }

  /* Buttons */
  .btn { font-size: 14px; padding: 12px 18px; }

  /* Highlight/warning boxes */
  .article-body .highlight-box,
  .article-body .warning-box { padding: 14px 16px; font-size: 0.97rem; }
}

/* ── SMALL PHONES (≤ 480px) ── */
@media (max-width: 480px) {
  /* Footer stacks fully */
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }

  /* At-a-glance — 2-col is fine, but reduce */
  .at-a-glance { grid-template-columns: 1fr 1fr; gap: 8px; }

  /* Guide hero */
  .guide-hero { padding: 28px 0 28px !important; }
  .guide-hero h1 { font-size: clamp(1.7rem, 8vw, 2.2rem); }

  /* Article */
  .article-body h2 { font-size: clamp(1.3rem, 6vw, 1.7rem); }

  /* Cards */
  .country-card { padding: 16px; border-radius: 14px; }
  .country-flag { font-size: 1.8rem; }

  /* Affiliate box */
  .affiliate-box { padding: 16px; border-radius: 14px; }

  /* Sidebar */
  .sidebar-box { padding: 16px; }
}
