/* Каркас. Цвета, шрифты и радиусы — в theme.css (у каждой дочерней темы свой). */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font: var(--text-size)/1.65 var(--font-body);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; padding-block: clamp(2rem, 5vw, 4rem); }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--accent-strong); }

h1, h2, h3 {
    font-family: var(--font-head);
    font-weight: var(--head-weight);
    letter-spacing: var(--head-tracking);
    line-height: 1.15;
    color: var(--fg-strong);
    margin: 0 0 .5em;
    text-wrap: balance;
}

.container { width: min(100% - 2.5rem, var(--max-width)); margin-inline: auto; }
.muted, .meta { color: var(--muted); }
.meta { font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; }

/* ---------- header / footer ---------- */

.site-header {
    position: sticky; top: 0; z-index: 10;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; min-height: 4rem; }

.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--fg-strong); }
.brand__mark {
    width: 1.6rem; height: 1.6rem; border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.brand__name { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 1.2rem; letter-spacing: var(--head-tracking); }

.lang-switch { display: flex; gap: .25rem; padding: .25rem; border: 1px solid var(--line); border-radius: 999px; }
.lang-switch a {
    padding: .2rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
    text-transform: uppercase; text-decoration: none; color: var(--muted);
}
.lang-switch a.is-active { background: var(--fg-strong); color: var(--bg); }

.site-footer { border-top: 1px solid var(--line); padding-block: 2rem; font-size: .9rem; }
.site-footer .container { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- home ---------- */

.hero { margin-bottom: clamp(1.5rem, 4vw, 3rem); }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
.hero--center { text-align: center; padding-block: 4rem; }

.grid { display: grid; gap: clamp(1.25rem, 3vw, 2rem); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }

.card {
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card__media img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.card__body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.card__title { font-size: 1.35rem; margin: 0; }
.card__title a { color: inherit; text-decoration: none; }
.card__title a:hover { color: var(--accent); }
.card__excerpt { color: var(--muted); margin: 0; flex: 1; }
.card__excerpt p { margin: 0; }

.card--featured { grid-column: 1 / -1; }
@media (min-width: 860px) {
    .card--featured { flex-direction: row; }
    .card--featured .card__media { flex: 1.3; }
    .card--featured .card__media img { height: 100%; aspect-ratio: auto; }
    .card--featured .card__body { flex: 1; padding: 2.5rem; justify-content: center; }
    .card--featured .card__title { font-size: clamp(1.8rem, 3vw, 2.4rem); }
}

.link-arrow { font-weight: 600; text-decoration: none; }

.pager { display: flex; justify-content: center; align-items: center; gap: 1.5rem; margin-top: 3rem; }
.empty { color: var(--muted); font-size: 1.1rem; }

.button {
    display: inline-block; padding: .8rem 1.4rem; border-radius: var(--radius-sm);
    background: var(--accent); color: var(--on-accent); text-decoration: none; font-weight: 600;
}
.button:hover { background: var(--accent-strong); color: var(--on-accent); }

/* ---------- article ---------- */

.post { max-width: var(--prose-width); margin-inline: auto; }
.link-back { display: inline-block; margin-bottom: 2rem; text-decoration: none; font-weight: 600; font-size: .95rem; }
.post__header h1 { font-size: clamp(2.2rem, 5.5vw, 3.4rem); margin-top: .4rem; }
.lead { font-size: 1.25rem; color: var(--muted); margin: 0; }
.post__cover { margin: 2.5rem calc(50% - min(50vw - 1.25rem, 40rem)); }
.post__cover img { width: 100%; border-radius: var(--radius); }

.prose { margin-top: 2.5rem; font-size: 1.12rem; }
.prose > * + * { margin-top: 1.25em; }
.prose h2 { font-size: 1.8rem; margin-top: 2em; }
.prose h3 { font-size: 1.35rem; margin-top: 1.6em; }
.prose p, .prose ul, .prose ol { margin-bottom: 0; }
.prose li + li { margin-top: .35em; }
.prose blockquote {
    margin-inline: 0; padding: .4rem 0 .4rem 1.4rem;
    border-left: 3px solid var(--accent); color: var(--fg-strong);
    font-family: var(--font-head); font-size: 1.3rem;
}
.prose img { border-radius: var(--radius-sm); }
.prose code { background: var(--surface-2); padding: .1em .35em; border-radius: 4px; font-size: .9em; }
.prose pre { background: var(--surface-2); padding: 1.2rem; border-radius: var(--radius-sm); overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.5rem; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: .6rem .4rem; text-align: left; }
