/* ============================================================================
   TrendingFAQ.com — Editorial magazine design (mobile-first)
   Light + dark themes, ad slots, autocomplete, fully responsive.
   Fonts: Sora (display) · Inter (UI/body) · Source Serif 4 (article reading)
   Base = mobile, then tablets (>=640px) and desktops (>=1024px).
   ========================================================================== */

:root {
  --bg: #f5f3ee;            /* warm paper */
  --surface: #ffffff;
  --surface-2: #efede6;
  --text: #1d2126;          /* ink */
  --text-soft: #5d646e;
  --brand: #0e7a5f;         /* pine green */
  --brand-2: #15926f;
  --brand-dark: #0a5d47;
  --accent: #d98e2b;        /* amber */
  --accent-2: #f0b04c;
  --border: #e5e0d4;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(23, 30, 26, .05), 0 1px 3px rgba(23, 30, 26, .07);
  --shadow: 0 1px 3px rgba(23, 30, 26, .07), 0 8px 22px -6px rgba(23, 30, 26, .14);
  --shadow-lg: 0 12px 40px -8px rgba(23, 30, 26, .22);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Sora", var(--font);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --header-h: 64px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(900px 320px at 85% -60px, rgba(14, 122, 95, .07), transparent 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

h1, h2, h3, h4 { line-height: 1.22; letter-spacing: -.015em; margin: 0; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 18px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--brand); color: #fff;
  padding: 10px 16px; border-radius: 0 0 10px 0; z-index: 100; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------------------------------------------------------------- Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .86);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}
.site-header::before {
  content: ""; display: block; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent-2));
}

/* Tier 1 — brand, search, theme toggle */
.header-top {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-top: 10px; padding-bottom: 10px;
}

.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand-logo {
  width: 36px; height: 36px; border-radius: 11px; box-shadow: var(--shadow-sm);
  transition: transform .15s;
}
.brand:hover .brand-logo { transform: rotate(-4deg) scale(1.05); }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 1.2rem; letter-spacing: -.03em; color: var(--text); white-space: nowrap; }
.brand-name em { font-style: normal; color: var(--brand); }

.nav-toggle {
  display: inline-flex; flex-direction: column; gap: 4px; justify-content: center;
  width: 42px; height: 42px; padding: 11px; border: 1px solid var(--border);
  background: var(--surface); border-radius: 10px; cursor: pointer; order: 3;
}
.nav-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.search-form {
  display: flex; align-items: center; flex: 1 1 100%; min-width: 220px;
  position: relative; order: 5;
}
.search-form input {
  flex: 1; padding: 11px 15px; border: 1px solid var(--border); border-radius: 999px 0 0 999px;
  font-size: 15px; background: var(--surface-2); outline: none; color: var(--text);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.search-form input::placeholder { color: var(--text-soft); }
.search-form input:focus { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14, 122, 95, .14); }
.search-form button {
  border: 0; background: var(--brand); color: #fff; border-radius: 0 999px 999px 0;
  padding: 0 16px; cursor: pointer; display: flex; align-items: center; height: 44px;
  transition: background .15s;
}
.search-form button:hover { background: var(--brand-dark); }
.search-form-lg input { padding: 15px 20px; font-size: 16px; }
.search-form-lg button { font-weight: 600; height: 52px; padding: 0 26px; }

/* Search autocomplete dropdown */
.search-suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); overflow: hidden; max-height: 320px; overflow-y: auto;
  padding: 6px;
}
.search-suggest a {
  display: block; padding: 10px 12px; border-radius: 8px; color: var(--text);
  font-size: .9rem; font-weight: 500;
}
.search-suggest a:hover { background: var(--surface-2); color: var(--brand); text-decoration: none; }

/* Tier 2 — category navigation bar */
.site-nav { display: none; width: 100%; order: 6; border-top: 1px solid var(--border); background: rgba(255, 255, 255, .5); }
.site-nav.is-open { display: block; }
.nav-inner { padding: 0; }
.nav-list { list-style: none; margin: 0; padding: 8px 0 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-list a {
  display: block; padding: 10px 12px; border-radius: 10px; color: var(--text);
  font-weight: 600; font-size: .95rem; position: relative;
}
.nav-list a:hover { background: var(--surface-2); color: var(--brand); text-decoration: none; }
.nav-list a.is-active { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }

/* ----------------------------------------------------------------- Hero */
.hero { padding: 40px 0 30px; }
.hero-inner { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; }
.hero-copy { max-width: 640px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px;
  font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--brand);
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(217, 142, 43, .5); animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(217, 142, 43, .5); }
  70% { box-shadow: 0 0 0 8px rgba(217, 142, 43, 0); }
  100% { box-shadow: 0 0 0 0 rgba(217, 142, 43, 0); }
}
.hero h1 { font-family: var(--display); font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 800; letter-spacing: -.035em; margin: 0 0 16px; line-height: 1.06; }
.hero h1 em { font-style: normal; background: linear-gradient(120deg, var(--brand) 20%, var(--accent-2) 80%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: var(--text-soft); font-size: 1.12rem; max-width: 560px; margin: 0 0 24px; }
.hero-cats { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 9px 17px; font-size: .88rem; font-weight: 600; color: var(--text);
  box-shadow: var(--shadow-sm); transition: transform .12s, border-color .12s, color .12s, box-shadow .12s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }

/* Trending panel (homepage) */
.trend-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 22px 22px 18px;
}
.trend-panel-title {
  font-family: var(--display); font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 8px;
  margin: 0 0 6px;
}
.trend-icon { font-size: 1.15rem; }
.trend-list { list-style: none; margin: 6px 0 0; padding: 0; counter-reset: trend; }
.trend-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.trend-item:last-child { border-bottom: 0; }
.trend-rank {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 700; font-size: .85rem;
  background: var(--surface-2); color: var(--text-soft);
}
.trend-item:nth-child(1) .trend-rank { background: var(--accent); color: #fff; }
.trend-item:nth-child(2) .trend-rank { background: var(--accent-2); color: #fff; }
.trend-item:nth-child(3) .trend-rank { background: var(--brand-2); color: #fff; }
.trend-item a { display: flex; align-items: center; gap: 12px; color: var(--text); flex: 1; min-width: 0; }
.trend-item a:hover { color: var(--brand); }
.trend-title { font-weight: 600; font-size: .96rem; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.trend-views { margin-left: auto; flex-shrink: 0; font-size: .78rem; color: var(--text-soft); white-space: nowrap; }
.trend-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-weight: 700; font-size: .9rem; color: var(--brand); }
.trend-more:hover { color: var(--brand-dark); }

/* --------------------------------------------------------------- Sections */
.section { padding: 12px 0 34px; }
.section-title { font-family: var(--display); font-size: 1.35rem; margin: 0 0 20px; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ""; width: 5px; height: 22px; border-radius: 999px; background: linear-gradient(var(--brand), var(--accent-2)); }
.page-title { font-family: var(--display); font-size: clamp(1.7rem, 4.5vw, 2.4rem); margin: 8px 0 10px; letter-spacing: -.03em; }
.page-lede { color: var(--text-soft); max-width: 720px; font-size: 1.05rem; }

.card-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--brand-2); }
.card-img { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-img img { transform: scale(1.05); }
.card-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: rgba(255, 255, 255, .92); color: var(--brand); backdrop-filter: blur(4px);
  font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.card-body { padding: 17px 19px 19px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-meta { font-size: .78rem; color: var(--text-soft); font-weight: 600; margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-title { font-family: var(--display); font-size: 1.12rem; line-height: 1.35; margin: 0; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--brand); }
.card-excerpt { font-size: .9rem; color: var(--text-soft); margin: 0; }
.card-foot { margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .8rem; color: var(--text-soft); }
.card-more { font-weight: 700; color: var(--brand); white-space: nowrap; }
.card-more:hover { color: var(--brand-dark); }
.card-foot svg { vertical-align: -2px; }

.empty { color: var(--text-soft); text-align: center; padding: 40px 0; }

/* ------------------------------------------------------------- Breadcrumbs */
.breadcrumbs { padding: 16px 0 6px; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; font-size: .82rem; color: var(--text-soft); }
.breadcrumbs li + li::before { content: "›"; margin-right: 6px; color: #b9b2a2; }
.breadcrumbs a { color: var(--text-soft); }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs [aria-current="page"] { color: var(--text); font-weight: 600; }

/* --------------------------------------------------------------- Article */
.article {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 26px 22px; margin-top: 8px;
}
.article-kicker {
  display: inline-block; margin: 0 0 12px; padding: 5px 12px;
  background: var(--surface-2); color: var(--brand); border: 1px solid var(--border);
  border-radius: 999px; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.article-title { font-family: var(--display); font-size: clamp(1.85rem, 5vw, 2.7rem); line-height: 1.14; letter-spacing: -.03em; margin: 0 0 16px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--text-soft); font-size: .9rem; margin-bottom: 18px; align-items: center; }
.article-meta .meta-date a, .article-meta .meta-author a { color: var(--text-soft); font-weight: 600; }
.article-meta a:hover { color: var(--brand); }
.article-meta svg { vertical-align: -2px; margin-right: 3px; }
.article-id { font-size: .72rem; color: #b9b2a2; margin: 0 0 8px; }

.article-hero { margin: 0 0 20px; }
.article-hero img {
  width: 100%; max-width: 720px; height: auto; margin: 0 auto;
  border-radius: 14px; display: block; box-shadow: var(--shadow-sm);
  max-height: 320px; object-fit: cover;
}

.article-content { font-family: var(--serif); font-size: 1.16rem; line-height: 1.85; }
.article-content h2 { font-family: var(--display); font-size: 1.6rem; margin: 1.7em 0 .6em; }
.article-content h3 { font-family: var(--display); font-size: 1.3rem; margin: 1.5em 0 .5em; }
.article-content p { margin: 0 0 1.15em; }
.article-content a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(14, 122, 95, .4); }
.article-content ul, .article-content ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.article-content li { margin-bottom: .45em; }
.article-content blockquote { margin: 0 0 1.2em; padding: 6px 20px; border-left: 4px solid var(--accent-2); background: var(--surface-2); border-radius: 0 12px 12px 0; color: var(--text-soft); font-style: italic; }
.article-content img { border-radius: 12px; margin: 1.2em auto; box-shadow: var(--shadow-sm); }
.article-content code { background: var(--surface-2); padding: 2px 7px; border-radius: 6px; font-size: .9em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.faq-item { border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; margin: 16px 0; background: var(--surface); box-shadow: var(--shadow-sm); }
.faq-question { font-family: var(--display); font-size: 1.12rem; margin: 0 0 8px; font-weight: 700; display: flex; gap: 10px; align-items: baseline; }
.faq-question::before { content: "Q"; flex-shrink: 0; width: 24px; height: 24px; border-radius: 7px; background: var(--accent); color: #fff; font-size: .8rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.faq-answer { color: var(--text); }
.faq-answer p { margin: 0; }

.article-footer { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border); }

.share { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.share-label { font-weight: 700; font-size: .9rem; }
.share-list { display: flex; gap: 8px; flex-wrap: wrap; }
.share-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
  font-size: .82rem; font-weight: 600; color: #fff; border: 0; cursor: pointer;
  transition: transform .12s, opacity .12s; box-shadow: var(--shadow-sm);
}
.share-btn:hover { transform: translateY(-2px); opacity: .9; text-decoration: none; color: #fff; }
.share-x { background: #111827; }
.share-facebook { background: #1877f2; }
.share-linkedin { background: #0a66c2; }
.share-reddit { background: #ff4500; }
.share-whatsapp { background: #25d366; }
.share-email { background: #64748b; }

/* -------------------------------------------------------------- Author box */
.author-box { display: flex; gap: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; margin-top: 24px; box-shadow: var(--shadow); align-items: flex-start; }
.author-photo { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 3px solid var(--surface-2); }
.author-info { min-width: 0; }
.author-role { margin: 0 0 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: 800; }
.author-name { margin: 0 0 8px; font-family: var(--display); font-size: 1.3rem; }
.author-bio { margin: 0 0 8px; color: var(--text-soft); font-size: .95rem; }
.author-expertise { margin: 0 0 8px; font-size: .88rem; }
.author-expertise strong { color: var(--text); }
.author-linkedin { font-size: .9rem; font-weight: 600; }

.author-profile { display: flex; gap: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; margin-top: 8px; box-shadow: var(--shadow); align-items: flex-start; }
.author-profile .author-photo { width: 112px; height: 112px; }
.author-count { color: var(--text-soft); margin: 0 0 8px; }

/* ------------------------------------------------------------- Pagination */
.pagination { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: center; padding: 26px 0 10px; }
.page-link { padding: 9px 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 600; font-size: .9rem; transition: border-color .12s, color .12s, background .12s; }
.page-link:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.page-link.is-current { background: var(--brand); border-color: transparent; color: #fff; box-shadow: var(--shadow-sm); }

/* ---------------------------------------------------------------- Footer */
.site-footer { background: #14211c; color: #b9c9c1; margin-top: 52px; }
.site-footer::before { content: ""; display: block; height: 3px; background: linear-gradient(90deg, var(--brand), var(--accent-2)); }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 30px; padding: 44px 18px 28px; }
.footer-brand { max-width: 320px; }
.footer-logo { font-family: var(--display); font-weight: 800; font-size: 1.3rem; color: #fff; margin: 0 0 10px; }
.footer-logo em { font-style: normal; color: #46c99a; }
.footer-brand p:not(.footer-logo) { margin: 0; font-size: .92rem; color: #93a89e; }
.footer-col h3 { font-family: var(--display); font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #fff; margin: 0 0 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer-col a { color: #b9c9c1; font-size: .92rem; }
.footer-col a:hover { color: #fff; }
.footer-legal { border-top: 1px solid rgba(255, 255, 255, .1); padding: 18px 18px 24px; font-size: .8rem; color: #7d958a; }
.footer-legal p { margin: 0; }
.footer-legal a { color: #93a89e; }
.footer-legal a:hover { color: #fff; }

/* ------------------------------------------------------------ Error page */
.error-page { text-align: center; padding: 60px 0; }
.error-code { font-family: var(--display); font-size: 5rem; font-weight: 800; background: linear-gradient(135deg, var(--brand), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; margin: 0; line-height: 1; }
.btn { display: inline-block; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; padding: 13px 24px; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .12s; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; color: #fff; }

/* ------------------------------------------------------------ Results */
.result-count { color: var(--text-soft); }
.category-head, .search-head { padding: 8px 0 14px; }

/* --------------------------------------------------------- Contact form */
.contact-form-wrap { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.contact-success {
  background: #ecfdf3; border: 1px solid #bbf7d0; color: #166534;
  border-radius: 12px; padding: 16px 18px; font-size: .98rem; line-height: 1.6;
}
.contact-error {
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
  border-radius: 12px; padding: 12px 16px; margin: 0 0 16px;
}
.contact-form { display: grid; gap: 16px; max-width: 640px; }
.contact-row { display: grid; grid-template-columns: 1fr; gap: 16px; }
.contact-field { display: grid; gap: 6px; }
.contact-field label { font-weight: 600; font-size: .88rem; color: var(--text); }
.contact-field input,
.contact-field textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 15px; font-family: var(--font); background: var(--surface); color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.contact-field textarea { resize: vertical; min-height: 130px; }
.contact-field input:focus,
.contact-field textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14, 122, 95, .14);
}
.contact-err { font-size: .8rem; color: var(--danger, #dc2626); }
.contact-hp { position: absolute; left: -9999px; top: -9999px; height: 0; overflow: hidden; }
.contact-submit { justify-self: start; margin-top: 4px; }
[data-theme="dark"] .contact-success { background: rgba(22, 101, 52, .18); border-color: rgba(34, 197, 94, .3); color: #bbf7d0; }
[data-theme="dark"] .contact-error { background: rgba(185, 28, 28, .18); border-color: rgba(239, 68, 68, .3); color: #fecaca; }
[data-theme="dark"] .contact-field input,
[data-theme="dark"] .contact-field textarea { background: var(--surface-2); }
@media (min-width: 640px) {
  .contact-row { grid-template-columns: 1fr 1fr; }
}

/* ============================================================= THEME TOGGLE */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); cursor: pointer; flex-shrink: 0;
  transition: border-color .12s, color .12s, transform .12s;
}
.theme-toggle:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* =============================================================== AD SLOTS */
.ad-slot { margin: 16px 0; }
.ad-label {
  display: block; font-size: .66rem; text-transform: uppercase;
  letter-spacing: .12em; color: var(--text-soft); text-align: center; margin-bottom: 8px;
}
.page-grid { display: block; }
.ad-col { display: none; }
.content-col { min-width: 0; }

/* ============================================================== DARK THEME */
[data-theme="dark"] {
  --bg: #0d1210;
  --surface: #151b18;
  --surface-2: #1c2420;
  --text: #e6ece8;
  --text-soft: #93a29b;
  --brand: #3ec590;
  --brand-2: #2aa879;
  --brand-dark: #57d6a3;
  --accent: #f0b04c;
  --accent-2: #f5c26b;
  --border: #26312b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 1px 3px rgba(0, 0, 0, .25);
  --shadow: 0 1px 3px rgba(0, 0, 0, .35), 0 8px 22px -6px rgba(0, 0, 0, .5);
  --shadow-lg: 0 12px 40px -8px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
[data-theme="dark"] body { background: radial-gradient(900px 320px at 85% -60px, rgba(62, 197, 144, .08), transparent 70%), var(--bg); }
[data-theme="dark"] .site-header { background: rgba(13, 18, 16, .88); }
[data-theme="dark"] .site-nav { background: rgba(13, 18, 16, .5); }
[data-theme="dark"] .nav-list a.is-active { background: var(--brand); color: #0b1a13; }
[data-theme="dark"] .card:hover { border-color: #2e4a3d; }
[data-theme="dark"] .search-form input { background: #0f1512; color: var(--text); }
[data-theme="dark"] .article-content blockquote { background: #17201c; }
[data-theme="dark"] .article-content code { background: #1c2420; color: #cfe0d8; }
[data-theme="dark"] .faq-item { background: var(--surface); }
[data-theme="dark"] .breadcrumbs li + li::before { color: #4a5a52; }
[data-theme="dark"] .article-id { color: #4a5a52; }
[data-theme="dark"] .card-badge { background: rgba(21, 27, 24, .88); }
[data-theme="dark"] .site-footer { background: #0a0f0d; }
[data-theme="dark"] .search-suggest a:hover { background: var(--surface-2); }
[data-theme="dark"] .trend-item:nth-child(1) .trend-rank { background: var(--accent); color: #1a1405; }
[data-theme="dark"] .trend-item:nth-child(2) .trend-rank { background: var(--accent-2); color: #1a1405; }
[data-theme="dark"] .trend-item:nth-child(3) .trend-rank { background: var(--brand-2); color: #07110d; }
[data-theme="dark"] .btn { color: #fff; }
[data-theme="dark"] .share-x, [data-theme="dark"] .share-facebook, [data-theme="dark"] .share-linkedin, [data-theme="dark"] .share-reddit, [data-theme="dark"] .share-whatsapp, [data-theme="dark"] .share-email { color: #fff; }
[data-theme="dark"] .author-photo { border-color: var(--surface-2); }

/* Smooth theme transitions (disabled for reduced-motion users) */
body, .site-header, .card, .article, .author-box, .author-profile, .page-link,
.chip, .search-form input, .nav-list a, .theme-toggle, .search-suggest a {
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
@media (prefers-reduced-motion: reduce) {
  body, .site-header, .card, .article, .author-box, .author-profile, .page-link,
  .chip, .search-form input, .nav-list a, .theme-toggle, .search-suggest a,
  .card-img img, .card, .chip, .btn, .share-btn, .live-dot { transition: none; animation: none; }
  html { scroll-behavior: auto; }
}

/* ============================================================== RESPONSIVE */
@media (min-width: 640px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 22px; }
  .article, .author-box, .author-profile { padding: 34px 38px; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 34px; }
  .footer-legal { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
  .container { padding: 0 24px; }
  .hero-inner { grid-template-columns: 1fr; }
}

@media (min-width: 1024px) {
  .container { padding: 0 28px; }
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .nav-toggle { display: none; }
  /* Desktop: nav becomes its own aligned bar under the top row */
  .search-form { flex: 0 1 320px; order: 0; }
  .header-top { padding-top: 12px; padding-bottom: 12px; }
  .site-nav { display: block; order: 0; background: transparent; }
  .nav-inner { padding: 0; }
  .nav-list { flex-direction: row; gap: 4px; padding: 0 0 12px; flex-wrap: wrap; }
  .nav-list a { border-radius: 999px; padding: 9px 15px; }
  .hero { padding: 56px 0 40px; }
  .hero-inner { grid-template-columns: 1.25fr .75fr; gap: 44px; }

  /* Desktop ad columns */
  .page-grid { display: flex; align-items: flex-start; gap: 28px; }
  .ad-col { display: block; width: 280px; flex-shrink: 0; position: sticky; top: 128px; }
  .ad-top, .ad-bottom { display: none; }
  .content-col { flex: 1; min-width: 0; }
  .has-ads .main.container { max-width: 1320px; }
}
