/* Shared styles for the content pages (templates + guides). The builder (index.html) does not use this file,
   but both follow the same design tokens (CLAUDE.md → Design system). */
:root {
  --navy:#1e3a5f; --navy-700:#16304f; --brand:#2563eb; --brand-700:#1d4ed8; --brand-50:#eff6ff;
  --ok:#15803d; --ok-50:#f0fdf4; --ok-200:#bbf7d0;
  --bg:#f8fafc; --surface:#fff; --fg:#0f172a; --fg-2:#334155; --muted-fg:#475569; --subtle-fg:#64748b;
  --border:#cbd5e1; --border-soft:#e2e8f0; --header-h:64px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--bg); color: var(--fg); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
:focus-visible { outline: 3px solid rgba(37,99,235,.55); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; } }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 60; background: #fff; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

.btn-blue {
  background: var(--brand); color: #fff; border: 1px solid var(--brand); border-radius: 10px; padding: 10px 20px; min-height: 44px;
  font-size: 15px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 1px 2px rgba(15,23,42,.1), 0 4px 12px rgba(37,99,235,.22); transition: background .15s; white-space: nowrap;
}
.btn-blue:hover { background: var(--brand-700); border-color: var(--brand-700); }
.btn-sm { padding: 8px 14px; font-size: 14px; min-height: 40px; }

/* ── Header ── */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.94); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border-soft); }
.site-header .bar { height: var(--header-h); max-width: 1280px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
@media (min-width: 640px) { .site-header .bar { padding: 0 24px; } }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); min-height: 44px; }
.logo-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--navy); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.logo-text { font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.free-pill { display: none; font-size: 11.5px; font-weight: 700; color: var(--ok); background: var(--ok-50); border: 1px solid var(--ok-200); padding: 2px 8px; border-radius: 999px; }
@media (min-width: 640px) { .free-pill { display: inline-block; } }
.main-nav { display: none; align-items: center; gap: 4px; }
.main-nav a { font-size: 14px; font-weight: 600; color: var(--fg-2); text-decoration: none; padding: 10px 12px; border-radius: 8px; }
.main-nav a:hover { color: var(--brand-700); background: var(--brand-50); }
@media (min-width: 1024px) { .main-nav { display: flex; } }
.mobile-nav { display: flex; gap: 4px; overflow-x: auto; padding: 0 12px 6px; font-size: 13.5px; font-weight: 600; color: var(--fg-2); white-space: nowrap; scrollbar-width: none; }
.mobile-nav::-webkit-scrollbar { display: none; }
.mobile-nav a { text-decoration: none; padding: 10px 8px; min-height: 40px; display: inline-flex; align-items: center; }
@media (min-width: 1024px) { .mobile-nav { display: none; } }
/* Language switcher (EN / RO / RU) + the header button; same look as the builder's .lang-sw */
.hdr-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.lang-sw { display: flex; align-items: center; gap: 2px; }
.lang-sw a { min-width: 34px; min-height: 44px; padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: var(--muted-fg); text-decoration: none; }
.lang-sw a:hover { color: var(--brand-700); background: var(--brand-50); }
.lang-sw a[aria-current] { color: var(--brand-700); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 639px) { .lang-sw a { min-width: 30px; padding: 0 2px; } .hdr-actions { gap: 4px; } .site-header .bar { gap: 8px; } }
/* Narrow phones: logo mark only (as in the builder below 640px), so logo + switcher + button fit in 360px */
@media (max-width: 419px) { .site-header .bar .logo-text { display: none; } }

/* ── Article layout ── */
.guide { max-width: 820px; margin: 0 auto; padding: 20px 16px 8px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 4px 0 18px; font-size: 13px; color: #64748b; }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: #94a3b8; }
.crumbs a { color: #2563eb; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

article { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 18px; padding: 28px 20px; box-shadow: 0 1px 2px rgba(15,23,42,.05); }
@media (min-width: 640px) { article { padding: 40px 48px; } }
article h1 { font-size: 30px; line-height: 1.2; font-weight: 800; color: #0f172a; margin: 0 0 10px; letter-spacing: -.01em; }
@media (min-width: 640px) { article h1 { font-size: 36px; } }
.byline { font-size: 13px; color: #64748b; margin: 0 0 22px; }
.lead { font-size: 18px; line-height: 1.65; color: #334155; margin: 0 0 20px; }
article h2 { font-size: 23px; line-height: 1.3; font-weight: 750; color: #0f172a; margin: 38px 0 12px; scroll-margin-top: 80px; }
article h3 { font-size: 18px; font-weight: 700; color: #0f172a; margin: 26px 0 8px; }
article p, article li { font-size: 16px; line-height: 1.75; color: #334155; }
article p { margin: 0 0 14px; }
article ul, article ol { padding-left: 22px; margin: 0 0 16px; }
article ul { list-style: disc; }
article ol { list-style: decimal; }
article li { margin: 4px 0; }
article a:not(.btn-blue):not(.rel-card) { color: #2563eb; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
article strong { color: #0f172a; }
article code { background: #f1f5f9; border-radius: 5px; padding: 1px 6px; font-size: .92em; }

.toc { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px 18px; margin: 0 0 24px; }
.toc-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #64748b; margin-bottom: 6px; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { font-size: 15px; margin: 2px 0; }

.callout { border-left: 4px solid #2563eb; background: #eff6ff; border-radius: 0 12px 12px 0; padding: 14px 18px; margin: 18px 0; }
.callout p:last-child { margin-bottom: 0; }
.callout.warn { border-color: #f59e0b; background: #fffbeb; }
.callout.ok { border-color: #10b981; background: #ecfdf5; }

.example { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px 18px; margin: 12px 0 18px; }
.example .ex-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #64748b; margin-bottom: 4px; }
.example p:last-child { margin-bottom: 0; }
.do-dont { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 12px 0 18px; }
@media (min-width: 640px) { .do-dont { grid-template-columns: 1fr 1fr; } }
.do-dont > div { border-radius: 12px; padding: 12px 16px; }
.do-dont .do { background: #ecfdf5; border: 1px solid #a7f3d0; }
.do-dont .dont { background: #fef2f2; border: 1px solid #fecaca; }
.do-dont .dd-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.do-dont .do .dd-label { color: #047857; }
.do-dont .dont .dd-label { color: #b91c1c; }
.do-dont p { margin: 0; font-size: 15px; }

.table-wrap { overflow-x: auto; margin: 14px 0 20px; border: 1px solid #e2e8f0; border-radius: 12px; }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 14.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #e2e8f0; vertical-align: top; line-height: 1.5; color: #334155; }
th { background: #f8fafc; font-weight: 700; color: #0f172a; }
tr:last-child td { border-bottom: none; }

/* ── Template figures ── */
.tpl-figure { display: grid; grid-template-columns: 1fr; gap: 18px; margin: 18px 0 26px; padding: 16px; border: 1px solid #e2e8f0; border-radius: 16px; background: #f8fafc; }
@media (min-width: 640px) { .tpl-figure { grid-template-columns: 260px 1fr; align-items: start; } }
.tpl-shot { display: block; }
.tpl-figure img, .tpl-card-sm img { width: 100%; height: auto; display: block; border-radius: 8px; box-shadow: 0 4px 18px rgba(15,23,42,.12); background: #fff; }
.tpl-name { font-size: 18px; font-weight: 800; color: #0f172a; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ats { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid; }
.ats-best { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.ats-good { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.ats-fair { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.tpl-facts { list-style: none; padding: 0 !important; margin: 10px 0 14px !important; }
.tpl-facts li { font-size: 14.5px !important; margin: 3px 0 !important; }
.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0 24px; }
@media (min-width: 768px) { .tpl-grid { grid-template-columns: repeat(3, 1fr); } }
.tpl-card-sm { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.tpl-card-sm .tpl-name { font-size: 15px; }
.tpl-card-sm p { font-size: 13px !important; line-height: 1.5 !important; margin: 4px 0 6px !important; }
.tpl-card-sm a { font-size: 13.5px; font-weight: 700; }
/* Longer Romanian / Russian names ("Folosește șablonul Tech / Întunecat", «Профессиональный») wrap instead of widening the page */
.tpl-figure { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .tpl-figure { grid-template-columns: 260px minmax(0, 1fr); } }
.tpl-figure .btn-blue { white-space: normal; text-align: center; }
.tpl-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (min-width: 768px) { .tpl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tpl-card-sm { min-width: 0; overflow-wrap: break-word; hyphens: auto; }

/* ── CTA ── */
.cta-box { display: flex; flex-direction: column; gap: 14px; background: linear-gradient(135deg,#eff6ff,#ecfeff); border: 1px solid #bfdbfe; border-radius: 16px; padding: 20px 22px; margin: 28px 0; }
@media (min-width: 640px) { .cta-box { flex-direction: row; align-items: center; justify-content: space-between; } }
.cta-title { font-weight: 800; color: #0f172a; font-size: 17px; margin-bottom: 4px; }
.cta-box p { margin: 0; font-size: 14.5px; }

/* ── FAQ + related ── */
.faq, .related { margin-top: 26px; }
.faq h2, .related h2 { font-size: 22px; font-weight: 800; color: #0f172a; margin: 0 0 14px; }
.faq dl { margin: 0; display: grid; gap: 12px; }
.faq-item { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 14px; padding: 16px 20px; }
.faq dt { font-weight: 700; color: #0f172a; margin-bottom: 4px; }
.faq dd { margin: 0; font-size: 15px; line-height: 1.7; color: #475569; }
.faq dd a { color: #2563eb; }
.rel-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .rel-grid { grid-template-columns: 1fr 1fr; } }
.rel-card { display: block; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px 18px; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.rel-card:hover { border-color: #93c5fd; box-shadow: 0 4px 14px rgba(37,99,235,.12); }
.rel-title { display: block; font-weight: 700; color: #0f172a; }
.rel-blurb { display: block; font-size: 14px; color: #64748b; margin-top: 2px; line-height: 1.5; }

/* ── Footer ── */
.site-footer { background: var(--surface); border-top: 1px solid var(--border-soft); margin-top: 48px; }
.foot-grid { max-width: 1152px; margin: 0 auto; padding: 40px 20px 24px; display: grid; grid-template-columns: 1fr; gap: 28px; }
@media (min-width: 768px) { .foot-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.foot-brand p { font-size: 13.5px; color: var(--muted-fg); line-height: 1.6; margin: 10px 0 0; max-width: 320px; }
.foot-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--fg); margin-bottom: 8px; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; }
.foot-grid li { margin: 2px 0; }
.foot-grid li a { display: inline-flex; align-items: center; min-height: 32px; font-size: 14px; color: var(--muted-fg); text-decoration: none; }
.foot-grid li a:hover { color: var(--brand-700); text-decoration: underline; }
.foot-bottom { max-width: 1152px; margin: 0 auto; padding: 16px 20px 28px; border-top: 1px solid var(--border-soft); font-size: 12.5px; color: var(--subtle-fg); display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; }

/* ── Ads on template/guide pages (filled by the script build_pages.py adds). Reserved height = creative + 36px label/padding/border.
   .ad-lead: phones only, after the lead paragraph (≥40px from the text and the first figure / contents box);
   the in-content slot sits between the article and the FAQ on every screen size. ── */
.ad-slot { background: #f1f5f9; border: 1px solid var(--border-soft); border-radius: 12px; padding: 6px 4px 8px; margin: 26px auto 0; text-align: center; overflow: hidden; max-width: 318px; min-height: 286px; }
.ad-slot.ad-lead { margin-top: 40px; margin-bottom: 40px; }
/* phones: a 300×250 needs 318px; centre it on the column even where the column is narrower (360px phones, inside the article card) */
@media (max-width: 767px) { .ad-slot { width: 318px; max-width: none; margin-left: calc(50% - 159px); margin-right: 0; } }
@media (min-width: 768px) { .ad-slot { max-width: 746px; min-height: 126px; } .ad-slot.ad-lead { display: none; } }
.ad-slot-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #64748b; display: block; margin-bottom: 4px; }
.ad-slot-body { display: flex; align-items: center; justify-content: center; }
.ad-slot iframe { border: 0; display: block; max-width: 100%; }
