/* ==========================================================================
   DisQuS — публичная часть
   «Литературный» стиль: тёплая бумага, серифная типографика, спокойный акцент.
   ========================================================================== */

:root {
    color-scheme: light;

    --font-serif: "PT Serif", "Lora", Georgia, "Times New Roman", serif;
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --bg: #f7f4ee;
    --bg-soft: #efe9df;
    --surface: #fffdf8;
    --surface-2: #f3eee5;
    --ink: #211d19;
    --ink-soft: #4a433b;
    --muted: #7b7167;
    --line: #e3dacb;
    --line-strong: #d2c5b2;
    --accent: #8b3f33;
    --accent-hover: #a24f41;
    --accent-soft: #f0e0d9;
    --accent-contrast: #fffaf6;
    --shadow-sm: 0 1px 2px rgba(46, 34, 22, .06);
    --shadow-md: 0 2px 4px rgba(46, 34, 22, .05), 0 14px 30px -18px rgba(46, 34, 22, .35);
    --radius: 14px;
    --radius-sm: 10px;
    --maxw: 1180px;
}

html[data-theme="dark"] {
    color-scheme: dark;

    --bg: #14120f;
    --bg-soft: #100e0c;
    --surface: #1b1815;
    --surface-2: #211d19;
    --ink: #ece5d8;
    --ink-soft: #d3cabc;
    --muted: #9c9386;
    --line: #2c2723;
    --line-strong: #3d362e;
    --accent: #d98d78;
    --accent-hover: #e6a695;
    --accent-soft: #2a1f1a;
    --accent-contrast: #1a1512;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, .35), 0 16px 34px -20px rgba(0, 0, 0, .9);
}

/* ------------------------------- База ---------------------------------- */

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

[hidden] { display: none !important; }

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

body {
    margin: 0;
    background: var(--bg);
    background-image: radial-gradient(1200px 500px at 50% -10%, rgba(139, 63, 51, .045), transparent 70%);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color .25s ease, color .25s ease;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.2; margin: 0; }

p { margin: 0; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    z-index: 100;
    padding: 10px 16px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
}
.skip-link:focus { left: 8px; }

.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 24px;
}

.icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ------------------------------ Шапка ---------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(247, 244, 238, .86);
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--line);
}

html[data-theme="dark"] .site-header { background: rgba(20, 18, 15, .86); }

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 72px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    flex: 0 0 auto;
}
.brand:hover { color: var(--ink); }

.brand-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-contrast);
    font-family: var(--font-serif);
    font-size: 22px;
    line-height: 1;
    padding-bottom: 2px;
    box-shadow: var(--shadow-sm);
}

.brand-text { display: flex; flex-direction: column; }

.brand-name {
    font-family: var(--font-serif);
    font-size: 1.32rem;
    letter-spacing: .04em;
    line-height: 1.1;
}

.brand-tagline {
    font-size: .72rem;
    letter-spacing: .07em;
    color: var(--muted);
    margin-top: 3px;
}

.header-nav {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.header-nav a {
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--ink-soft);
    font-size: .92rem;
    transition: background-color .15s ease, color .15s ease;
}
.header-nav a:hover { background: var(--surface-2); color: var(--ink); }
.header-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

.theme-toggle {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink-soft);
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

.icon-moon { display: none; }
html[data-theme="dark"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: block; }

/* ------------------------------- Герой --------------------------------- */

.hero { padding: 64px 0 36px; }

.hero-inner { max-width: 760px; }

.hero-kicker {
    font-size: .78rem;
    letter-spacing: .1em;
    color: var(--accent);
    font-weight: 600;
}

.hero-title {
    margin: 14px 0 18px;
    font-size: clamp(2.1rem, 4.6vw, 3.4rem);
    letter-spacing: -.015em;
}

.hero-text {
    max-width: 62ch;
    color: var(--muted);
    font-size: 1.02rem;
}

/* ------------------------------ Раскладка ------------------------------ */

.layout {
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr);
    gap: 36px;
    padding-bottom: 72px;
    align-items: start;
}

/* ------------------------------ Фильтры -------------------------------- */

.sidebar {
    position: sticky;
    top: 92px;
    min-width: 0;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.content { min-width: 0; }

.sidebar-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.sidebar-title {
    font-family: var(--font-sans);
    font-size: .72rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

.sidebar-reset {
    font-size: .8rem;
    color: var(--accent);
    border-bottom: 1px dashed currentColor;
}
.sidebar-reset.is-dimmed { color: var(--muted); border-bottom-color: transparent; pointer-events: none; opacity: .55; }

.filter-block + .filter-block { margin-top: 22px; }

.filter-group {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    margin: 0 -10px 6px;
    border-radius: 8px;
    font-family: var(--font-serif);
    font-size: 1.06rem;
    color: var(--ink);
}
.filter-group:hover { background: var(--surface-2); color: var(--ink); }
.filter-group.is-active {
    background: var(--accent-soft);
    color: var(--accent);
    box-shadow: inset 2px 0 0 var(--accent);
}

.filter-count {
    font-family: var(--font-sans);
    font-size: .74rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.filter-group.is-active .filter-count { color: var(--accent); }

.filter-topics { list-style: none; margin: 0; padding: 0 0 0 4px; }

.filter-topic {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 7px;
    font-size: .9rem;
    color: var(--ink-soft);
    border-left: 2px solid transparent;
}
.filter-topic:hover { background: var(--surface-2); color: var(--ink); }
.filter-topic.is-active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: var(--accent-soft);
    font-weight: 600;
}
.filter-topic.is-active .filter-count { color: var(--accent); }

/* ------------------------------- Тулбар -------------------------------- */

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.search-field {
    position: relative;
    flex: 1 1 320px;
    min-width: 220px;
}

.search-field .icon-search {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--muted);
    pointer-events: none;
}

.search-field input {
    width: 100%;
    height: 46px;
    padding: 0 40px 0 40px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: .95rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.search-field input::placeholder { color: var(--muted); }
.search-field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

.search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}
.search-clear:hover { color: var(--accent); }

.sort-field {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.sort-field label {
    font-size: .72rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

.sort-field select {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: .9rem;
    padding-right: 20px;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%237b7167' stroke-width='1.6' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
}
.sort-field select:focus { outline: none; }

/* ------------------------------- Кнопки -------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 0 20px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: .92rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-contrast);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-contrast); }

.js-only { display: none; }
.js .js-only { display: inline-flex; }

/* -------------------------------- Список ------------------------------- */

.list-region { transition: opacity .18s ease; }
.list-region.is-loading { opacity: .45; }

.list-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 14px;
    padding-bottom: 14px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--line);
    font-size: .86rem;
    color: var(--muted);
}

.list-head .found strong { color: var(--ink); font-size: 1rem; font-variant-numeric: tabular-nums; }
.list-query { color: var(--accent); }
.list-page { margin-left: auto; font-variant-numeric: tabular-nums; }

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
    gap: 26px;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
}

.card-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    background: var(--surface-2);
    overflow: hidden;
}

/* Фото не обрезается: вписывается в кадр целиком и лежит на «паспарту». */
.card-media--photo {
    display: grid;
    place-items: center;
    padding: 0;
    background:
        radial-gradient(120% 120% at 30% 0%, #f7f3ec, transparent 72%),
        #e8e3da;
}

.card-media--photo img {
    position: absolute;
    inset: 0;
    margin: auto;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

html[data-theme="dark"] .card-media--photo {
    background:
        radial-gradient(120% 120% at 30% 0%, #332e28, transparent 72%),
        #211d19;
}

.card-media--placeholder {
    display: grid;
    place-items: center;
    background:
        radial-gradient(120% 120% at 20% 0%, var(--accent-soft), transparent 60%),
        linear-gradient(140deg, var(--surface-2), var(--bg-soft));
}

.card-media-mark {
    font-family: var(--font-serif);
    font-size: 3.4rem;
    color: var(--accent);
    opacity: .28;
    line-height: 1;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 20px 20px;
    flex: 1;
}

.badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-family: var(--font-sans);
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: var(--accent-soft);
    color: var(--accent);
}
.badge--poetry { background: var(--accent-soft); color: var(--accent); }
.badge--prose { background: rgba(70, 96, 80, .12); color: #46604f; }
html[data-theme="dark"] .badge--prose { background: rgba(140, 180, 155, .16); color: #a8c9b3; }

.chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-size: .74rem;
    color: var(--ink-soft);
    background: transparent;
}
a.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip--sm { padding: 2px 7px; font-size: .7rem; }

.card-title {
    font-size: 1.14rem;
    line-height: 1.32;
    letter-spacing: -.005em;
}
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent); }

.card-desc {
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: auto 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.card-meta div { min-width: 0; }

.card-meta dt {
    font-size: .64rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 2px;
}

.card-meta dd {
    margin: 0;
    font-size: .82rem;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}

/* ----------------------------- Пустое состояние ------------------------- */

.empty {
    padding: 56px 24px;
    text-align: center;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
}

.empty-title { font-family: var(--font-serif); font-size: 1.4rem; margin-bottom: 8px; }
.empty-text { color: var(--muted); font-size: .92rem; margin-bottom: 20px; }

/* ------------------------------ Пагинация ------------------------------- */

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 36px;
}

.page-btn {
    display: grid;
    place-items: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink-soft);
    font-size: .88rem;
    font-variant-numeric: tabular-nums;
    transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
a.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.is-current {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-contrast);
    font-weight: 600;
}
.page-btn.is-disabled { opacity: .4; pointer-events: none; }
.page-dots { color: var(--muted); padding: 0 4px; user-select: none; }

/* --------------------------- Страница произведения ---------------------- */

.work-container { max-width: 820px; padding-bottom: 72px; }

.breadcrumbs { padding: 28px 0 8px; font-size: .82rem; }

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
}

.breadcrumbs li { display: flex; align-items: center; gap: 8px; }
.breadcrumbs li + li::before { content: "/"; color: var(--line-strong); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs [aria-current="page"] { color: var(--ink-soft); }

.work { padding-top: 10px; }

.work-head { margin-bottom: 34px; }

.work-title {
    margin: 16px 0 20px;
    font-size: clamp(1.9rem, 4vw, 2.9rem);
    letter-spacing: -.02em;
    line-height: 1.14;
}

.work-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 32px;
    margin: 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.work-meta dt {
    font-size: .66rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 3px;
}

.work-meta dd { margin: 0; font-size: .92rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.work-figure { margin: 0 0 36px; }

.work-figure img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--line);
}

.work-text {
    font-family: var(--font-serif);
    font-size: 1.09rem;
    line-height: 1.85;
    color: var(--ink);
    overflow-wrap: break-word;
}

.work-text p { margin: 0 0 1.15em; }
.work-text p:last-child { margin-bottom: 0; }

.work-text h2 { font-size: 1.5rem; margin: 2em 0 .7em; }
.work-text h3 { font-size: 1.25rem; margin: 1.8em 0 .6em; }
.work-text h4 { font-size: 1.1rem; margin: 1.6em 0 .5em; }

.work-text blockquote {
    margin: 1.6em 0;
    padding: 4px 0 4px 22px;
    border-left: 3px solid var(--accent);
    color: var(--ink-soft);
    font-style: italic;
}

.work-text ul, .work-text ol { margin: 0 0 1.2em; padding-left: 1.5em; }
.work-text li { margin-bottom: .4em; }

.work-text a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.work-text img {
    max-width: 100%;
    height: auto;
    margin: 1.4em 0;
    border-radius: var(--radius-sm);
}

.work-text hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.work-text strong { font-weight: 700; }
.work-text em { font-style: italic; }

.work-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 56px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.work-nav-link {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.work-nav-link:hover {
    border-color: var(--accent);
    color: var(--ink);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.work-nav-direction {
    font-size: .68rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
}

.work-nav-title { font-family: var(--font-serif); font-size: 1rem; line-height: 1.3; }

.work-nav-next { text-align: right; align-items: flex-end; }
.work-nav-empty { display: block; }

.work-back { margin-top: 34px; font-size: .88rem; }
.work-back a { color: var(--muted); }
.work-back a:hover { color: var(--accent); }

/* ------------------------------- Ошибки -------------------------------- */

.error-page {
    padding: 96px 24px 120px;
    max-width: 620px;
    text-align: center;
}

.error-code {
    font-family: var(--font-serif);
    font-size: clamp(3.4rem, 9vw, 6rem);
    line-height: 1;
    color: var(--accent);
    opacity: .35;
    margin-bottom: 12px;
    font-variant-numeric: tabular-nums;
}

.error-title { font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 12px; }
.error-text { color: var(--muted); margin-bottom: 26px; }
.error-actions { display: flex; justify-content: center; gap: 12px; }

/* -------------------------------- Подвал ------------------------------- */

.site-footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
    padding: 30px 0;
    margin-top: auto;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: var(--muted);
    font-size: .84rem;
}

.footer-brand { font-family: var(--font-serif); color: var(--ink-soft); }
.footer-brand span { color: var(--line-strong); margin: 0 4px; }

.footer-nav { display: flex; gap: 18px; }
.footer-nav a { color: var(--muted); }
.footer-nav a:hover { color: var(--accent); }

.footer-copy { font-variant-numeric: tabular-nums; }

/* ----------------------------- Адаптивность ---------------------------- */

@media (max-width: 980px) {
    .layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }

    .sidebar {
        position: static;
        padding: 16px 18px;
    }

    .filter-block { margin-top: 18px; }
    .filter-topics {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        padding-left: 0;
        min-width: 0;
    }
    .filter-topics li { flex: 0 1 auto; min-width: 0; }
    .filter-topic {
        border: 1px solid var(--line-strong);
        border-left-width: 1px;
        border-radius: 999px;
        padding: 5px 11px;
        font-size: .84rem;
        gap: 6px;
        max-width: 100%;
    }
    .filter-topic.is-active {
        border-color: var(--accent);
        border-left-color: var(--accent);
    }
    .filter-topic .filter-count { font-size: .7rem; }
}

@media (max-width: 760px) {
    .container { padding: 0 16px; }

    .header-inner { min-height: 62px; gap: 12px; }
    .brand-tagline { display: none; }
    .brand-name { font-size: 1.18rem; }
    .header-nav { display: none; }

    .hero { padding: 40px 0 24px; }
    .hero-text { font-size: .96rem; }

    .toolbar { gap: 10px; }
    .search-field { flex: 1 1 100%; min-width: 0; }
    .sort-field { flex: 1 1 100%; justify-content: space-between; height: 42px; min-width: 0; }
    .sort-field select { flex: 1; min-width: 0; }

    .cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }

    .card-meta { grid-template-columns: 1fr; gap: 8px; }

    .work-nav { grid-template-columns: 1fr; gap: 12px; }
    .work-nav-next { text-align: left; align-items: flex-start; }

    .footer-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (max-width: 420px) {
    .cards { grid-template-columns: 1fr; }
    .page-btn { min-width: 36px; height: 36px; }
}

/* --------------------------- Уменьшенная анимация ---------------------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
    .card:hover { transform: none; }
    .card:hover .card-media img { transform: none; }
}
