/* Country reference pages — extends /blog/blog.css (linked first)
 * Design signal: Inter sans-serif headings throughout (not Georgia) = reference doc, not editorial.
 * Flat, ink-on-paper aesthetic matching the app's D3.2 cartografia palette.
 */

/* ── Shell ────────────────────────────────────────────────── */

.country-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px 96px;
}

/* ── Header / nav ─────────────────────────────────────────── */

.country-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 32px;
}

.country-header a {
  color: var(--ink-3);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

.country-header a:hover {
  color: var(--ink);
}

.country-header .sep {
  color: var(--hairline);
  font-size: 13px;
}

/* ── Hero ─────────────────────────────────────────────────── */

.country-hero {
  margin-bottom: 32px;
}

.country-hero-flag {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 12px;
  display: block;
}

.country-hero h1 {
  font-family: var(--font-body);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
  margin: 0 0 10px;
}

.country-hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.country-iso {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--paper-2);
  padding: 2px 7px;
  border-radius: 2px;
}

.country-verified {
  font-size: 12px;
  color: var(--ink-3);
}

.country-hook {
  margin-top: 14px;
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.55;
  max-width: 600px;
}

/* ── Key facts card ───────────────────────────────────────── */

.country-facts {
  background: var(--paper-2);
  border-radius: 4px;
  padding: 0;
  margin: 0 0 40px;
  overflow: hidden;
}

.country-facts table {
  width: 100%;
  border-collapse: collapse;
}

.country-facts td {
  padding: 11px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
  line-height: 1.4;
}

.country-facts tr:last-child td {
  border-bottom: none;
}

.country-facts .fact-label {
  font-weight: 600;
  color: var(--ink-3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  width: 44%;
  white-space: nowrap;
}

.country-facts .fact-value {
  color: var(--ink);
}

.country-facts .fact-value a {
  color: var(--ink-3);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Complexity badge ─────────────────────────────────────── */

.country-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.country-badge.simple {
  background: rgba(10, 10, 10, 0.07);
  color: var(--ink-2); /* ink-3 fails 4.5:1 on tinted bg */
}

.country-badge.medium {
  background: rgba(184, 128, 10, 0.1);
  color: #7a5500; /* darkened from #b8800a for WCAG AA 4.5:1 on light bg */
}

.country-badge.complex {
  background: rgba(255, 90, 31, 0.08);
  color: #b03c00; /* darkened from --accent #ff5a1f for WCAG AA 4.5:1 on tinted bg */
}

/* ── Sections ─────────────────────────────────────────────── */

.country-section {
  margin-top: 40px;
}

.country-section h2 {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 14px;
}

.country-section p {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.65;
  margin: 0 0 12px;
}

.country-section ul,
.country-section ol {
  margin: 0 0 12px 20px;
  color: var(--ink-2);
  font-size: 14px;
}

.country-section li {
  margin-bottom: 6px;
  line-height: 1.55;
}

.country-section strong {
  color: var(--ink);
  font-weight: 600;
}

.country-section a {
  color: var(--accent);
}

/* ── Warning callout (edge cases, important notes) ────────── */

.country-warning {
  border-left: 3px solid #b8800a;
  background: rgba(184, 128, 10, 0.06);
  padding: 14px 18px;
  margin: 20px 0;
  border-radius: 0 4px 4px 0;
}

.country-warning p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
}

.country-warning strong {
  color: var(--ink);
}

/* ── Edge case scenarios ──────────────────────────────────── */

.country-scenario {
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 14px 16px;
  margin: 12px 0;
}

.country-scenario-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.country-scenario p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
}

/* ── Calculator CTA ───────────────────────────────────────── */

.country-cta-calc {
  background: var(--paper-2);
  border-radius: 4px;
  padding: 20px 24px;
  margin: 40px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.country-cta-calc-text {
  flex: 1;
  min-width: 0;
}

.country-cta-calc-text p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
}

.country-cta-calc-text strong {
  color: var(--ink);
}

.country-cta-calc .btn-primary {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  flex-shrink: 0;
}

.country-cta-calc .btn-primary:hover {
  opacity: 0.85;
}

/* ── Special regimes ──────────────────────────────────────── */

.country-regime {
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 16px;
  margin: 12px 0;
}

.country-regime-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.country-regime p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
}

/* ── FAQ ──────────────────────────────────────────────────── */

.country-faq-item {
  border-bottom: 1px solid var(--hairline);
  padding: 16px 0;
}

.country-faq-item:first-child {
  border-top: 1px solid var(--hairline);
}

.country-faq-q {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 7px;
}

.country-faq-a {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.6;
  margin: 0;
}

/* ── Related resources grid ───────────────────────────────── */

.country-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.country-related-card {
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 14px 16px;
  text-decoration: none;
  display: block;
  transition: border-color 0.15s;
}

.country-related-card:hover {
  border-color: var(--ink-3);
}

.country-related-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  margin-bottom: 4px;
}

.country-related-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

/* ── App CTA ──────────────────────────────────────────────── */

.country-cta-app {
  background: var(--paper-2);
  border-radius: 4px;
  padding: 24px;
  margin-top: 48px;
  text-align: center;
}

.country-cta-app p {
  font-size: 14px;
  color: var(--ink-2);
  margin: 0 0 6px;
}

.country-cta-app strong {
  color: var(--ink);
}

.country-cta-app .btn-app {
  display: inline-block;
  margin-top: 14px;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  font-size: 14px;
}

.country-cta-app .btn-app:hover {
  opacity: 0.85;
}

/* ── Disclaimer ───────────────────────────────────────────── */

.country-disclaimer {
  color: var(--ink-3);
  font-size: 12px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  line-height: 1.6;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 560px) {
  .country-shell {
    padding: 24px 16px 80px;
  }

  .country-hero h1 {
    font-size: 26px;
  }

  .country-facts .fact-label {
    width: 40%;
    white-space: normal;
  }

  .country-cta-calc {
    flex-direction: column;
    align-items: flex-start;
  }

  .country-related-grid {
    grid-template-columns: 1fr;
  }

  /* facts table: label above value on very small screens */
  .country-facts table,
  .country-facts tbody,
  .country-facts tr,
  .country-facts td {
    display: block;
    width: 100%;
  }

  .country-facts .fact-label {
    padding-bottom: 2px;
    border-bottom: none;
    width: 100%;
  }

  .country-facts .fact-value {
    padding-top: 2px;
  }
}
