@font-face {
    font-family: "Manrope";
    src: url("../fonts/Manrope-Variable.ttf") format("truetype");
    font-weight: 300 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --ink: #182536;
    --muted: #66758a;
    --line: #dbe7f4;
    --blue-50: #f3f9ff;
    --blue-100: #dcefff;
    --blue-600: #2d7dd2;
    --blue-700: #276fbb;
    --blue-900: #173f6e;
    --coral: #ed6f86;
    --coral-dark: #d9536d;
    --success: #1d9a71;
    --sidebar: 272px;
}

* { box-sizing: border-box; }
html { min-width: 0; background: #fff; }
body {
    min-width: 0;
    margin: 0;
    color: var(--ink);
    background: #fff;
    font-family: "Manrope", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }
img { max-width: 100%; display: block; }
button, input { font: inherit; }
button { border: 0; }
a { color: var(--blue-700); }
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.container { width: calc(100% - 32px); max-width: 1800px; margin-inline: auto; }

/* Шапка сайта: логотип, поиск и мобильные кнопки меню/поиска. */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, .98);
    border-bottom: 1px solid #e8edf4;
}
.header-row {
    min-height: 82px;
    display: grid;
    grid-template-columns: auto minmax(280px, 520px);
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}
.brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    color: var(--blue-900);
    text-decoration: none;
}
.brand-logo {
    width: 260px;
    max-width: 100%;
    height: auto;
    max-height: 64px;
    object-fit: contain;
}
.search { display: flex; min-width: 0; }
.search-results-summary { margin: 0 0 20px; overflow-wrap: anywhere; }
.search input {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
    height: 46px;
    padding: 0 17px;
    color: var(--ink);
    background: #f2f6fb;
    border: 1px solid transparent;
    border-right: 0;
    border-radius: 8px 0 0 8px;
    outline: 0;
}
.search input:focus {
    background: #fff;
    border-color: #9ebce2;
    box-shadow: 0 0 0 3px var(--blue-100);
}
.icon-button {
    width: 46px;
    height: 46px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    color: var(--blue-900);
    background: #fff;
    border: 1px solid #c8d5e5;
    border-radius: 8px;
    cursor: pointer;
}
.icon-button:hover { color: #fff; background: var(--blue-700); border-color: var(--blue-700); }
.search button {
    flex: 0 0 46px;
    color: #fff;
    background: var(--blue-700);
    border-color: var(--blue-700);
    border-radius: 0 8px 8px 0;
}
.search button:hover { background: var(--blue-900); }
.mobile-menu-button, .mobile-search-button { display: none; }

/* Основная раскладка публичных страниц: левое меню + контент. */
.layout {
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    gap: 46px;
    align-items: start;
    padding-block: 38px 72px;
    transition: grid-template-columns .2s ease;
}
.layout.sidebar-collapsed { grid-template-columns: 64px minmax(0, 1fr); }
.sidebar {
    position: sticky;
    top: 104px;
    max-height: calc(100vh - 128px);
    overflow: auto;
    background: transparent;
    border: 0;
    border-radius: 0;
    scrollbar-width: thin;
}
.sidebar-head {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0 12px 3px;
}
.sidebar-title { margin: 0; color: var(--blue-900); font-size: 15px; font-weight: 800; }
.sidebar-close { display: none; }
.sidebar-collapse .icon { transition: transform .2s ease; }
.sidebar-nav { padding: 0; }
.sidebar-empty { padding: 12px 4px; color: var(--muted); font-size: 14px; }

/* Дерево категорий: ссылка открывает категорию, отдельная кнопка раскрывает подкатегории. */
.menu-tree, .menu-tree ul { margin: 0; padding: 0; list-style: none; }
.menu-tree > .menu-item { margin-bottom: 5px; }
.menu-item { border-radius: 8px; }
.menu-item.is-open { background: transparent; }
.menu-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0;
    overflow: hidden;
    border-radius: 8px;
}
.menu-item.is-open > .menu-row { background: rgba(225, 241, 255, .7); }
.menu-item.is-active > .menu-row { background: var(--blue-700); }
.menu-link {
    min-width: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 9px 12px;
    color: #2c3c53;
    text-decoration: none;
    border-radius: 8px 0 0 8px;
    font-size: 16px;
    font-weight: 500;
    transition: color .18s ease;
}
.menu-item:not(.has-children) > .menu-row .menu-link { border-radius: 8px; }
.menu-link:hover { color: var(--blue-600); background: transparent; }
.menu-item.is-active > .menu-row .menu-link,
.menu-link.is-current { color: #fff; background: transparent; }
.menu-item.is-active > .menu-row .menu-link:hover,
.menu-link.is-current:hover { color: #fff; }
.menu-toggle {
    align-self: stretch;
    width: 40px;
    min-height: 44px;
    height: auto;
    display: grid;
    place-items: center;
    color: #637b99;
    background: transparent;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
}
.menu-toggle:hover { color: var(--blue-900); background: rgba(210, 234, 253, .9); }
.menu-item.is-active > .menu-row .menu-toggle { color: #fff; }
.menu-item.is-active > .menu-row .menu-toggle:hover { color: #fff; background: rgba(255, 255, 255, .18); }
.menu-toggle .icon {
    width: 16px;
    height: 16px;
    transform: rotate(90deg);
    transition: transform .15s ease;
}
.menu-item.is-open > .menu-row .menu-toggle .icon { transform: rotate(270deg); }
.menu-children { display: none; padding: 0 8px 9px 18px; }
.menu-item.is-open > .menu-children { display: block; }
.menu-children .menu-children { padding-left: 18px; border-left: 1px solid #cbd9ea; }
.menu-level-2 > .menu-row .menu-link,
.menu-level-3 > .menu-row .menu-link {
    min-height: 44px;
    padding: 9px 12px;
    font-size: inherit;
    font-weight: inherit;
}
.menu-level-2 > .menu-row .menu-toggle,
.menu-level-3 > .menu-row .menu-toggle {
    width: 40px;
    min-height: 44px;
}
.layout.sidebar-collapsed .sidebar-head { justify-content: center; padding-inline: 8px; }
.layout.sidebar-collapsed .sidebar-title,
.layout.sidebar-collapsed .sidebar-nav { display: none; }
.layout.sidebar-collapsed .sidebar-collapse .icon { transform: rotate(180deg); }

.main { min-width: 0; }
.ad-slot {
    margin-bottom: 26px;
    padding: 14px;
    color: var(--muted);
    background: #f5faff;
    border: 1px dashed #bdd4ee;
    border-radius: 12px;
}
.ad-slot-bottom { margin: 0 0 30px; }

/* Заголовок страницы и хлебные крошки. На внутренних страницах крошки стоят под h1. */
.page-intro { padding: 2px 0 30px; }
.breadcrumb {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 15px 0 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}
.breadcrumb a {
    color: var(--blue-700);
    text-decoration: none;
    transition: color .18s ease;
}
.breadcrumb a:hover { color: var(--coral-dark); }
.page-intro h1 {
    margin: 0;
    color: var(--ink);
    font-size: 38px;
    line-height: 1.16;
    font-weight: 800;
}
.page-intro p {
    max-width: 960px;
    margin: 13px 0 0;
    color: var(--muted);
    font-size: 17px;
}

/* Страница одной открытки: верхний блок по центру, метаданные и похожие ниже. */
.content-page { min-width: 0; }
.content-hero {
    max-width: 860px;
    margin-inline: auto;
    text-align: center;
}
.content-hero h1 {
    margin: 0;
    color: var(--ink);
    font-size: 36px;
    line-height: 1.18;
    font-weight: 850;
}
.content-hero .breadcrumb { justify-content: center; }
.content-preview {
    max-width: min(560px, 100%);
    margin: 26px auto 0;
}
.content-preview img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 560px;
    margin-inline: auto;
    object-fit: contain;
    border-radius: 22px;
    box-shadow: 0 18px 42px rgba(38, 94, 145, .14);
}
.content-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 22px;
}
.content-button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 20px;
    color: var(--blue-900);
    background: #fff;
    border: 1px solid #bdd0e4;
    border-radius: 999px;
    text-decoration: none;
    cursor: pointer;
    font-weight: 850;
    box-shadow: 0 10px 22px rgba(38, 94, 145, .1);
}
.content-button:hover {
    color: #fff;
    background: var(--blue-700);
    border-color: var(--blue-700);
}
.content-button-primary {
    color: #fff;
    background: var(--coral);
    border-color: var(--coral);
}
.content-button-primary:hover {
    background: var(--coral-dark);
    border-color: var(--coral-dark);
}
.content-like { color: #ac3158; border-color: #e6b5c4; }
.content-like:hover,
.content-like[aria-pressed="true"] {
    color: #9d244b;
    background: #fff0f5;
    border-color: #cf6b8a;
}
.content-like[aria-pressed="true"] .icon { fill: currentColor; }
.content-like:focus-visible { outline: 3px solid var(--blue-700); outline-offset: 3px; }
.content-like:disabled { cursor: wait; opacity: .65; }
.content-like-count {
    min-width: 1.5em;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(172, 49, 88, .08);
    font-variant-numeric: tabular-nums;
}
.content-meta {
    max-width: none;
    margin: 34px 0 0;
    color: var(--ink);
    font-size: 16px;
}
.content-meta div + div { margin-top: 7px; }
.content-meta span {
    color: var(--muted);
    font-weight: 700;
}
.content-meta a {
    transition: color .18s ease;
}
.content-meta a:hover { color: var(--coral-dark); }
.content-about {
    max-width: none;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 17px;
}
.share-panel {
    max-width: 620px;
    margin: 16px auto 0;
    padding: 7px;
    background: rgba(255, 255, 255, .98);
    border: 1px solid #d7e5f4;
    border-radius: 18px;
    box-shadow: 0 16px 36px rgba(26, 65, 112, .14);
}
.share-services {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
}
.share-service {
    min-width: 0;
    min-height: 48px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 3px;
    padding: 3px;
    color: var(--ink);
    background: transparent;
    border: 0;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    appearance: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease;
}
.share-service:hover {
    color: var(--ink);
    background: transparent;
    box-shadow: none;
    transform: translateY(-2px);
}
.share-service-icon {
    width: 42px;
    height: 42px;
    display: block;
    border-radius: 12px;
}
.related-section { max-width: none; }
.section { padding-top: 38px; }
.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}
.section-title { margin: 0; color: var(--ink); font-size: 25px; line-height: 1.25; font-weight: 800; }
.section-note { margin: 5px 0 0; color: var(--muted); font-size: 15px; }
.section-more { display: flex; justify-content: center; margin-top: 18px; }
.section-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 22px;
    color: #fff;
    background: var(--blue-700);
    border: 1px solid var(--blue-700);
    border-radius: 999px;
    box-shadow: 0 12px 24px rgba(45, 111, 187, .18);
    text-decoration: none;
    font-weight: 800;
    white-space: nowrap;
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.section-link:hover {
    color: #fff;
    background: var(--blue-900);
    border-color: var(--blue-900);
    box-shadow: 0 14px 28px rgba(45, 111, 187, .22);
    transform: translateY(-1px);
}
.section-link:focus-visible { outline: 3px solid var(--blue-100); outline-offset: 3px; }

/* Кнопки подкатегорий над галереей корневой категории. */
.subcategory-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: -8px 0 8px;
}
.subcategory-pill {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 15px;
    color: var(--blue-900);
    background: #eef7ff;
    border: 1px solid #d5e8fa;
    border-radius: 999px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(42, 92, 136, .08);
    transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.subcategory-pill:hover {
    color: #fff;
    background: var(--blue-700);
    border-color: var(--blue-700);
    box-shadow: 0 12px 24px rgba(45, 111, 187, .2);
    transform: translateY(-1px);
}
/* Каталог разделов: ссылки сгруппированы по родителям, без галереи открыток. */
.catalog-description { margin: -4px 0 24px; color: var(--muted); overflow-wrap: anywhere; }
.catalog-search { max-width: 440px; margin: 0 0 24px; }
.catalog-search label { display: block; margin-bottom: 8px; color: var(--blue-900); font-weight: 700; }
.catalog-search input {
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    background: #fff;
}
.catalog-search input:focus-visible { outline: 3px solid var(--blue-100); outline-offset: 2px; }
.catalog-grid {
    align-items: start;
    margin: 0;
    padding: 0;
    list-style: none;
}
.catalog-node { min-width: 0; }
.catalog-children {
    display: grid;
    gap: 8px;
    margin: 8px 0 0 12px;
    padding: 0 0 0 10px;
    border-left: 1px solid var(--line);
    list-style: none;
}
.catalog-empty { margin: 24px 0; padding: 20px; border-radius: 12px; background: var(--blue-50); color: var(--muted); }
.catalog-node[hidden], .catalog-search[hidden], .catalog-empty[hidden] { display: none; }

.category-toolbar {
    display: flex;
    justify-content: flex-end;
    margin: -8px 0 14px;
}
.sort-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 0;
    background: #eef7ff;
    border: 1px solid #d8e9fa;
    border-radius: 999px;
    overflow: hidden;
}
.sort-tab {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 13px;
    color: var(--blue-900);
    border-radius: 999px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 850;
    white-space: nowrap;
}
.sort-tab:hover {
    color: var(--blue-700);
    background: transparent;
}
.sort-tab.is-active {
    color: #fff;
    background: var(--blue-700);
    cursor: default;
}

/* Сетка открыток и сами карточки. */
.gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
    justify-items: center;
}
.postcard {
    width: 100%;
    min-width: 0;
    position: relative;
    isolation: isolate;
    overflow: visible;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 20px;
    box-shadow: none;
    transition: transform .2s ease;
}
.postcard::before {
    content: "";
    position: absolute;
    inset: -7px -6px -7px;
    z-index: -1;
    border-radius: 23px;
    background: rgba(210, 239, 255, .96);
    box-shadow: 0 18px 42px rgba(38, 94, 145, .16);
    opacity: 0;
    transform: scale(.985);
    transition: opacity .2s ease, transform .2s ease;
}
.postcard:hover { transform: translateY(-3px); }
.postcard:hover::before { opacity: 1; transform: scale(1); }
.postcard[hidden] { display: none; }
.postcard-image-link {
    display: block;
    position: relative;
    overflow: hidden;
    width: 100%;
    background: #eaf1f8;
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(36, 86, 132, .08);
    aspect-ratio: 4 / 5;
}
.postcard-image-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.postcard-image-link:focus-visible { outline: 3px solid var(--blue-600); outline-offset: -3px; }
.new-label {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 9px;
    color: #b9425a;
    background: rgba(255, 240, 244, .96);
    border-radius: 5px;
    font-size: 11px;
    font-weight: 800;
}
.postcard-body { display: none; }
.postcard-category { color: var(--blue-700); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.postcard-title { min-height: 48px; margin: 6px 92px 0 0; font-size: 15px; line-height: 1.42; font-weight: 750; }
.postcard-title a { color: var(--ink); text-decoration: none; }
.button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 11px;
    color: var(--blue-900);
    background: #fff;
    border: 1px solid #b9cbe0;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
}
.button:hover { color: #fff; background: var(--blue-700); border-color: var(--blue-700); }
.button-primary { color: #fff; background: var(--coral); border-color: var(--coral); }
.button-primary:hover { background: var(--coral-dark); border-color: var(--coral-dark); }
.empty-state {
    display: none;
    padding: 36px;
    text-align: center;
    color: var(--muted);
    background: #fff;
    border: 1px dashed #afc2da;
    border-radius: 8px;
}
.empty-state.visible { display: block; }

/* Пагинация категорий. */
.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 26px;
}
.pagination-link {
    min-width: 42px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 13px;
    color: var(--blue-900);
    background: #fff;
    border: 1px solid #c8d8e9;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 800;
}
.pagination-link:hover {
    color: #fff;
    background: var(--blue-700);
    border-color: var(--blue-700);
}
.pagination-link.is-current {
    color: #fff;
    background: var(--blue-900);
    border-color: var(--blue-900);
}
.pagination-side { padding-inline: 16px; }

/* Карточки популярных категорий на главной и разделов каталога. */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.category-item {
    min-width: 0;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 11px;
    color: var(--ink);
    background: #eef7ff;
    border: 1px solid transparent;
    border-radius: 8px;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.category-item:nth-child(2n), .catalog-node:nth-child(2n) > .category-item { background: #f7f9ff; }
.category-item:nth-child(3n), .catalog-node:nth-child(3n) > .category-item { background: #fff4f7; }
.category-item:hover, .catalog-node > .category-item:hover {
    background: #fff;
    box-shadow: 0 14px 28px rgba(54, 101, 145, .17);
    transform: translateY(-2px);
}
.category-item:focus-visible { outline: 3px solid var(--blue-700); outline-offset: 2px; }
.category-text { min-width: 0; }
.category-thumb {
    width: 58px;
    height: 58px;
    object-fit: cover;
    background: #dbeafa;
    border-radius: 8px;
}
.category-thumb-empty {
    display: grid;
    place-items: center;
    color: var(--blue-700);
}
.category-name {
    display: block;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 15px;
    font-weight: 800;
}
.category-count { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.category-arrow { color: var(--blue-700); }
.category-arrow .icon { width: 17px; height: 17px; }
.main-about {
    max-width: 960px;
    color: var(--muted);
    font-size: 17px;
}

.site-footer {
    color: #64758a;
    background: #edf7ff;
    border-top: 1px solid #d8eaf8;
}
.footer-row {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    font-size: 14px;
}
.site-footer a { color: var(--blue-700); text-decoration: none; font-weight: 700; }
.site-footer a:hover { text-decoration: underline; }
.menu-overlay { display: none; }
.toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 80;
    max-width: min(360px, calc(100% - 36px));
    padding: 12px 14px;
    color: #fff;
    background: var(--success);
    border-radius: 6px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}
.toast.visible { opacity: 1; transform: translateY(0); }

/* Адаптив: планшеты. */
@media (max-width: 1050px) {
    .container { width: calc(100% - 24px); max-width: 960px; }
    .layout { grid-template-columns: 228px minmax(0, 1fr); gap: 28px; }
    .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .postcard { max-width: 360px; }
    .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Адаптив: мобильное меню и скрытый поиск. */
@media (max-width: 760px) {
    .container { width: calc(100% - 24px); max-width: 680px; }
    .site-header { position: relative; }
    .header-row {
        min-height: 70px;
        grid-template-columns: minmax(0, 1fr) 46px 46px;
        grid-template-areas: "brand search-toggle menu";
        gap: 10px;
        padding-block: 10px 12px;
    }
    .mobile-menu-button { display: inline-grid; grid-area: menu; justify-self: end; }
    .mobile-search-button { display: inline-grid; grid-area: search-toggle; justify-self: end; }
    body.search-open .mobile-search-button { color: #fff; background: var(--blue-700); border-color: var(--blue-700); }
    .brand { grid-area: brand; justify-self: start; }
    .brand-logo { width: 210px; max-height: 48px; }
    .search {
        position: absolute;
        top: calc(100% - 1px);
        left: 12px;
        right: 12px;
        z-index: 45;
        width: auto;
        padding: 8px;
        background: rgba(255, 255, 255, .98);
        border: 1px solid #dce8f5;
        border-radius: 0 0 16px 16px;
        box-shadow: 0 16px 34px rgba(42, 92, 136, .14);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-8px);
        transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
    }
    body.search-open .search {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }
    .layout,
    .layout.sidebar-collapsed { display: block; padding-block: 28px 48px; }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 55;
        width: min(330px, calc(100% - 48px));
        max-height: none;
        background: #fff;
        border: 0;
        border-right: 1px solid var(--line);
        border-radius: 0;
        transform: translateX(-102%);
        transition: transform .2s ease;
    }
    body.menu-open .sidebar { transform: translateX(0); }
    .sidebar-head {
        position: sticky;
        top: 0;
        z-index: 2;
        padding: 10px 12px;
        background: #fff;
        border-bottom: 1px solid var(--line);
    }
    .sidebar-nav { padding: 10px; }
    .sidebar-close { display: inline-grid; }
    .sidebar-collapse { display: none; }
    .layout.sidebar-collapsed .sidebar-head { justify-content: space-between; padding: 8px 10px 8px 18px; border-bottom: 1px solid var(--line); }
    .layout.sidebar-collapsed .sidebar-title,
    .layout.sidebar-collapsed .sidebar-nav { display: block; }
    .menu-overlay {
        position: fixed;
        inset: 0;
        z-index: 50;
        display: block;
        visibility: hidden;
        background: rgba(10, 28, 52, .45);
        opacity: 0;
        transition: opacity .2s ease, visibility .2s ease;
    }
    body.menu-open .menu-overlay { visibility: visible; opacity: 1; }
    .page-intro h1 { font-size: 30px; }
    .content-hero h1 { font-size: 30px; }
    .section-title { font-size: 22px; }
    .footer-row {
        min-height: 104px;
        flex-direction: column;
        justify-content: center;
        gap: 8px;
        text-align: center;
    }
}

/* Адаптив: узкие экраны. */
@media (max-width: 520px) {
    .search input { min-width: 0; }
    .search button { width: 42px; }
    .page-intro { padding-top: 0; }
    .page-intro h1 { font-size: 27px; }
    .content-hero h1 { font-size: 27px; }
    .content-preview img { border-radius: 18px; }
    .content-button { width: 100%; max-width: 220px; }
    .share-panel { padding: 6px; border-radius: 16px; }
    .share-services { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
    .share-service { min-height: 52px; border-radius: 12px; }
    .section { padding-top: 28px; }
    .section-head { align-items: start; }
    .section-link { font-size: 14px; }
    .gallery,
    .category-grid { grid-template-columns: 1fr; }
    .postcard { max-width: 340px; }
    .postcard-title { min-height: 0; }
    .category-item { grid-template-columns: 54px minmax(0, 1fr) auto; }
    .category-thumb { width: 54px; height: 54px; }
}

@media (max-width: 340px) {
    .container { width: calc(100% - 16px); }
    .header-row { grid-template-columns: minmax(0, 1fr) 42px 42px; gap: 8px; }
    .brand-logo { width: 150px; max-height: 40px; }
    .mobile-menu-button,
    .mobile-search-button { width: 42px; height: 42px; }
    .search { left: 8px; right: 8px; padding: 6px; }
    .search input { height: 42px; padding-inline: 12px; }
    .search button { height: 42px; flex-basis: 42px; }
    .page-intro h1 { font-size: 24px; }
    .content-hero h1 { font-size: 24px; }
    .share-services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .section-head { gap: 10px; }
    .section-link { width: 100%; max-width: 220px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
