/* Riproar theme — main.css
   Design system: Inter, blue #2563EB + purple #7C3AED accents,
   rounded cards, soft shadows, mobile-first, dark mode. */

:root {
  --brand-blue: #2563EB;
  --brand-blue-600: #1D4ED8;
  --brand-purple: #7C3AED;
  --brand-purple-600: #6D28D9;
  --brand-gradient: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);

  --bg: #ffffff;
  --bg-muted: #F7F8FB;
  --bg-elev: #ffffff;
  --fg: #0B1220;
  --fg-muted: #4B5563;
  --fg-subtle: #6B7280;
  --border: #E5E7EB;
  --border-strong: #D1D5DB;
  --card: #ffffff;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --shadow: 0 6px 20px -8px rgba(37,99,235,.15), 0 2px 6px rgba(15,23,42,.04);
  --shadow-lg: 0 20px 40px -20px rgba(124,58,237,.25), 0 4px 12px rgba(15,23,42,.06);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --container: 1200px;
  --container-narrow: 780px;

  --font-sans: 'Inter','SF Pro Text',system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  --font-display: 'Inter',system-ui,sans-serif;

  --duration: .22s;
  --ease: cubic-bezier(.2,.7,.2,1);
}

html.dark {
  --bg: #0A0F1C;
  --bg-muted: #0F172A;
  --bg-elev: #111827;
  --fg: #F3F4F6;
  --fg-muted: #C7CBD1;
  --fg-subtle: #9CA3AF;
  --border: #1F2937;
  --border-strong: #2A3446;
  --card: #111827;
  --shadow: 0 6px 20px -8px rgba(37,99,235,.35), 0 2px 6px rgba(0,0,0,.4);
  --shadow-lg: 0 20px 40px -20px rgba(124,58,237,.5), 0 4px 12px rgba(0,0,0,.4);
}

*,*::before,*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img,svg,video,iframe { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-blue); text-decoration: none; transition: color var(--duration) var(--ease); }
a:hover { color: var(--brand-purple); }
h1,h2,h3,h4,h5 { font-family: var(--font-display); color: var(--fg); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 2.5vw, 2.25rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--fg-muted); }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
::selection { background: color-mix(in oklab, var(--brand-purple) 30%, transparent); color: var(--fg); }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.container--narrow { max-width: var(--container-narrow); }
.section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section--muted { background: var(--bg-muted); }
.section--cta { padding: clamp(3rem,6vw,5rem) 0; }
.screen-reader-text { position: absolute !important; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; padding: 10px 16px; background: var(--fg); color: var(--bg); border-radius: 0 0 var(--radius-sm) 0; }
.skip-link:focus { left: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: .7em 1.15em; border-radius: 999px; font-weight: 600; font-size: .95rem; border: 1px solid transparent; cursor: pointer; transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), background var(--duration) var(--ease), color var(--duration) var(--ease); text-decoration: none; }
.btn--primary { background: var(--brand-gradient); color: #fff; box-shadow: var(--shadow); }
.btn--primary:hover { color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn--ghost { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--bg-muted); color: var(--fg); }
.btn--sm { padding: .5em .95em; font-size: .875rem; }
.btn--lg { padding: .9em 1.6em; font-size: 1.05rem; }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: transparent; color: var(--fg); border: 1px solid transparent; cursor: pointer; transition: all var(--duration) var(--ease); }
.icon-btn:hover { background: var(--bg-muted); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in oklab, var(--bg) 85%, transparent); backdrop-filter: saturate(150%) blur(14px); -webkit-backdrop-filter: saturate(150%) blur(14px); border-bottom: 1px solid var(--border); }
.site-header__inner { display: flex; align-items: center; gap: 24px; padding: 14px 20px; }
.site-logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--fg); font-size: 1.15rem; letter-spacing: -0.02em; }
.site-logo__mark { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 10px; background: var(--brand-gradient); color: #fff; font-weight: 800; font-size: .95rem; box-shadow: var(--shadow); }
.primary-nav { flex: 1; }
.primary-menu { list-style: none; padding: 0; margin: 0; display: flex; gap: 6px; }
.primary-menu a { display: inline-block; padding: 8px 14px; border-radius: 10px; color: var(--fg-muted); font-weight: 500; font-size: .95rem; }
.primary-menu a:hover, .primary-menu .current-menu-item > a { color: var(--fg); background: var(--bg-muted); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.js-mobile-toggle { display: none; }

@media (max-width: 900px) {
  .primary-nav { display: none; }
  .js-mobile-toggle { display: inline-flex; }
  .hide-mobile { display: none; }
}
.mobile-menu { border-top: 1px solid var(--border); background: var(--bg); padding: 12px 20px 16px; }
.mobile-menu__list, .mobile-menu ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.mobile-menu a { display: block; padding: 12px 14px; border-radius: 10px; color: var(--fg); font-weight: 500; }
.mobile-menu a:hover { background: var(--bg-muted); }

/* Site-wide inline search bar */
.site-search { border-top: 1px solid var(--border); background: var(--bg); padding: 16px 0; }
.site-search .ajax-search-form { display: flex; gap: 10px; max-width: 720px; margin: 0 auto; position: relative; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: clamp(3.5rem,8vw,6.5rem) 0 clamp(3rem,6vw,5rem); }
.hero__bg { position: absolute; inset: -20% -10% auto -10%; height: 120%; background:
    radial-gradient(circle at 20% 20%, color-mix(in oklab, var(--brand-blue) 30%, transparent), transparent 40%),
    radial-gradient(circle at 80% 30%, color-mix(in oklab, var(--brand-purple) 28%, transparent), transparent 45%),
    radial-gradient(circle at 50% 80%, color-mix(in oklab, var(--brand-blue) 20%, transparent), transparent 45%);
  filter: blur(60px); opacity: .55; z-index: 0; pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; text-align: center; }
.hero__eyebrow { display: inline-block; padding: 6px 14px; border-radius: 999px; background: color-mix(in oklab, var(--brand-purple) 12%, transparent); color: var(--brand-purple); font-weight: 600; font-size: .85rem; margin-bottom: 20px; border: 1px solid color-mix(in oklab, var(--brand-purple) 25%, transparent); }
.hero__title { max-width: 900px; margin: 0 auto .8rem; background: linear-gradient(180deg, var(--fg) 0%, color-mix(in oklab, var(--fg) 70%, var(--brand-purple)) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero__subtitle { max-width: 640px; margin: 0 auto 2rem; font-size: 1.1rem; color: var(--fg-muted); }
.hero__search { display: flex; align-items: center; gap: 8px; max-width: 640px; margin: 0 auto 1.5rem; padding: 8px; background: var(--card); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow-lg); position: relative; }
.hero__search-icon { color: var(--fg-subtle); margin-left: 14px; flex-shrink: 0; }
.hero__search input[type="search"] { flex: 1; border: 0; background: transparent; padding: 12px 6px; font: inherit; color: var(--fg); outline: none; min-width: 0; }
.hero__cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 3rem; }
.hero__stats { list-style: none; padding: 0; margin: 0; display: flex; gap: 40px; justify-content: center; flex-wrap: wrap; }
.hero__stats li { display: grid; }
.hero__stats strong { font-size: 1.75rem; font-weight: 800; color: var(--fg); letter-spacing: -0.02em; }
.hero__stats span { font-size: .85rem; color: var(--fg-subtle); }

/* Sections */
.section__head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 2rem; }
.section__head--center { justify-content: center; text-align: center; }
.section__title { margin: 0 0 6px; }
.section__sub { margin: 0; color: var(--fg-subtle); }
.section__link { font-weight: 600; color: var(--brand-blue); white-space: nowrap; }

/* Cards */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.tool-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), border-color var(--duration) var(--ease); }
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in oklab, var(--brand-purple) 40%, var(--border)); }
.tool-card__link { display: block; color: inherit; }
.tool-card__link:hover { color: inherit; }
.tool-card__thumb { aspect-ratio: 16 / 10; background: var(--bg-muted); overflow: hidden; }
.tool-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.tool-card:hover .tool-card__thumb img { transform: scale(1.05); }
.tool-card__thumb-fallback { width: 100%; height: 100%; display: grid; place-items: center; background: var(--brand-gradient); color: #fff; font-size: 3rem; font-weight: 800; }
.tool-card__body { padding: 18px 20px 20px; }
.tool-card__cat { display: inline-block; font-size: .75rem; font-weight: 600; color: var(--brand-purple); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.tool-card__title { font-size: 1.1rem; margin: 0 0 6px; color: var(--fg); }
.tool-card__excerpt { color: var(--fg-subtle); font-size: .9rem; margin: 0 0 14px; }
.tool-card__meta { display: flex; align-items: center; justify-content: space-between; font-size: .85rem; }
.tool-card__rating { color: #F59E0B; font-weight: 600; }
.tool-card__cta { color: var(--brand-blue); font-weight: 600; }

/* Categories */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.cat-card { display: grid; gap: 6px; padding: 22px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); text-align: center; color: var(--fg); transition: all var(--duration) var(--ease); }
.cat-card:hover { transform: translateY(-2px); border-color: color-mix(in oklab, var(--brand-blue) 40%, var(--border)); box-shadow: var(--shadow); color: var(--fg); }
.cat-card__icon { font-size: 1.8rem; }
.cat-card__name { font-weight: 600; }
.cat-card__count { font-size: .8rem; color: var(--fg-subtle); }

/* Features */
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 20px; }
.feature-card { padding: 24px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.feature-card__icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: color-mix(in oklab, var(--brand-blue) 12%, transparent); font-size: 1.5rem; margin-bottom: 12px; }
.feature-card h3 { margin: 0 0 6px; }
.feature-card p { margin: 0; color: var(--fg-muted); font-size: .95rem; }

/* Reviews */
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.review-card { margin: 0; padding: 26px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.review-card__stars { color: #F59E0B; margin-bottom: 10px; letter-spacing: 2px; }
.review-card blockquote { margin: 0 0 16px; padding: 0; font-size: 1.05rem; color: var(--fg); line-height: 1.5; }
.review-card figcaption { display: grid; }
.review-card figcaption strong { color: var(--fg); }
.review-card figcaption span { color: var(--fg-subtle); font-size: .85rem; }

/* Posts */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.post-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: all var(--duration) var(--ease); }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.post-card__link { color: inherit; display: block; }
.post-card__link:hover { color: inherit; }
.post-card__thumb { aspect-ratio: 16/9; overflow: hidden; background: var(--bg-muted); }
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card__thumb-fallback { width: 100%; height: 100%; display: grid; place-items: center; background: var(--brand-gradient); color: #fff; font-size: 3rem; font-weight: 800; }
.post-card__body { padding: 20px 22px 22px; }
.post-cat { display: inline-block; font-size: .75rem; font-weight: 600; color: var(--brand-purple); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.post-card__title { font-size: 1.15rem; margin: 0 0 8px; color: var(--fg); }
.post-card__excerpt { color: var(--fg-subtle); font-size: .92rem; margin: 0 0 12px; }
.post-card__meta { color: var(--fg-subtle); font-size: .8rem; }

/* Newsletter */
.newsletter { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; padding: 40px; border-radius: var(--radius-xl); background: var(--brand-gradient); color: #fff; box-shadow: var(--shadow-lg); }
.newsletter h2 { color: #fff; margin-bottom: 8px; }
.newsletter p { color: rgba(255,255,255,.85); margin: 0; }
.newsletter__form { display: flex; gap: 8px; background: #fff; padding: 8px; border-radius: 999px; }
.newsletter__form input { flex: 1; border: 0; padding: 12px 16px; font: inherit; background: transparent; color: var(--fg); outline: none; min-width: 0; }
@media (max-width: 720px) { .newsletter { grid-template-columns: 1fr; padding: 28px; } }

/* FAQ */
.faq-list { display: grid; gap: 12px; }
.faq-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 0; overflow: hidden; }
.faq-item summary { list-style: none; cursor: pointer; padding: 18px 22px; font-weight: 600; color: var(--fg); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.5rem; color: var(--brand-blue); transition: transform var(--duration) var(--ease); }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item__body { padding: 0 22px 20px; color: var(--fg-muted); }

/* Footer */
.site-footer { background: var(--bg-muted); padding: 60px 0 30px; border-top: 1px solid var(--border); }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.site-footer__about { color: var(--fg-subtle); font-size: .92rem; margin-top: 12px; max-width: 320px; }
.site-footer__col h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-subtle); margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--fg-muted); font-size: .95rem; }
.site-footer a:hover { color: var(--brand-blue); }
.site-footer__bottom { border-top: 1px solid var(--border); padding-top: 20px; color: var(--fg-subtle); font-size: .85rem; text-align: center; }
@media (max-width: 780px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .site-footer__grid { grid-template-columns: 1fr; } }

/* Breadcrumbs */
.riproar-breadcrumbs ol { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 4px; font-size: .85rem; color: var(--fg-subtle); }
.riproar-breadcrumbs li:not(:last-child)::after { content: '/'; margin: 0 8px; color: var(--border-strong); }
.riproar-breadcrumbs a { color: var(--fg-subtle); }
.riproar-breadcrumbs a:hover { color: var(--brand-blue); }

/* Page wrap */
.page-wrap { padding: 40px 20px 80px; }
.page-head { margin-bottom: 32px; }
.page-title { margin: 0 0 8px; }
.page-sub { color: var(--fg-muted); font-size: 1.05rem; }

/* Layout with sidebar */
.layout-with-sidebar { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 40px; }
.layout-side .widget { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.widget-title { font-size: 1rem; margin: 0 0 12px; }
.layout-side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
@media (max-width: 900px) { .layout-with-sidebar { grid-template-columns: 1fr; } }

/* Prose (article body) */
.prose { max-width: 760px; font-size: 1.05rem; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.6em; }
.prose p, .prose ul, .prose ol { color: var(--fg-muted); }
.prose a { text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--brand-blue) 40%, transparent); text-underline-offset: 3px; }
.prose blockquote { margin: 1.5em 0; padding: 12px 20px; border-left: 4px solid var(--brand-purple); background: var(--bg-muted); border-radius: 0 var(--radius) var(--radius) 0; color: var(--fg); font-style: italic; }
.prose code { background: var(--bg-muted); padding: 2px 6px; border-radius: 6px; font-size: .92em; }
.prose pre { background: var(--bg-muted); padding: 16px; border-radius: var(--radius); overflow-x: auto; }
.prose img { border-radius: var(--radius); }

.post-toc { background: var(--bg-muted); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; margin: 0 0 28px; }
.post-toc strong { display: block; margin-bottom: 8px; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-subtle); }
.post-toc ol { list-style: decimal; padding-left: 22px; margin: 0; display: grid; gap: 4px; }
.post-toc .toc-h3 { padding-left: 12px; font-size: .92rem; }

/* Single post */
.single-post__title { margin-top: 8px; }
.single-post__meta { color: var(--fg-subtle); font-size: .9rem; }
.single-post__cover { margin: 20px 0 30px; border-radius: var(--radius-lg); overflow: hidden; }
.post-share { display: flex; gap: 12px; align-items: center; margin: 40px 0 20px; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.post-share span { color: var(--fg-subtle); font-size: .9rem; }
.author-box { display: flex; gap: 16px; align-items: flex-start; padding: 20px; background: var(--bg-muted); border-radius: var(--radius); margin: 30px 0; }
.author-box img { border-radius: 50%; }
.author-box h3 { margin: 0 0 4px; }
.author-box p { margin: 0; color: var(--fg-muted); font-size: .95rem; }

/* Single tool */
.tool-head { margin-bottom: 20px; }
.tool-head__title { margin: 8px 0 6px; }
.tool-head__excerpt { color: var(--fg-muted); font-size: 1.1rem; max-width: 780px; }
.tool-head__actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.rating { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--bg-muted); border: 1px solid var(--border); border-radius: 999px; font-size: .9rem; }
.rating__avg { color: #F59E0B; font-weight: 700; }
.rating__count { color: var(--fg-subtle); }
.rating__stars { display: inline-flex; gap: 2px; margin-left: 4px; }
.rating__star { background: none; border: 0; padding: 0 2px; cursor: pointer; color: var(--border-strong); font-size: 1.15rem; transition: color .15s; }
.rating__star:hover, .rating__star.is-active, .rating__star.is-active ~ .rating__star { }
.rating__stars:hover .rating__star { color: #F59E0B; }
.rating__stars .rating__star:hover ~ .rating__star { color: var(--border-strong); }
.js-bookmark[aria-pressed="true"] { background: color-mix(in oklab, var(--brand-purple) 12%, transparent); color: var(--brand-purple); border-color: color-mix(in oklab, var(--brand-purple) 40%, transparent); }

.tool-embed { margin: 20px 0 32px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); background: var(--card); box-shadow: var(--shadow); }
.tool-embed iframe { width: 100%; min-height: 560px; border: 0; display: block; }
.tool-embed__placeholder { padding: 40px; }
.tool-block { margin-bottom: 40px; }
.tool-block h2 { margin-bottom: 16px; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checklist li { padding-left: 32px; position: relative; color: var(--fg-muted); }
.checklist li::before { content: '✓'; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: color-mix(in oklab, var(--brand-blue) 15%, transparent); color: var(--brand-blue); display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.steps { padding-left: 20px; display: grid; gap: 10px; color: var(--fg-muted); }
.steps li::marker { color: var(--brand-purple); font-weight: 700; }

/* Filter bar (archive) */
.filter-bar { display: grid; gap: 16px; margin-bottom: 28px; }
.filter-bar__search { position: relative; }
.filter-bar__search input { width: 100%; padding: 14px 20px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--fg); font: inherit; outline: none; }
.filter-bar__search input:focus { border-color: var(--brand-blue); box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand-blue) 15%, transparent); }
.filter-bar__cats { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; padding: 8px 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); color: var(--fg-muted); font-size: .88rem; font-weight: 500; }
.chip:hover { color: var(--fg); border-color: var(--border-strong); }
.chip.is-active { background: var(--brand-gradient); color: #fff; border-color: transparent; }

/* AJAX search results */
.ajax-search-form { position: relative; }
.ajax-search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); max-height: 400px; overflow-y: auto; z-index: 100; display: none; }
.ajax-search-results.is-open { display: block; }
.ajax-search-results a { display: flex; gap: 12px; align-items: center; padding: 10px 14px; color: var(--fg); border-bottom: 1px solid var(--border); }
.ajax-search-results a:last-child { border-bottom: 0; }
.ajax-search-results a:hover { background: var(--bg-muted); color: var(--fg); }
.ajax-search-results img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.ajax-search-results .type { margin-left: auto; font-size: .75rem; color: var(--fg-subtle); text-transform: uppercase; letter-spacing: .05em; }

/* Forms */
.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 6px; font-weight: 500; color: var(--fg); font-size: .92rem; }
.form input, .form textarea, .form select { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--fg); font: inherit; outline: none; transition: all var(--duration) var(--ease); }
.form input:focus, .form textarea:focus { border-color: var(--brand-blue); box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand-blue) 15%, transparent); }

/* Pagination */
.pagination { margin-top: 40px; display: flex; justify-content: center; }
.pagination .nav-links { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--border); color: var(--fg-muted); font-weight: 600; }
.pagination a:hover { color: var(--fg); border-color: var(--border-strong); }
.pagination .current { background: var(--brand-gradient); color: #fff; border-color: transparent; }

/* Ad slot */
.ad-slot { margin: 24px auto; text-align: center; }
.ad-slot--header { padding: 12px 20px; }
.ad-slot--footer { padding: 20px; }

/* Comments */
.comments-area { margin-top: 48px; }
.comment-list { list-style: none; padding: 0; margin: 0 0 32px; display: grid; gap: 16px; }
.comment-body { padding: 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.comment-form input, .comment-form textarea { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--fg); font: inherit; margin-bottom: 12px; }
.comment-form .submit { background: var(--brand-gradient); color: #fff; border: 0; padding: .8em 1.4em; border-radius: 999px; font-weight: 600; cursor: pointer; }

/* Back to top */
.back-to-top { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 44px; height: 44px; border-radius: 50%; background: var(--brand-gradient); color: #fff; border: 0; box-shadow: var(--shadow-lg); cursor: pointer; display: none; align-items: center; justify-content: center; transition: transform .2s var(--ease); }
.back-to-top.is-visible { display: inline-flex; }
.back-to-top:hover { transform: translateY(-3px); }

/* Error 404 */
.error-404 { text-align: center; padding: 80px 20px; }
.error-404 h1 { font-size: clamp(4rem, 10vw, 8rem); background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 8px; }
.error-404 form { max-width: 480px; margin: 20px auto; display: flex; gap: 8px; }
.error-404 input[type="search"] { flex: 1; padding: 12px 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--fg); outline: none; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* Dark-mode icon toggle */
.icon-moon { display: none; }
html.dark .icon-sun { display: none; }
html.dark .icon-moon { display: block; }
