/* Country pages (/countries/...) — generated by scripts/build_countries.py.
   Builds on styles.css; only adds what those pages need, plus right-to-left
   fixes for Arabic, Urdu and Persian. */

/* ---------- Hero ---------- */
.cp-hero .wrap { padding-top: 54px; padding-bottom: 76px; }
.cp-hero h1 { font-size: clamp(36px, 6vw, 62px); line-height: 1.08; }
.cp-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: #a9b6aa; margin-bottom: 34px; }
.cp-crumbs a { color: #c4b58f; text-decoration: none; }
.cp-crumbs a:hover { color: #f4efe3; }
.cp-crumbs .sep { opacity: .5; }

.cp-verse { margin: 4px 0 30px; }
.cp-verse .arabic { font-size: clamp(26px, 3vw, 32px); color: var(--gold-soft); margin: 0 0 4px; }
.cp-verse figcaption { display: flex; flex-direction: column; gap: 2px; }
.cp-verse-tr { color: #cfd6cf; font-size: 15px; font-style: italic; }
.cp-verse-cite { color: #93a196; font-size: 13px; }

.cp-langs { margin: 22px 0 0; font-size: 14px; color: #b9c3ba; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cp-langs .cp-lang-link { color: var(--gold-soft); border: 1px solid rgba(237,224,191,0.32); padding: 4px 13px; border-radius: 999px; text-decoration: none; }
.cp-langs .cp-lang-link:hover { border-color: var(--gold-bright); }
/* Language names are interface text, never the Qur'anic face styles.css gives [lang="ar"]. */
.cp-lang-link[lang], .cp-native { font-family: var(--sans); line-height: inherit; }

/* ---------- Body sections ---------- */
.cp-section { padding: 0; }
.cp-section + .cp-section, .cp-langnote + .cp-section { margin-top: 8px; }
.post-body .cp-section > .kicker { margin: 44px 0 0; }
.post-body .cp-section > .kicker + h2 { margin-top: 6px; }
.post-body .cp-section > .kicker + h2::before { display: none; }
.post-body .cp-section:first-child > h2:first-child, .post-body .cp-section:first-child > .kicker:first-child { margin-top: 0; }

.cp-features { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 22px 0 8px; }
.cp-features .card { padding: 22px 20px; }
.cp-features .card h3 { font-size: 17px; margin: 0 0 6px; color: var(--ink); }
.post-body .cp-features .card p { font-size: 15.5px; line-height: 1.6; margin: 0; }
.cp-features .card .ic { width: 38px; height: 38px; margin-bottom: 12px; }

.cp-steps { list-style: none; padding: 0; margin: 22px 0 8px; counter-reset: cpstep; display: grid; gap: 14px; }
.cp-steps li { position: relative; padding: 18px 20px; padding-inline-start: 66px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.cp-steps li::before { counter-increment: cpstep; content: counter(cpstep);
  position: absolute; top: 18px; inset-inline-start: 18px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--serif); font-weight: 600;
  background: linear-gradient(160deg, #143a2a, #0f2c20); color: var(--gold-bright); border: 1px solid rgba(216,183,96,0.4); }
.cp-steps h3 { font-size: 17px; margin: 4px 0 4px; color: var(--ink); }
.post-body .cp-steps p { font-size: 16px; line-height: 1.65; margin: 0; }

.cp-bullets { margin: 6px 0 22px; }
.cp-langnote { margin: 44px 0 0; }

.post-body .faq { margin-top: 18px; }
.post-body .faq summary { color: var(--ink); gap: 16px; }
.post-body .faq details p { font-size: 16px; line-height: 1.7; }

.cp-cta { padding-top: 0; }
.cp-cta .band { text-align: center; }
.cp-cta .band p { margin: 0 auto 24px; }
.cp-cta .cta-row { justify-content: center; }

/* ---------- Index ---------- */
.cp-country-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.cp-country h3 { font-family: var(--serif); font-size: 22px; margin: 0; }
.cp-country h3 a { text-decoration: none; color: var(--ink); }
.cp-country h3 a:hover { color: var(--gold); }
.cp-country .cp-native { color: var(--gold); font-size: 15px; margin: 2px 0 10px; }
.cp-country p { font-size: 15px; }
.cp-country .cp-country-langs { margin-top: 14px; font-size: 14px; color: var(--ink-faint); }
.cp-country .cp-country-langs a { color: var(--gold); text-decoration: none; font-weight: 600; }

@media (max-width: 860px) { .cp-country-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) {
  .cp-features, .cp-country-grid { grid-template-columns: 1fr; }
  .cp-hero .wrap { padding-top: 36px; padding-bottom: 60px; }
}

/* ---------- Right-to-left ---------- */
/* Letter-spacing and uppercase break joined scripts. */
html[dir="rtl"] body * { letter-spacing: 0 !important; text-transform: none !important; }
html[dir="rtl"] body { line-height: 1.85; }
html[dir="rtl"] .cp-hero h1 { line-height: 1.35; }
html[dir="rtl"] .post-body h2, html[dir="rtl"] .band h2 { line-height: 1.5; }
html[dir="rtl"] .post-body p, html[dir="rtl"] .post-body li { line-height: 1.95; }
html[dir="rtl"] .callout, html[dir="rtl"] .post-article .callout { border-left: 1px solid var(--line); border-right: 3px solid var(--gold); }
html[dir="rtl"] .hero::before { inset: -20% auto auto -10%; }
html[dir="rtl"] .cp-verse-tr { font-style: normal; }
/* Latin names inside Arabic copy (Apple Watch, App Store) keep their own direction. */
html[dir="rtl"] bdi { unicode-bidi: isolate; }

/* ---------- Urdu ---------- */
/* Nastaliq headings slope down to the left and their descenders fall far below the line. */
html[lang="ur"] .cp-hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.9; margin-bottom: 18px; }
html[lang="ur"] .post-body h2, html[lang="ur"] .band h2 { line-height: 1.9; }
html[lang="ur"] .cp-country h3 { line-height: 1.8; }

/* the shared header menu button (site.js) sits on the other side in right-to-left pages */
[dir="rtl"] .nav-toggle { margin: 0 0 0 -8px; }
