/*
Theme Name: DecodeTopics
Theme URI: https://decodetopics.com
Author: Lakhan
Description: A modern, fast, mobile-responsive theme for DecodeTopics — warm cream "paper" body with a fixed dark navy-to-brown-black hero, amber accent gradient. Turns podcasts and dense topics into step-by-step guides in English and Hindi. Elementor-compatible; write guides as normal WordPress posts and they get an automatic table of contents, read time, and source-credit box.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: decodetopics
*/

/* ==========================================================================
   DecodeTopics — Design System & Global Styles
   Complex topics. Simply decoded.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Brand accent gradient — amber/"sun" family (primary CTA, links, headline shimmer) */
  --grad-start: #e08b1a;
  --grad-mid: #c17410;
  --grad-end: #a5620c;
  --brand: #b8690f;
  --brand-strong: #a5620c;

  /* Palette-logic families: amber=energy/morning, indigo=calm/night, teal=control/done, red=alert */
  --family-sun-1: #f5a623;
  --family-sun-2: #a5620c;
  --family-sun-soft: #fff2dd;
  --family-sun-soft-text: #a5620c;
  --family-night-1: #4b4ce0;
  --family-night-2: #20205a;
  --family-night-soft: #eceaff;
  --family-night-soft-text: #20205a;
  --family-teal-1: #1fa38a;
  --family-teal-2: #0d6e5c;
  --family-teal-soft: #e2f6f1;
  --family-teal-soft-text: #0d6e5c;
  --family-red-1: #e0524b;
  --family-red-2: #b8322c;
  --family-red-soft: #fdeceb;
  --family-red-soft-text: #a5322c;

  /* Base surface — warm cream "paper" theme, near-black ink text */
  --bg: #f4f1ea;
  --bg-soft: #fbf7ee;
  --surface: #fffdf8;
  --surface-2: #f4f1ea;
  --border: #e6ddc9;
  --text: #17171f;
  --text-dim: #5b6472;
  --text-faint: #8a8d9e;
  --success: #1fa38a;
  --shadow: rgba(30, 20, 0, 0.08);
  --overlay: rgba(244, 241, 234, 0.82);

  /* Hero — fixed dark navy → brown-black cover, independent of the light body */
  --hero-1: #24243e;
  --hero-2: #1a1a30;
  --hero-3: #2b1d13;
  --hero-text: #fff9ee;
  --hero-sub: #d8d6e8;
  --hero-pill-text: #cfcde3;
  --glass-1: rgba(255, 255, 255, 0.08);
  --glass-2: rgba(255, 255, 255, 0.12);
  --glass-3: rgba(255, 255, 255, 0.2);

  /* Type scale */
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-head: "Sora", "Inter", -apple-system, sans-serif;

  --fs-xs: 0.8rem;
  --fs-sm: 0.9rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: clamp(1.2rem, 1rem + 0.9vw, 1.375rem);
  --fs-xl: clamp(1.45rem, 1.1rem + 1.5vw, 1.85rem);
  --fs-2xl: clamp(1.8rem, 1.3rem + 2.4vw, 2.5rem);
  --fs-3xl: clamp(2.15rem, 1.4rem + 3.6vw, 3.4rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --space-10: 4.5rem;
  --space-12: 6rem;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 999px;

  --container: 1180px;
  --transition: 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* One deliberate look by design (warm paper + navy hero) rather than an
   OS-driven dark/light swap — the exact hex values above are the brand. */

/* ---------- Reset ---------- */
* , *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.18;
  margin: 0 0 var(--space-4);
  letter-spacing: -0.01em;
}
p { margin: 0 0 var(--space-4); color: var(--text-dim); }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--brand); color: #fff; }

/* ---------- Layout helpers ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-5);
}
.section { padding: var(--space-12) 0; }
.section-head {
  max-width: 640px;
  margin: 0 auto var(--space-8);
  text-align: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}
.gradient-text {
  /* Sunrise-to-night sweep: distinct from the button/brand gradient on purpose */
  background: linear-gradient(100deg, var(--family-sun-1), var(--grad-start) 30%, var(--family-night-1) 65%, var(--family-night-2) 85%, var(--family-sun-1));
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 7s linear infinite;
}
@keyframes shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 220% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .gradient-text { animation: none; }
}
.text-center { text-align: center; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: var(--fs-sm);
  border: 1px solid transparent;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(100deg, var(--grad-start), var(--grad-mid));
  color: #fff;
  box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--brand) 70%, transparent);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -8px color-mix(in srgb, var(--brand) 80%, transparent); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { padding: 0.55rem 1.1rem; font-size: var(--fs-xs); }
.btn-block { width: 100%; }

/* ---------- Navbar ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: var(--space-4) 0;
  transition: background var(--transition), border-color var(--transition), padding var(--transition);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: var(--overlay);
  backdrop-filter: blur(14px) saturate(150%);
  border-bottom-color: var(--border);
  padding: var(--space-3) 0;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.brand { display: flex; align-items: center; gap: var(--space-2); font-family: var(--font-head); font-weight: 700; font-size: var(--fs-md); }
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; }
.brand-tagline {
  font-family: var(--font-body); font-weight: 500; font-size: var(--fs-xs);
  color: var(--text-faint); margin-left: var(--space-2); padding-left: var(--space-3);
  border-left: 1px solid var(--border); letter-spacing: 0.01em;
}
.nav-links { display: flex; align-items: center; gap: var(--space-6); }
.nav-links a {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-dim);
  position: relative;
  transition: color var(--transition);
}
.nav-links a:hover, .nav-links a.is-active { color: var(--text); }
.nav-links a.is-active::after {
  content: "";
  position: absolute; left: 0; bottom: -8px;
  width: 100%; height: 2px;
  background: linear-gradient(100deg, var(--grad-start), var(--grad-end));
  border-radius: var(--radius-full);
}
/* WordPress nav menu current-item classes land on the <li>, not the <a> */
.nav-links li { list-style: none; }
.nav-links .current-menu-item > a,
.nav-links .current_page_item > a,
.nav-links .current-menu-ancestor > a {
  color: var(--text);
}
.nav-links .current-menu-item > a::after,
.nav-links .current_page_item > a::after,
.nav-links .current-menu-ancestor > a::after {
  content: "";
  position: absolute; left: 0; bottom: -8px;
  width: 100%; height: 2px;
  background: linear-gradient(100deg, var(--grad-start), var(--grad-end));
  border-radius: var(--radius-full);
}
.nav-actions { display: flex; align-items: center; gap: var(--space-3); }
.lang-toggle {
  display: flex; border: 1px solid var(--border); border-radius: var(--radius-full);
  overflow: hidden; font-size: var(--fs-xs); font-weight: 600;
}
.lang-toggle a { padding: 0.4rem 0.75rem; color: var(--text-faint); transition: var(--transition); }
.lang-toggle a.is-active { background: var(--brand); color: #fff; }
.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  width: 42px; height: 38px; align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 18px; height: 2px; background: var(--text);
  position: relative; transition: var(--transition);
}
.nav-toggle span::before { position: absolute; top: -6px; width: 18px; }
.nav-toggle span::after { position: absolute; top: 6px; width: 18px; }
.nav-toggle.is-open span { background: transparent; }
.nav-toggle.is-open span::before { transform: rotate(45deg); top: 0; }
.nav-toggle.is-open span::after { transform: rotate(-45deg); top: 0; }

/* On the homepage, the nav starts transparent over the dark hero, so its
   text needs to be light until the nav scrolls onto the cream body — at
   which point .is-scrolled takes over and default (dark ink) colors apply. */
body.home .nav:not(.is-scrolled) .brand,
body.home .nav:not(.is-scrolled) .brand-tagline,
body.home .nav:not(.is-scrolled) .nav-links a,
body.home .nav:not(.is-scrolled) .lang-toggle a {
  color: var(--hero-text);
}
body.home .nav:not(.is-scrolled) .brand-tagline { border-left-color: var(--glass-3); }
body.home .nav:not(.is-scrolled) .lang-toggle { border-color: var(--glass-3); }
body.home .nav:not(.is-scrolled) .nav-toggle { border-color: var(--glass-3); }
body.home .nav:not(.is-scrolled) .nav-toggle span,
body.home .nav:not(.is-scrolled) .nav-toggle span::before,
body.home .nav:not(.is-scrolled) .nav-toggle span::after {
  background: var(--hero-text);
}

/* ---------- Hero (fixed dark navy → brown-black cover) ---------- */
.hero {
  position: relative;
  padding: calc(var(--space-12) + 3rem) 0 var(--space-12);
  overflow: hidden;
  background: linear-gradient(165deg, var(--hero-1), var(--hero-2) 55%, var(--hero-3));
  color: var(--hero-sub);
}
.hero h1, .hero h2 { color: var(--hero-text); }
.hero .eyebrow {
  color: var(--hero-pill-text);
  background: var(--glass-1);
  border: 1px solid var(--glass-2);
  backdrop-filter: blur(6px);
}
.hero-glow {
  position: absolute; inset: -20% -10% auto -10%; height: 820px;
  background:
    radial-gradient(closest-side at 25% 30%, color-mix(in srgb, var(--family-sun-1) 24%, transparent), transparent 70%),
    radial-gradient(closest-side at 78% 55%, color-mix(in srgb, var(--family-night-1) 30%, transparent), transparent 72%);
  filter: blur(30px);
  z-index: 0;
  pointer-events: none;
  animation: drift 16s ease-in-out infinite alternate;
}
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(2%, 3%, 0) scale(1.06); }
}
.hero::after {
  content: "";
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(var(--glass-1) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 40%, transparent 80%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 40%, transparent 80%);
  opacity: 0.6;
}
@media (prefers-reduced-motion: reduce) {
  .hero-glow { animation: none; }
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--space-10); align-items: center; }
.hero h1 { font-size: var(--fs-3xl); margin-bottom: var(--space-5); }
.hero-sub { font-size: var(--fs-md); max-width: 520px; color: var(--hero-sub); }
.hero-cta { display: flex; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-6); }
.hero .btn-ghost { border-color: var(--glass-3); color: var(--hero-text); }
.hero .btn-ghost:hover { border-color: var(--family-sun-1); color: var(--family-sun-1); }
.hero-meta { display: flex; gap: var(--space-6); margin-top: var(--space-8); flex-wrap: wrap; }
.hero-meta div { font-size: var(--fs-xs); color: var(--hero-pill-text); }
.hero-meta strong { display: block; font-family: var(--font-head); font-size: var(--fs-lg); color: var(--hero-text); }

/* Visual: waveform -> doc */
.hero-visual { position: relative; height: 420px; }
.visual-card {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 60px -20px var(--shadow);
  padding: var(--space-5);
}
.visual-card.card-wave { top: 10%; left: 4%; width: 62%; animation: float 6s ease-in-out infinite; }
.visual-card.card-doc { bottom: 6%; right: 0; width: 66%; animation: float 7s ease-in-out infinite reverse; }
.visual-card.card-tag { top: 46%; left: 46%; width: 46%; animation: float 5.5s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.bars { display: flex; align-items: center; gap: 4px; height: 40px; }
.bars span { width: 4px; background: linear-gradient(180deg, var(--grad-start), var(--grad-end)); border-radius: 4px; animation: bar 1.4s ease-in-out infinite; }
@keyframes bar { 0%,100% { height: 20%; } 50% { height: 100%; } }
.doc-lines span { display: block; height: 8px; border-radius: 4px; background: var(--border); margin-bottom: 8px; }
.doc-lines span:nth-child(1) { width: 90%; } .doc-lines span:nth-child(2) { width: 70%; } .doc-lines span:nth-child(3) { width: 82%; background: var(--brand); opacity: .5;}

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 700ms ease, transform 700ms ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-stagger > * { transition-delay: calc(var(--i, 0) * 90ms); }

/* ---------- How it works ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.step-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(100deg, var(--grad-start), var(--grad-mid), var(--grad-end));
  transform: scaleX(0); transform-origin: left; transition: transform 400ms ease;
}
.step-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); box-shadow: 0 18px 40px -18px var(--shadow); }
.step-card:hover::before { transform: scaleX(1); }
.step-num {
  font-family: var(--font-head); font-size: var(--fs-2xl); font-weight: 700;
  background: linear-gradient(100deg, var(--grad-start), var(--grad-end));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: var(--space-3);
}
.step-card h3 { font-size: var(--fs-md); margin-bottom: var(--space-2); }
.step-card p { margin: 0; font-size: var(--fs-sm); }
.step-arrow { display: none; }

/* ---------- Card grid / Articles ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.card-article {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-3);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  height: 100%;
  overflow: hidden;
}
.card-article::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(100deg, var(--grad-start), var(--grad-mid), var(--grad-end));
  transform: scaleX(0); transform-origin: left; transition: transform 400ms ease;
}
.card-article:hover::before { transform: scaleX(1); }
.card-article:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--brand) 50%, var(--border)); box-shadow: 0 18px 40px -18px var(--shadow); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.tag {
  font-size: var(--fs-xs); font-weight: 600; padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full); background: var(--surface-2); color: var(--text-dim);
  border: 1px solid var(--border);
}
.tag.is-brand { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.read-time { font-size: var(--fs-xs); color: var(--text-faint); }
.card-article h3 { font-size: var(--fs-md); margin-bottom: 0; }
.card-article .excerpt { font-size: var(--fs-sm); margin: 0; flex-grow: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; font-size: var(--fs-xs); color: var(--text-faint); border-top: 1px solid var(--border); padding-top: var(--space-3); }
.card-cta { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-weight: 600; font-size: var(--fs-xs); }

/* ---------- Categories ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--space-4); }
.cat-chip {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-3); text-align: center; font-size: var(--fs-sm); font-weight: 600;
  transition: var(--transition);
}
.cat-chip:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-3px); }
.cat-chip .cat-icon { width: 26px; height: 26px; margin: 0 auto var(--space-2); color: var(--brand); }
.cat-chip .cat-count { display: block; font-weight: 400; color: var(--text-faint); font-size: var(--fs-xs); margin-top: 2px; }

/* ---------- Newsletter ---------- */
.newsletter {
  position: relative;
  background: linear-gradient(120deg, color-mix(in srgb, var(--grad-start) 18%, var(--surface)), color-mix(in srgb, var(--grad-end) 14%, var(--surface)));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-10) var(--space-8);
  text-align: center;
  box-shadow: 0 0 0 1px transparent, 0 30px 70px -30px color-mix(in srgb, var(--brand) 35%, transparent);
  overflow: hidden;
}
.newsletter::before {
  content: ""; position: absolute; inset: -1px; z-index: 0; border-radius: inherit; padding: 1px;
  background: conic-gradient(from 0deg, var(--grad-start), var(--grad-mid), var(--grad-end), var(--grad-start));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0.5; animation: spin 10s linear infinite;
}
.newsletter > * { position: relative; z-index: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .newsletter::before { animation: none; } }
.newsletter h2 { margin-bottom: var(--space-3); }
.newsletter-form { display: flex; gap: var(--space-3); max-width: 440px; margin: var(--space-6) auto 0; }
.newsletter-form input {
  flex: 1; padding: 0.85rem 1.1rem; border-radius: var(--radius-full);
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text); font-size: 1rem;
}
.newsletter-form input:focus { outline: 2px solid var(--brand); outline-offset: 2px; }
.form-note { font-size: var(--fs-xs); color: var(--text-faint); margin-top: var(--space-3); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: var(--space-10) 0 var(--space-6); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--space-8); margin-bottom: var(--space-8); }
.footer-grid h4 { font-size: var(--fs-sm); color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; margin-bottom: var(--space-4); }
.footer-grid a { display: block; font-size: var(--fs-sm); color: var(--text-dim); margin-bottom: var(--space-3); transition: color var(--transition); }
.footer-grid a:hover { color: var(--brand); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-3); padding-top: var(--space-6); border-top: 1px solid var(--border); font-size: var(--fs-xs); color: var(--text-faint); }
.social-icons { display: flex; gap: var(--space-3); }
.social-icons a { width: 34px; height: 34px; border-radius: var(--radius-full); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }
.social-icons svg { width: 16px; height: 16px; }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; bottom: 24px; right: 24px; width: 46px; height: 46px;
  border-radius: 50%; background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none;
  transition: var(--transition); z-index: 90; box-shadow: 0 10px 24px -10px var(--shadow);
}
.to-top.is-visible { opacity: 1; pointer-events: auto; }
.to-top:hover { border-color: var(--brand); }

/* ---------- Page header (sub-pages) ---------- */
.page-header { padding: calc(var(--space-12) + 2.5rem) 0 var(--space-8); text-align: center; }
.breadcrumb { display: flex; gap: var(--space-2); justify-content: center; font-size: var(--fs-xs); color: var(--text-faint); margin-bottom: var(--space-4); }
.breadcrumb a:hover { color: var(--brand); }

/* ---------- Filters (articles page) ---------- */
.filters-bar { display: flex; gap: var(--space-4); align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: var(--space-8); }
.filter-chips { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.chip {
  padding: 0.5rem 1rem; border-radius: var(--radius-full); border: 1px solid var(--border);
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-dim); background: var(--surface);
  transition: var(--transition);
}
.chip.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.search-box { position: relative; min-width: 240px; }
.search-box input {
  width: 100%; padding: 0.7rem 1rem 0.7rem 2.4rem; border-radius: var(--radius-full);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 1rem;
}
.search-box svg { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-faint); }
.empty-state { text-align: center; padding: var(--space-10) 0; color: var(--text-faint); display: none; }
.empty-state.is-visible { display: block; }
.grid-3 .empty-state.is-visible, .grid-2 .empty-state.is-visible { grid-column: 1 / -1; }

/* ---------- Article page ---------- */
.article-layout { display: grid; grid-template-columns: 220px 1fr; gap: var(--space-10); align-items: start; }
.toc { position: sticky; top: 100px; font-size: var(--fs-sm); }
.toc h4 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin-bottom: var(--space-3); }
.toc a { display: block; padding: 0.35rem 0; color: var(--text-dim); border-left: 2px solid var(--border); padding-left: var(--space-3); transition: var(--transition); }
.toc a:hover, .toc a.is-active { color: var(--brand); border-left-color: var(--brand); }
.article-body { max-width: 680px; }
.article-meta { display: flex; gap: var(--space-4); flex-wrap: wrap; align-items: center; font-size: var(--fs-xs); color: var(--text-faint); margin-bottom: var(--space-6); }
.article-title { font-size: var(--fs-2xl); }
.tldr {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--brand);
  border-radius: var(--radius-md); padding: var(--space-5); margin: var(--space-6) 0; font-size: var(--fs-sm);
}
.tldr strong { color: var(--text); font-family: var(--font-head); display: block; margin-bottom: var(--space-2); }
.step-block { margin: var(--space-8) 0; }
.step-chip {
  display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--fs-xs); font-weight: 700;
  color: var(--brand); text-transform: uppercase; letter-spacing: .04em; margin-bottom: var(--space-2);
}
.callout {
  background: var(--surface-2); border-radius: var(--radius-md); padding: var(--space-5);
  border: 1px solid var(--border); margin: var(--space-6) 0; font-size: var(--fs-sm);
}
.callout.is-warning { border-color: var(--family-red-1); background: var(--family-red-soft); color: var(--family-red-soft-text); }
.callout.is-warning strong { color: var(--family-red-2); }
.faq-item { border-bottom: 1px solid var(--border); padding: var(--space-4) 0; }
.faq-item h4 { font-size: var(--fs-base); margin-bottom: var(--space-2); }
.source-credit {
  font-size: var(--fs-xs); color: var(--text-faint); border-top: 1px solid var(--border);
  padding-top: var(--space-4); margin-top: var(--space-8);
}
.article-cta { display: flex; gap: var(--space-3); margin: var(--space-8) 0; flex-wrap: wrap; }

/* ---------- About page ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-10); align-items: center; }
.value-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); margin-top: var(--space-8); }
.value-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-5); }

/* ---------- Utility icon sizing ---------- */
.icon { width: 22px; height: 22px; }

/* ==========================================================================
   WordPress core / block-editor / Elementor compatibility
   ========================================================================== */
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.alignleft { float: left; margin: 0 var(--space-5) var(--space-4) 0; }
.alignright { float: right; margin: 0 0 var(--space-4) var(--space-5); }
.aligncenter { display: block; margin: 0 auto var(--space-4); }
.alignwide { max-width: calc(var(--container) + 4rem); margin-left: auto; margin-right: auto; }
.alignfull { max-width: 100vw; }
.wp-caption, .wp-block-image figure { max-width: 100%; }
.wp-caption-text, figcaption { font-size: var(--fs-xs); color: var(--text-faint); text-align: center; margin-top: var(--space-2); }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); list-style: none; padding: 0; margin: var(--space-6) 0; }
.gallery-item { margin: 0; }
.sticky { border-left: 3px solid var(--brand); padding-left: var(--space-4); }
.bypostpassword input[type="password"] {
  padding: 0.6rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text);
}

/* Typography inside real post content (block editor / Elementor output) */
.article-body h2, .entry-content h2 { font-size: var(--fs-xl); margin-top: var(--space-8); }
.article-body h3, .entry-content h3 { font-size: var(--fs-lg); margin-top: var(--space-6); }
.article-body ul, .article-body ol, .entry-content ul, .entry-content ol {
  margin: 0 0 var(--space-4); padding-left: 1.3rem; color: var(--text-dim);
}
.article-body ul, .entry-content ul { list-style: disc; }
.article-body ol, .entry-content ol { list-style: decimal; }
.article-body li, .entry-content li { margin-bottom: var(--space-2); }
.article-body blockquote, .entry-content blockquote {
  border-left: 3px solid var(--brand); margin: var(--space-6) 0; padding: var(--space-2) var(--space-5);
  font-style: italic; color: var(--text);
}
.article-body img, .entry-content img { border-radius: var(--radius-md); margin: var(--space-4) 0; }
.article-body table, .entry-content table {
  width: 100%; border-collapse: collapse; margin: var(--space-6) 0; font-size: var(--fs-sm);
}
.article-body th, .article-body td, .entry-content th, .entry-content td {
  border: 1px solid var(--border); padding: var(--space-3); text-align: left;
}
.article-body code, .entry-content code {
  background: var(--surface-2); padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.9em;
}
.article-body pre, .entry-content pre {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: var(--space-5); overflow-x: auto; margin: var(--space-6) 0;
}
.article-body a, .entry-content a { color: var(--brand); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--brand) 40%, transparent); }

/* Comments (optional, only renders if comments_template() is called and open) */
.comment-list { list-style: none; padding: 0; margin: var(--space-8) 0 0; }
.comment-list .comment { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-5); margin-bottom: var(--space-4); }
.comment-respond input, .comment-respond textarea {
  width: 100%; padding: 0.7rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); margin-bottom: var(--space-3); font-family: var(--font-body);
  font-size: 1rem;
}

/* Elementor: don't let theme container fight Elementor's own full-width sections */
.elementor-section.elementor-section-full_width, .elementor-section .elementor-container { max-width: none; }

@media (max-width: 720px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .alignleft, .alignright { float: none; margin: var(--space-4) 0; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { height: 320px; margin-top: var(--space-6); }
  .steps { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .article-layout { grid-template-columns: 1fr; }
  .toc { display: none; }
}
@media (max-width: 720px) {
  .nav-links { position: fixed; top: 0; right: 0; height: 100vh; width: min(78vw, 320px);
    background: var(--surface); border-left: 1px solid var(--border); flex-direction: column;
    justify-content: center; align-items: flex-start; padding: var(--space-8); gap: var(--space-5);
    transform: translateX(100%); transition: transform var(--transition); }
  .nav-links.is-open { transform: translateX(0); }
  .nav-toggle { display: flex; }
  .nav-actions .lang-toggle { display: none; }
  .nav-links .lang-toggle-mobile { display: flex; margin-top: var(--space-4); }
  .hero-meta { gap: var(--space-4); }
  .brand-tagline { display: none; }
  .steps { grid-template-columns: 1fr; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-5); }
  .value-grid { grid-template-columns: 1fr; }
  .newsletter { padding: var(--space-8) var(--space-5); }
  .newsletter-form { flex-direction: column; }
  .filters-bar { flex-direction: column; align-items: stretch; }
  .search-box { min-width: 0; }
  .section { padding: var(--space-10) 0; }
  .hero { padding: calc(var(--space-10) + 2rem) 0 var(--space-10); }
}
@media (max-width: 420px) {
  .container { padding: 0 var(--space-4); }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-cta .btn { flex: 1 1 100%; }
}
