/* ==========================================================================
   Gadgetsview 2.0 — design system
   ========================================================================== */

:root {
    --bg: #ffffff;
    --surface: #f5f7fa;
    --surface-2: #eef1f6;
    --card: #ffffff;
    --ink: #0b1220;
    --ink-2: #273246;
    --muted: #5d6779;
    --line: #e5e9f0;
    --line-strong: #d5dbe5;
    --accent: #1d5bff;
    --accent-ink: #ffffff;
    --accent-soft: #e8efff;
    --cyan: #00b8f0;
    --footer-bg: #0b1220;
    --footer-ink: #c4ccda;

    --t1: #1d5bff; --t1-bg: #e8efff;
    --t2: #7c3aed; --t2-bg: #f1eafe;
    --t3: #059669; --t3-bg: #e3f6ef;
    --t4: #c2410c; --t4-bg: #fdeee4;
    --t5: #e11d48; --t5-bg: #fde8ed;
    --t6: #0891b2; --t6-bg: #e0f4f9;

    --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Space Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(11, 18, 32, .05);
    --shadow: 0 1px 2px rgba(11, 18, 32, .04), 0 8px 24px -8px rgba(11, 18, 32, .10);
    --shadow-lg: 0 2px 4px rgba(11, 18, 32, .04), 0 24px 48px -16px rgba(11, 18, 32, .22);
    --container: 1240px;
    --gutter: clamp(16px, 4vw, 32px);
    --header-h: 68px;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

[data-theme="dark"] {
    --bg: #0a0d14;
    --surface: #10151f;
    --surface-2: #161c29;
    --card: #121824;
    --ink: #edf1f8;
    --ink-2: #c9d1df;
    --muted: #8f9aae;
    --line: #1f2735;
    --line-strong: #2b3546;
    --accent: #4d84ff;
    --accent-soft: rgba(77, 132, 255, .14);
    --footer-bg: #06080d;

    --t1: #7aa5ff; --t1-bg: rgba(77, 132, 255, .15);
    --t2: #b597fb; --t2-bg: rgba(139, 92, 246, .16);
    --t3: #41d1a2; --t3-bg: rgba(16, 185, 129, .14);
    --t4: #fb9a5f; --t4-bg: rgba(249, 115, 22, .14);
    --t5: #fb7193; --t5-bg: rgba(244, 63, 94, .14);
    --t6: #45cbe6; --t6-bg: rgba(6, 182, 212, .14);

    --shadow-sm: none;
    --shadow: 0 1px 0 rgba(255, 255, 255, .02), 0 10px 30px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .8);
    color-scheme: dark;
}

/* ---------- Reset & base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 20px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}
body.is-locked { overflow: hidden; }

img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-family: var(--font-display); font-weight: 700; line-height: 1.15; letter-spacing: -.02em; color: var(--ink); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent); color: #fff; }

.sr-only {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
    position: fixed !important; top: 12px; left: 12px; z-index: 200; width: auto; height: auto; clip: auto;
    padding: 10px 16px; background: var(--ink); color: var(--bg); border-radius: 8px; margin: 0;
}

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(40px, 6vw, 72px); }

.icon { width: 20px; height: 20px; flex: none; }
.icon--sm { width: 15px; height: 15px; display: inline-block; vertical-align: -2px; }

/* ---------- Tones ---------- */

.tone-1 { --tone: var(--t1); --tone-bg: var(--t1-bg); }
.tone-2 { --tone: var(--t2); --tone-bg: var(--t2-bg); }
.tone-3 { --tone: var(--t3); --tone-bg: var(--t3-bg); }
.tone-4 { --tone: var(--t4); --tone-bg: var(--t4-bg); }
.tone-5 { --tone: var(--t5); --tone-bg: var(--t5-bg); }
.tone-6 { --tone: var(--t6); --tone-bg: var(--t6-bg); }
.tone-text-1 { color: var(--t1); } .tone-text-2 { color: var(--t2); } .tone-text-3 { color: var(--t3); }
.tone-text-4 { color: var(--t4); } .tone-text-5 { color: var(--t5); } .tone-text-6 { color: var(--t6); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--tone, var(--accent)); flex: none; }

/* ---------- Small components ---------- */

.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px;
    background: var(--tone-bg); color: var(--tone);
    font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1.4;
    transition: filter .2s;
}
a.badge:hover { filter: brightness(.95) saturate(1.2); }

.eyebrow, .kicker {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.kicker { color: var(--accent); }

.meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
    font-size: 13px; color: var(--muted); font-weight: 500;
}
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.meta__dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; padding: 0 20px; border: 0; border-radius: 999px;
    background: var(--accent); color: var(--accent-ink);
    font-size: 14.5px; font-weight: 600; white-space: nowrap;
    transition: transform .2s var(--ease), box-shadow .2s, background .2s;
    box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--accent) 60%, transparent);
}
.btn:hover { transform: translateY(-1px); }
.btn .icon { width: 18px; height: 18px; }
.btn--ghost { background: var(--surface); color: var(--ink); box-shadow: none; border: 1px solid var(--line); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--block { width: 100%; margin-top: 28px; }

.icon-btn {
    display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
    border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--ink-2);
    transition: background .2s, color .2s, border-color .2s;
}
.icon-btn:hover { background: var(--surface); color: var(--ink); border-color: var(--line); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips--center { justify-content: center; margin-top: 20px; }
.chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line);
    background: var(--card); color: var(--ink-2); font-size: 13.5px; font-weight: 500; line-height: 1.3;
    transition: border-color .2s, color .2s, background .2s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.link-arrow .icon { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.link-arrow:hover .icon { transform: translateX(3px); }

.search-field {
    display: flex; align-items: center; gap: 10px;
    height: 46px; padding: 0 6px 0 14px; border-radius: 14px;
    border: 1px solid var(--line); background: var(--surface); color: var(--muted);
    transition: border-color .2s, box-shadow .2s;
}
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search-field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 15px; }
.search-field input::placeholder { color: var(--muted); }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-field--lg { height: 58px; border-radius: 16px; background: var(--card); padding-left: 18px; }
.search-field--lg input { font-size: 17px; }
.search-field--lg .btn { height: 44px; }
.search-field kbd {
    font: 600 11px var(--font-sans); padding: 4px 8px; border-radius: 6px;
    border: 1px solid var(--line); color: var(--muted); margin-right: 8px;
}

/* ---------- Header ---------- */

.site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--line);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }

.site-header__inner { display: flex; align-items: center; gap: 28px; height: var(--header-h); }
.site-header__actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }

.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand__mark { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 6px 16px -6px rgba(29, 91, 255, .6); }
.brand__word { font-family: var(--font-display); font-weight: 700; font-size: 21px; letter-spacing: -.03em; color: var(--ink); }
.brand__word span { color: var(--accent); }
.brand__custom { max-height: 40px; width: auto; }
.brand--light .brand__word { color: #fff; }

.nav { min-width: 0; }
.nav__list, .nav .menu { display: flex; align-items: center; gap: 2px; list-style: none; }
.nav a {
    display: block; padding: 8px 12px; border-radius: 10px;
    font-size: 14.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
    transition: background .2s, color .2s;
}
.nav a:hover { background: var(--surface); color: var(--ink); }
.nav a[aria-current="page"], .nav .current-menu-item > a, .nav .current-cat > a { color: var(--accent); background: var(--accent-soft); }

.icon--sun { display: none; }
[data-theme="dark"] .icon--sun { display: block; }
[data-theme="dark"] .icon--moon { display: none; }

.menu-btn { display: none; }

@media (max-width: 1100px) {
    .nav__list li:nth-child(n+5), .nav .menu li:nth-child(n+5) { display: none; }
}
@media (max-width: 900px) {
    .nav { display: none; }
    .menu-btn { display: inline-grid; }
}

.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; pointer-events: none; }
.progress span {
    display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--p, 0));
    background: linear-gradient(90deg, var(--cyan), var(--accent));
}
body:not(.single-post) .progress { display: none; }

/* ---------- Search overlay & drawer ---------- */

.search-overlay, .drawer { position: fixed; inset: 0; z-index: 100; }
.search-overlay[hidden], .drawer[hidden] { display: none; }
.search-overlay__backdrop, .drawer__backdrop {
    position: absolute; inset: 0; background: rgba(6, 10, 18, .55);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    animation: fade .2s ease both;
}
.search-overlay__panel {
    position: relative; width: min(680px, calc(100% - 32px)); margin: 12vh auto 0;
    padding: 18px; border-radius: 22px; background: var(--bg); box-shadow: var(--shadow-lg);
    border: 1px solid var(--line);
    animation: pop .25s var(--ease) both;
}
.search-overlay__label { margin: 20px 4px 10px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.drawer__panel {
    position: absolute; top: 0; right: 0; bottom: 0; width: min(380px, 88vw);
    display: flex; flex-direction: column; gap: 18px; padding: 18px 20px 28px; overflow-y: auto;
    background: var(--bg); box-shadow: var(--shadow-lg);
    animation: slide .3s var(--ease) both;
}
.drawer__head { display: flex; align-items: center; justify-content: space-between; }
.drawer__nav, .drawer .nav__list { list-style: none; display: grid; gap: 2px; }
.drawer__nav a, .drawer .nav__list a { display: block; padding: 11px 12px; border-radius: 10px; font-weight: 600; font-size: 16px; }
.drawer__nav a:hover, .drawer .nav__list a:hover { background: var(--surface); }
.drawer__label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 12px 0; border-top: 1px solid var(--line); padding-top: 18px; }
.drawer__topics { list-style: none; display: grid; gap: 2px; }
.drawer__topics a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; font-size: 14.5px; color: var(--ink-2); }
.drawer__topics a:hover { background: var(--surface); }
.drawer__topics .count { margin-left: auto; font-size: 12px; color: var(--muted); }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
@keyframes slide { from { transform: translateX(100%); } }

/* ---------- Media ---------- */

.media {
    position: relative; display: block; overflow: hidden;
    aspect-ratio: 16 / 9; border-radius: var(--radius-sm); background: var(--surface-2);
    isolation: isolate;
}
.media__img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.media__placeholder {
    width: 100%; height: 100%; display: grid; place-items: center; color: var(--tone);
    background:
        radial-gradient(120% 120% at 0% 0%, var(--tone-bg), transparent 60%),
        linear-gradient(135deg, var(--surface), var(--surface-2));
}
.media__placeholder .icon { width: 36px; height: 36px; opacity: .7; }

/* ---------- Cards ---------- */

.card { position: relative; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card__body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card__title { font-size: 18px; line-height: 1.3; letter-spacing: -.015em; }
.card__title a { transition: color .2s; }
@media (hover: hover) {
    .card:hover .card__title a { color: var(--accent); }
    .card:hover .media__img { transform: scale(1.045); }
}
.card__excerpt {
    color: var(--muted); font-size: 14.5px; line-height: 1.55;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* grid card */
.card--grid .media { border-radius: 14px; }
.card--grid .card__excerpt { -webkit-line-clamp: 2; }

/* lead (hero) */
.card--lead { gap: 22px; }
.card--lead .media { aspect-ratio: 16 / 9; border-radius: 20px; box-shadow: var(--shadow); }
.card--lead .card__title { font-size: clamp(28px, 3.6vw, 44px); line-height: 1.08; letter-spacing: -.03em; }
.card--lead .card__excerpt { font-size: 17px; -webkit-line-clamp: 3; max-width: 62ch; }
.card--lead .card__body { gap: 14px; }
.pill-live {
    display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    color: var(--muted); border: 1px solid var(--line);
}
.pill-live .icon { width: 13px; height: 13px; color: #f97316; }

/* mini */
.card--mini { flex-direction: row; align-items: flex-start; gap: 14px; }
.card--mini .media { width: 124px; aspect-ratio: 4 / 3; flex: none; border-radius: 10px; }
.card--mini .card__body { gap: 6px; }
.card--mini .card__title { font-size: 15.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card--mini .meta { font-size: 12.5px; }

/* row */
.card--row { flex-direction: row; gap: 22px; align-items: center; padding-block: 22px; border-top: 1px solid var(--line); }
.stack > .card--row:first-child { border-top: 0; padding-top: 0; }
.card--row .media { width: min(300px, 38%); flex: none; border-radius: 14px; }
.card--row .card__title { font-size: 21px; }

/* rank */
.rank-list { display: grid; }
.rank-item { display: flex; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.rank-item:first-child { border-top: 0; padding-top: 4px; }
.rank-item__num {
    font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1; letter-spacing: -.04em;
    background: linear-gradient(135deg, var(--cyan), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent;
    min-width: 36px;
}
.rank-item .eyebrow { font-size: 10.5px; margin-bottom: 4px; }
.rank-item__title { font-size: 15.5px; line-height: 1.35; letter-spacing: -.01em; }
.rank-item__title a:hover { color: var(--accent); }

/* ---------- Layout ---------- */

.grid { display: grid; gap: clamp(24px, 3vw, 36px) clamp(18px, 2.4vw, 28px); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.layout-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(32px, 5vw, 64px); align-items: start; }
@media (max-width: 1024px) { .layout-sidebar { grid-template-columns: 1fr; } }

.sidebar { display: grid; gap: 24px; position: sticky; top: calc(var(--header-h) + 24px); }
@media (max-width: 1024px) { .sidebar { position: static; } }

.widget { padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); }
.widget__title {
    display: flex; align-items: center; gap: 8px; margin-bottom: 16px;
    font-size: 15px; letter-spacing: -.01em;
}
.widget__title .icon { width: 18px; height: 18px; color: var(--accent); }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.section-head__title { display: flex; align-items: center; gap: 10px; font-size: clamp(22px, 2.4vw, 28px); letter-spacing: -.025em; }
.section-head__title .dot { width: 10px; height: 10px; }

.section-label {
    display: flex; align-items: center; gap: 12px; margin-bottom: 4px;
    font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Home ---------- */

.hero {
    display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    gap: clamp(28px, 4vw, 56px); padding-block: clamp(28px, 4vw, 48px) clamp(24px, 3vw, 36px);
}
.hero__side { display: flex; flex-direction: column; gap: 20px; }
.hero__side .card--mini + .card--mini { padding-top: 20px; border-top: 1px solid var(--line); }
@media (max-width: 1024px) {
    .hero { grid-template-columns: 1fr; }
    .hero__side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; }
    .hero__side .section-label { grid-column: 1 / -1; }
    .hero__side .card--mini + .card--mini { padding-top: 0; border-top: 0; }
}
@media (max-width: 640px) {
    .hero__side { grid-template-columns: 1fr; }
    .hero__side .card--mini + .card--mini { padding-top: 18px; border-top: 1px solid var(--line); }
}

.topics { padding-block: 8px 0; }
.topics__track {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 1fr); gap: 12px;
    overflow-x: auto; scrollbar-width: none; padding: 4px 2px 8px; scroll-snap-type: x mandatory;
}
.topics__track::-webkit-scrollbar { display: none; }
.topic {
    position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; overflow: hidden;
    border-radius: 14px; border: 1px solid var(--line); background: var(--card); scroll-snap-align: start;
    transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
}
.topic::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tone); }
.topic:hover { transform: translateY(-2px); border-color: var(--tone); box-shadow: var(--shadow); }
.topic__name { font-family: var(--font-display); font-weight: 600; font-size: 15.5px; line-height: 1.25; color: var(--ink); }
.topic__count { font-size: 12.5px; color: var(--muted); }

.rail { padding-top: 0; }
.rail + .rail { padding-top: 0; }

@media (max-width: 640px) {
    .card--row { flex-direction: column; align-items: stretch; gap: 14px; }
    .card--row .media { width: 100%; }
    .card--row .card__title { font-size: 19px; }
    .card--mini .media { width: 108px; }
}

/* ---------- Page heads / archive ---------- */

.page-head { margin-bottom: 36px; }
.page-head--center { text-align: center; max-width: 760px; margin-inline: auto; }
.page-head__title { margin-top: 10px; font-size: clamp(32px, 5vw, 52px); letter-spacing: -.035em; line-height: 1.05; }
.page-head__desc { margin-top: 12px; color: var(--muted); font-size: 17px; max-width: 62ch; }
.page-head__desc p + p { margin-top: 8px; }

.archive-hero {
    position: relative; padding-block: clamp(36px, 6vw, 72px) clamp(28px, 4vw, 44px);
    border-bottom: 1px solid var(--line); overflow: hidden;
    background:
        radial-gradient(60% 120% at 100% 0%, var(--tone-bg), transparent 70%),
        linear-gradient(180deg, var(--surface), var(--bg));
}
.archive-hero .page-head__title { color: var(--ink); }
.archive-hero .search-field { margin-top: 24px; max-width: 640px; }
.archive-hero__count { margin-top: 16px; font-size: 13.5px; font-weight: 600; color: var(--tone, var(--muted)); }

.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); margin-bottom: 12px; }
.breadcrumbs a:hover { color: var(--accent); }

/* ---------- Pagination ---------- */

.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: clamp(40px, 6vw, 64px); }
.pagination .page-numbers {
    display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px;
    border-radius: 12px; border: 1px solid var(--line); background: var(--card);
    font-size: 14.5px; font-weight: 600; color: var(--ink-2);
    transition: border-color .2s, color .2s;
}
.pagination a.page-numbers:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.pagination .dots { border-color: transparent; background: transparent; }
.pagination .icon { width: 18px; height: 18px; }

/* ---------- Empty states ---------- */

.empty { max-width: 620px; margin: 0 auto 56px; text-align: center; padding: clamp(32px, 6vw, 64px) 24px; border-radius: 24px; border: 1px dashed var(--line-strong); background: var(--surface); }
.empty h1, .empty h2 { font-size: clamp(26px, 4vw, 36px); }
.empty p { margin-top: 10px; color: var(--muted); }
.empty .btn, .empty .search-field { margin-top: 24px; }
.empty__code {
    display: block; font-family: var(--font-display); font-weight: 700; font-size: clamp(72px, 14vw, 128px); line-height: 1; letter-spacing: -.06em;
    background: linear-gradient(135deg, var(--cyan), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent;
    margin-bottom: 12px;
}

/* ---------- Article ---------- */

.article__header { max-width: 880px; padding-top: clamp(28px, 5vw, 56px); text-align: left; }
.article__title { margin-top: 16px; font-size: clamp(32px, 5vw, 54px); line-height: 1.06; letter-spacing: -.035em; }
.article__dek { margin-top: 18px; font-size: clamp(17px, 2vw, 20px); line-height: 1.55; color: var(--muted); }

.byline { display: flex; align-items: center; gap: 14px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.byline__avatar { width: 44px; height: 44px; border-radius: 50%; }
.byline__name { font-weight: 600; font-size: 15px; }
.byline__name:hover { color: var(--accent); }
.byline .meta { margin-top: 2px; }

.article__hero { max-width: 1120px; margin: clamp(24px, 4vw, 40px) auto 0; }
.article__hero-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 22px; box-shadow: var(--shadow); background: var(--surface-2); }
.article__hero figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); text-align: center; }

.article__layout {
    display: grid; grid-template-columns: 52px minmax(0, 720px) 300px; justify-content: center;
    gap: clamp(28px, 4vw, 56px); padding-top: clamp(32px, 5vw, 56px); padding-bottom: clamp(40px, 6vw, 80px);
}
.article__share { position: sticky; top: calc(var(--header-h) + 32px); align-self: start; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.article__share .icon-btn { border-color: var(--line); border-radius: 50%; width: 42px; height: 42px; }
.article__share .icon-btn .icon { width: 18px; height: 18px; }
.article__share .icon-btn.is-copied { color: var(--t3); border-color: var(--t3); }
.article__share-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.article__aside { position: sticky; top: calc(var(--header-h) + 32px); align-self: start; display: grid; gap: 22px; max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; scrollbar-width: thin; }

.toc { padding: 20px 20px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.toc__title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.toc__list { list-style: none; display: grid; gap: 2px; counter-reset: toc; }
.toc__list a {
    display: block; padding: 7px 10px 7px 12px; border-left: 2px solid var(--line);
    font-size: 14px; line-height: 1.4; color: var(--muted); transition: color .2s, border-color .2s;
}
.toc__list a:hover { color: var(--ink); }
.toc__list a.is-active { color: var(--accent); border-color: var(--accent); font-weight: 600; }

@media (max-width: 1180px) {
    .article__layout { grid-template-columns: minmax(0, 720px); }
    .article__aside { display: none; }
    .article__share { position: static; flex-direction: row; order: 2; justify-content: flex-start; padding-top: 8px; }
    .article__share-label { margin: 0 6px 0 0; }
    .article__main { order: 1; }
}
@media (min-width: 1181px) {
    .entry-content .toc-container { display: none; }
}

.article__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 40px; }

.author-box { display: flex; gap: 18px; align-items: flex-start; margin-top: 40px; padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.author-box__avatar { width: 64px; height: 64px; border-radius: 50%; flex: none; }
.author-box__name { display: block; margin: 4px 0 6px; font-family: var(--font-display); font-weight: 700; font-size: 19px; }
.author-box p { color: var(--muted); font-size: 14.5px; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 28px; }
.post-nav__item { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line); transition: border-color .2s, transform .2s var(--ease); }
.post-nav__item:hover { border-color: var(--accent); transform: translateY(-2px); }
.post-nav__item--next { text-align: right; align-items: flex-end; grid-column: 2; }
.post-nav__title { font-family: var(--font-display); font-weight: 600; font-size: 16px; line-height: 1.3; }
@media (max-width: 600px) { .post-nav { grid-template-columns: 1fr; } .post-nav__item--next { grid-column: auto; } }

.related { padding-block: clamp(40px, 6vw, 72px); background: var(--surface); border-top: 1px solid var(--line); }

/* ---------- Entry content (article typography) ---------- */

.entry-content { font-size: 18px; line-height: 1.75; color: var(--ink-2); overflow-wrap: break-word; }
.entry-content > * + * { margin-top: 1.25em; }
.entry-content h2, .entry-content h3, .entry-content h4 { color: var(--ink); scroll-margin-top: calc(var(--header-h) + 24px); }
.entry-content h2 { font-size: clamp(25px, 3vw, 31px); margin-top: 2em; letter-spacing: -.025em; }
.entry-content h3 { font-size: clamp(20px, 2.4vw, 23px); margin-top: 1.7em; }
.entry-content h4 { font-size: 19px; margin-top: 1.5em; }
.entry-content h2 + *, .entry-content h3 + *, .entry-content h4 + * { margin-top: .7em; }
.entry-content a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); transition: text-decoration-color .2s; }
.entry-content a:hover { text-decoration-color: var(--accent); }
.entry-content strong { color: var(--ink); font-weight: 650; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li + li { margin-top: .45em; }
.entry-content li::marker { color: var(--accent); }
.entry-content img { border-radius: 14px; }
.entry-content img.emoji { display: inline !important; width: 1em !important; height: 1em !important; margin: 0 .1em !important; vertical-align: -.1em; border-radius: 0; box-shadow: none !important; }
.entry-content figure { margin-inline: 0; }
.entry-content figcaption, .entry-content .wp-element-caption { margin-top: 10px !important; font-size: 14px !important; color: var(--muted) !important; text-align: center; }
.entry-content blockquote {
    margin-inline: 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--accent);
    font-family: var(--font-display); font-size: 1.15em; line-height: 1.5; color: var(--ink);
}
.entry-content hr { border: 0; height: 1px; background: var(--line); margin-block: 2.5em; }
.entry-content code { font-size: .88em; padding: .15em .4em; border-radius: 6px; background: var(--surface-2); }
.entry-content pre { padding: 18px; border-radius: 14px; background: var(--surface-2); overflow-x: auto; font-size: 14.5px; }
.entry-content pre code { padding: 0; background: none; }
.entry-content iframe, .entry-content video { max-width: 100%; border-radius: 14px; }
.entry-content .alignwide { max-width: none; }
.entry-content .aligncenter { margin-inline: auto; }

/* Tables (also neutralises inline styles from generated content) */
.entry-content table {
    display: block; width: 100% !important; overflow-x: auto; margin-block: 1.6em !important;
    border-collapse: separate !important; border-spacing: 0; border: 1px solid var(--line); border-radius: 14px;
    font-size: 15px; line-height: 1.5;
}
.entry-content thead, .entry-content tbody { width: 100%; }
.entry-content th, .entry-content td {
    padding: 12px 16px !important; border: 0 !important; border-bottom: 1px solid var(--line) !important;
    text-align: left; vertical-align: top; min-width: 140px; color: var(--ink-2);
}
.entry-content th { background: var(--surface) !important; color: var(--ink) !important; font-weight: 700; font-size: 13px; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.entry-content tr:last-child td { border-bottom: 0 !important; }
.entry-content tbody tr:hover td { background: var(--surface); }
.entry-content td:first-child { font-weight: 600; color: var(--ink); }

/* In-content table of contents (generated by the publisher) */
.entry-content .toc-container {
    padding: 22px 24px !important; margin: 2em 0 !important;
    background: var(--surface) !important; border: 1px solid var(--line) !important; border-radius: 16px !important;
}
.entry-content .toc-container h3 { font-size: 13px !important; letter-spacing: .08em; text-transform: uppercase; color: var(--muted) !important; margin: 0 0 10px !important; }
.entry-content .toc-container ul { padding-left: 1.2em !important; line-height: 1.6 !important; }
.entry-content .toc-container a { color: var(--ink-2) !important; text-decoration: none; font-size: 16px; }
.entry-content .toc-container a:hover { color: var(--accent) !important; }

/* Product references box */
.entry-content .product-references {
    position: relative; padding: 24px !important; margin: 2em 0 !important;
    background: var(--card) !important; border: 1px solid var(--line) !important; border-radius: 18px !important;
    box-shadow: var(--shadow);
}
.entry-content .product-references h2 { margin: 0 0 6px !important; font-size: 20px !important; }
.entry-content .product-references ul { list-style: none; padding: 0 !important; display: grid; gap: 10px; margin-top: 14px !important; }
.entry-content .product-references li {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
    margin: 0 !important; padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
    font-size: 15.5px; line-height: 1.4;
}
.entry-content .product-references li br { display: none; }
.entry-content .product-references li strong { flex: 1 1 260px; }
.entry-content .product-references li a {
    flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
    background: var(--accent); color: #fff; text-decoration: none; font-size: 13.5px; font-weight: 600;
}
.entry-content .product-references li a::after { content: "↗"; font-size: 13px; }
.entry-content .product-references li a:hover { filter: brightness(1.08); }

/* Product images inside articles */
.entry-content .article-product-image { margin: 2em auto !important; padding: 20px; border-radius: 18px; background: #fff; border: 1px solid var(--line); }
.entry-content .article-product-image img { box-shadow: none !important; border-radius: 10px !important; max-height: 440px !important; }
[data-theme="dark"] .entry-content .article-product-image figcaption { color: #5d6779 !important; }

.page { padding-block: clamp(40px, 6vw, 72px); max-width: 820px; }
.page .article__hero { margin-bottom: 40px; }
.page__content { margin-top: 8px; }

.page-links { margin-top: 32px; display: flex; gap: 8px; font-weight: 600; }

/* ---------- Comments ---------- */

.comments-wrap { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }
.comments-wrap h2, .comments-wrap h3 { font-size: 22px; margin-bottom: 16px; }
.comment-list { list-style: none; display: grid; gap: 18px; }
.comment-list .children { list-style: none; margin-top: 18px; padding-left: 24px; border-left: 2px solid var(--line); }
.comment-body { padding: 18px; border-radius: 14px; background: var(--surface); }
.comment-author { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.comment-author img { border-radius: 50%; }
.comment-metadata { font-size: 13px; color: var(--muted); margin: 4px 0 10px; }
.comment-form { display: grid; gap: 14px; }
.comment-form label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
    width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font: inherit;
}
.comment-form .submit { height: 44px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; }

/* ---------- Footer ---------- */

.site-footer { margin-top: 0; background: var(--footer-bg); color: var(--footer-ink); padding-top: clamp(48px, 7vw, 80px); }
.site-footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 48px; }
.site-footer__brand p { margin-top: 16px; max-width: 40ch; font-size: 15px; line-height: 1.65; color: #9aa4b6; }
.site-footer__brand .search-field { margin-top: 22px; max-width: 360px; }
.search-field--dark { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .1); color: #9aa4b6; }
.search-field--dark input { color: #fff; }
.search-field--dark input::placeholder { color: #7d879a; }
.site-footer__col h2 { font-family: var(--font-sans); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #fff; margin-bottom: 16px; }
.site-footer__col ul { list-style: none; display: grid; gap: 10px; }
.site-footer__col a { font-size: 14.5px; color: #9aa4b6; transition: color .2s; }
.site-footer__col a:hover { color: #fff; }
.site-footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 24px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 13px; color: #7d879a; }
@media (max-width: 900px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } .site-footer__brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { .site-footer__grid { grid-template-columns: 1fr; } }

.related + .site-footer, main > .section:last-child { margin-bottom: 0; }
.site-content > main { min-height: 50vh; }
.site-content { padding-bottom: clamp(24px, 4vw, 48px); }
.single-post .site-content { padding-bottom: 0; }

/* ---------- Back to top ---------- */

.to-top {
    position: fixed; right: 20px; bottom: 20px; z-index: 40;
    width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%;
    border: 1px solid var(--line); background: var(--bg); color: var(--ink); box-shadow: var(--shadow);
    opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .25s, transform .25s var(--ease);
}
.to-top .icon { transform: rotate(-90deg); width: 18px; height: 18px; }
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { color: var(--accent); border-color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
