/* ============================================================
   AFBRO — SEO Agency theme
   ============================================================ */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --border: #e5e9f2;
  --brand: #6366f1;
  --brand-2: #8b5cf6;
  --brand-3: #06b6d4;
  --grad: linear-gradient(120deg, #6366f1 0%, #8b5cf6 45%, #06b6d4 100%);
  --grad-soft: linear-gradient(120deg, rgba(99,102,241,.12), rgba(139,92,246,.12), rgba(6,182,212,.12));
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow-md: 0 10px 30px -12px rgba(15,23,42,.16);
  --shadow-lg: 0 24px 60px -24px rgba(99,102,241,.35);
  --radius: 18px;
  --radius-sm: 10px;
  --maxw: 1180px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Sora", "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--brand); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--brand-2); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.22;
  letter-spacing: -0.02em;
  margin: 0 0 .5em;
}

p { margin: 0 0 1em; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 1000;
}
.skip-link:focus { left: 0; color: #fff; }

.main { min-height: 60vh; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.btn-primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 28px 64px -22px rgba(99,102,241,.5); }
.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-2px); }

/* ---------- Badges & chips ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .01em;
  background: var(--grad-soft);
  color: var(--brand);
}
.badge:hover { color: #fff; background: var(--grad); }

.chips { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .2s ease, color .2s ease, border-color .2s ease;
}
.chip:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.chip-count {
  min-width: 22px;
  text-align: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
  font-size: 12px;
}
/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--grad);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 8px 20px -8px rgba(99,102,241,.6);
}
.main-nav { display: flex; gap: 4px; margin-left: 8px; }
.nav-link {
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--ink-2);
  font-weight: 500;
  font-size: 15px;
}
.nav-link:hover { color: var(--brand); background: var(--grad-soft); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* Language switcher */
.lang-switcher { position: relative; }
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.lang-toggle:hover { border-color: var(--brand); color: var(--brand); }
.lang-code { text-transform: uppercase; letter-spacing: .04em; }
.lang-chev {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .18s ease;
}
.lang-switcher.is-open .lang-chev { transform: rotate(225deg) translateY(-1px); }
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 150px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.lang-switcher.is-open .lang-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-menu a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
}
.lang-menu a:hover { background: var(--grad-soft); color: var(--brand); }
.lang-menu a.is-active { color: var(--brand); font-weight: 700; }

/* Mobile toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; width: 100%; background: var(--ink); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.mobile-nav { display: flex; flex-direction: column; padding: 10px 24px 16px; }
.mobile-nav a { padding: 12px 4px; color: var(--ink-2); font-weight: 600; border-bottom: 1px solid var(--border); }
.mobile-nav a:last-child { border-bottom: 0; }
/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 72px;
  background:
    radial-gradient(60% 60% at 15% 10%, rgba(99,102,241,.18), transparent 60%),
    radial-gradient(50% 50% at 85% 20%, rgba(6,182,212,.16), transparent 60%),
    radial-gradient(50% 50% at 50% 100%, rgba(139,92,246,.14), transparent 60%),
    var(--surface);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(15,23,42,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,42,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(70% 70% at 50% 0%, #000 30%, transparent 100%);
  mask-image: radial-gradient(70% 70% at 50% 0%, #000 30%, transparent 100%);
}
.hero .container { position: relative; z-index: 1; text-align: center; max-width: 820px; }
.hero-badge {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--grad-soft);
  color: var(--brand);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: .02em;
  margin-bottom: 22px;
  border: 1px solid rgba(99,102,241,.18);
}
.hero-title {
  font-size: clamp(2.2rem, 5.4vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  background: linear-gradient(120deg, #0f172a 20%, #4f46e5 60%, #0ea5e9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero-subtitle {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto 32px;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }
.hero-stats { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.stat {
  min-width: 120px;
  padding: 18px 26px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.stat strong { display: block; font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat span { color: var(--muted); font-size: 13.5px; font-weight: 500; }
/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section-cats { padding: 40px 0 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.section-title { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .22s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card-media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--grad-soft);
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-media img { transform: scale(1.05); }
.card-media-fallback { width: 100%; height: 100%; background: var(--grad); }
.card-body { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px 22px; flex: 1; }
.card-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.card-title { font-size: 1.16rem; font-weight: 700; line-height: 1.3; margin: 0; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--brand); }
.card-desc { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin: 0; }
.card-meta { margin-top: auto; padding-top: 12px; color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--border); }

/* ---------- Category grid (terms page) ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.category-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .22s ease, border-color .2s ease;
}
.category-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--brand); }
.category-card-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--grad);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
}
.category-card-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 2px; color: var(--ink); }
.category-card-count { color: var(--muted); font-size: 13.5px; }
/* ---------- Page hero (list / term / terms) ---------- */
.page-hero {
  padding: 72px 0 48px;
  background:
    radial-gradient(60% 60% at 50% 0%, rgba(99,102,241,.12), transparent 65%),
    var(--surface);
  border-bottom: 1px solid var(--border);
}
.page-hero .container { text-align: center; }
.page-title {
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}
.page-subtitle { color: var(--muted); max-width: 620px; margin: 0 auto; font-size: 1.06rem; }

/* ---------- Single post ---------- */
.post-hero {
  padding: 64px 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.post-hero-inner { max-width: 820px; text-align: center; }
.post-cats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 18px; }
.post-title {
  font-size: clamp(1.8rem, 4.6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}
.post-deck { color: var(--muted); font-size: 1.1rem; margin-bottom: 20px; }
.post-meta { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.meta-dot { color: var(--border); }

.post-featured { padding: 32px 24px 8px; }
.post-figure { margin: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); }
.post-figure img { width: 100%; height: auto; }

.post-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 48px;
  padding-top: 40px;
  padding-bottom: 72px;
  align-items: start;
}
.post-body { min-width: 0; }

/* Table of contents */
.post-toc { position: sticky; top: 88px; }
.toc-box { padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.toc-title { font-family: var(--font-display); font-weight: 700; font-size: .95rem; margin-bottom: 10px; }
.toc-nav ul { list-style: none; margin: 0; padding: 0; }
.toc-nav li { margin: 4px 0; }
.toc-nav a { color: var(--muted); font-size: 14px; }
.toc-nav a:hover { color: var(--brand); }
.toc-nav ul ul { padding-left: 14px; border-left: 2px solid var(--border); margin-left: 4px; }
/* ---------- Prose / article body ---------- */
.prose { color: var(--ink-2); font-size: 1.02rem; line-height: 1.8; }
.prose > :first-child { margin-top: 0; }
.prose h2 {
  font-size: 1.65rem;
  font-weight: 800;
  margin: 2.2em 0 .6em;
  padding-bottom: .4em;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 90px;
}
.prose h3 { font-size: 1.3rem; font-weight: 700; margin: 1.8em 0 .5em; scroll-margin-top: 90px; }
.prose h4 { font-size: 1.12rem; font-weight: 700; margin: 1.5em 0 .5em; }
.prose p { margin: 0 0 1.2em; }
.prose a { text-decoration: underline; text-decoration-color: rgba(99,102,241,.4); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--brand); }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--brand); font-weight: 700; }
.prose blockquote {
  margin: 1.5em 0;
  padding: 18px 22px;
  border-left: 4px solid var(--brand);
  background: var(--grad-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-2);
}
.prose code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: .9em;
  background: #eef0f7;
  padding: 2px 6px;
  border-radius: 6px;
  color: #4f46e5;
}
.prose pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 20px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 1.4em 0;
}
.prose pre code { background: none; color: inherit; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; }
.prose th { background: var(--grad-soft); color: var(--ink); }
.prose img { border-radius: var(--radius-sm); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

.heading-anchor {
  margin-left: 6px;
  opacity: 0;
  color: var(--brand);
  font-weight: 400;
  font-size: .8em;
  text-decoration: none;
  transition: opacity .15s ease;
}
.prose h2:hover .heading-anchor,
.prose h3:hover .heading-anchor,
.prose h4:hover .heading-anchor { opacity: 1; }

/* ---------- FAQ ---------- */
.faq { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
.faq-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 20px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.faq-item summary {
  cursor: pointer;
  padding: 18px 20px;
  font-weight: 600;
  color: var(--ink);
  font-size: 1.02rem;
  list-style: none;
  position: relative;
  padding-right: 48px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  color: var(--brand);
  transition: transform .2s ease;
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-answer { padding: 0 20px 20px; color: var(--ink-2); }

/* ---------- Post nav (prev/next) ---------- */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 40px; }
.post-nav-link {
  display: flex;
  gap: 10px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 14.5px;
  box-shadow: var(--shadow-sm);
}
.post-nav-link:hover { color: var(--brand); border-color: var(--brand); }
.post-nav-link.next { text-align: right; justify-content: flex-end; }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 40px; }
.page-link {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-2);
  font-size: 1.1rem;
  box-shadow: var(--shadow-sm);
}
.page-link:hover { color: #fff; background: var(--grad); border-color: transparent; }
.page-info { color: var(--muted); font-size: 14px; font-weight: 600; }
/* ---------- Footer ---------- */
.site-footer {
  background: #0b1220;
  color: #cbd5e1;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-top: 64px;
  padding-bottom: 48px;
}
.footer-brand .brand { color: #fff; }
.footer-tagline { color: #94a3b8; max-width: 300px; margin-top: 14px; font-size: 14.5px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-title { color: #fff; font-size: .9rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.footer-col a { color: #94a3b8; font-size: 14.5px; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(148,163,184,.15); }
.footer-bottom .container { padding-top: 22px; padding-bottom: 22px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.footer-bottom span { color: #64748b; font-size: 13.5px; }

/* ---------- 404 ---------- */
.notfound-body { display: flex; flex-direction: column; min-height: 100vh; }
.notfound-body .main { flex: 1; display: flex; align-items: center; }
.notfound { width: 100%; padding: 80px 0; text-align: center; }
.notfound-code {
  font-family: var(--font-display);
  font-size: clamp(5rem, 20vw, 11rem);
  font-weight: 800;
  line-height: 1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  letter-spacing: -0.04em;
}
.notfound-title { font-size: 1.8rem; font-weight: 800; margin: 8px 0 12px; }
.notfound-text { color: var(--muted); max-width: 440px; margin: 0 auto 28px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .card-grid, .category-grid { grid-template-columns: repeat(2, 1fr); }
  .post-layout { grid-template-columns: 1fr; gap: 28px; }
  .post-toc { position: static; order: -1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .mobile-menu.is-open { display: block; }
  .card-grid, .category-grid { grid-template-columns: 1fr; }
  .hero { padding: 64px 0 48px; }
  .hero-stats { gap: 12px; }
  .stat { min-width: 96px; padding: 14px 18px; }
  .post-nav { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom .container { justify-content: center; text-align: center; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}






