/* Общая типографика и навигация городского портала */
:root {
    --portal-ink: #102f60;
    --portal-paper: #f1f5fa;
    --portal-line: #d8e2ed;
}

.site-header__inner { min-height: 78px; }
.site-logo__symbol, .footer-logo__symbol {
    border-radius: 15px 15px 15px 4px;
    box-shadow: inset 0 -4px 0 #c42c57;
}
.main-nav a { font-size: 15px; }
.main-nav a[aria-current] {
    color: var(--color-primary);
    text-decoration: underline;
    text-decoration-color: var(--color-accent);
    text-decoration-thickness: 3px;
    text-underline-offset: 7px;
}
.section-heading h2, .page-heading h1, .service-intro h1 {
    color: var(--portal-ink);
    letter-spacing: -.035em;
}
.section-heading { align-items: baseline; margin-bottom: 22px; }
.section-heading h2 { font-size: clamp(26px, 3vw, 38px); }
.section { padding-block: clamp(32px, 4vw, 60px); }

/* Первый экран */
.portal-intro { padding-top: clamp(16px, 2.4vw, 32px); }
.portal-banner {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    align-items: stretch;
    border-radius: 24px;
    background: #e6eef9;
    isolation: isolate;
}
.portal-copy {
    min-width: 0;
    align-self: center;
    padding: clamp(26px, 3.8vw, 55px);
}
.portal-location {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 700;
}
.portal-location::before {
    content: "";
    width: 25px;
    height: 3px;
    background: var(--color-accent);
}
.portal-copy h1 {
    color: var(--portal-ink);
    margin: 0 0 16px;
    font-size: clamp(34px, 4vw, 56px);
    text-wrap: balance;
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: -.045em;
}
.portal-lead { max-width: 46ch; margin-bottom: 24px; color: #354d6a; }
.portal-copy .site-search {
    background: white;
    min-height: 54px;
    border-color: #bbcde2;
    box-shadow: none;
}
.portal-copy .site-search button { min-width: 80px; }
.portal-copy .live-search-results:not(:empty) {
    margin-top: 8px;
    background: white;
    border-radius: 12px;
}
.service-carousel {
    position: relative;
    min-width: 0;
    min-height: 300px;
    overflow: hidden;
    border-radius: 96px 24px 24px 0;
    background: var(--portal-ink);
    display: grid;
}
.service-carousel__track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
}
.service-carousel[data-ready] .service-carousel__track { scrollbar-width: none; }
.service-slide {
    position: relative;
    display: grid;
    align-content: end;
    isolation: isolate;
    overflow: hidden;
    scroll-snap-align: start;
    background: var(--color-primary);
    color: white;
}
.service-slide--photo img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 42%;
}
.service-slide--photo::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(0deg, #091b35ed, #091b35b8 22%, transparent 60%);
}
.service-slide--category { background: linear-gradient(125deg, #132f60, #275997); }
.service-slide--online {
    background: radial-gradient(circle at 92% 0, transparent 25%, #ffffff20 25.3% 33%, transparent 33.3% 42%, #ffffff12 42.3% 51%, transparent 51.3%), #80324f;
}
.service-slide__illustration {
    position: absolute;
    top: 20px;
    right: 28px;
    z-index: -1;
    color: #ffffff30;
}
.service-slide__illustration svg { width: 112px; height: 112px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.service-slide__content { padding: 90px 24px 22px; overflow-wrap: anywhere; }
.service-slide__content h2 {
    margin: 0 0 16px;
    color: inherit;
    font-size: clamp(23px, 2.3vw, 34px);
    line-height: 1.1;
    text-wrap: balance;
}
.service-slide__content p { margin: 0 0 8px; font-size: 15px; }
.service-slide__link, .service-carousel__controls button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    font-weight: 700;
}
.service-slide__link {
    gap: 10px;
    padding: 0 18px;
    border-radius: 10px;
    background: white;
    color: var(--portal-ink);
}
.service-slide__link:hover { background: var(--color-light-blue); }
.service-carousel__controls:not([hidden]) {
    position: absolute;
    right: 14px;
    bottom: 22px;
    display: flex;
    align-items: center;
    color: white;
    background: #122747eb;
    border-radius: 12px;
}
.service-carousel__controls button {
    min-width: 36px;
    padding: 0 4px;
    color: inherit;
    background: transparent;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
}
.service-carousel__controls button:hover { background: #ffffff28; }
.service-carousel__counter { font-size: 13px; font-variant-numeric: tabular-nums; }

/* Категории и ссылки */
.categories-section { background: white; }
.categories-grid { gap: 12px; }
.category-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 104px;
    padding: 18px;
    border-color: var(--portal-line);
    border-radius: 16px;
}
.category-card__top { margin: 0; }
.category-card__title { max-width: none; color: var(--portal-ink); font-size: 17px; }
.category-card__icon { width: 60px; height: 60px; flex-basis: 60px; }
.category-card__icon svg { width: 30px; height: 30px; }
.category-card__arrow { position: static; font-size: 20px; }
.popular-section { background: var(--portal-paper); }
.service-search-section { background: white; padding-block: clamp(32px, 4vw, 60px); }
.service-search-card { border-color: var(--portal-line); box-shadow: none; }
.portal-resources { background: var(--portal-paper); }
.resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.resource-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 72px;
    padding: 18px 20px;
    color: var(--portal-ink);
    background: white;
    border: 1px solid var(--portal-line);
    border-radius: 14px;
}
.resource-link span { color: var(--color-accent); font-size: 22px; }
.resource-link:hover, .resource-link:focus-visible { border-color: var(--color-primary); }

/* Внутренние страницы */
.page-heading { background: #eaf1f9; border-bottom: 1px solid var(--portal-line); }
.page-heading h1 { font-size: clamp(30px, 3.6vw, 48px); }
.page-heading .breadcrumbs { margin-bottom: 18px; }
.service-intro { background: #eaf1f9; border-left: 4px solid var(--color-primary); }
.catalog-empty { background: var(--portal-paper); }
.site-footer { background: #112f59; }
.site-footer a:hover { text-decoration: underline; }

/* Фирменная страница для несуществующего адреса */
.missing-page {
    display: grid;
    grid-template-columns: minmax(210px, .7fr) minmax(0, 1.3fr);
    align-items: center;
    gap: clamp(30px, 7vw, 90px);
    min-height: 560px;
    padding-top: 70px;
    padding-bottom: 70px;
}

.missing-page__code {
    color: #d7e5f7;
    font-size: clamp(110px, 18vw, 230px);
    font-weight: 800;
    line-height: .8;
    letter-spacing: -.08em;
}

.missing-page h1 {
    margin-bottom: 18px;
    font-size: clamp(34px, 5vw, 58px);
}

.missing-page p {
    max-width: 620px;
    margin-bottom: 28px;
    color: #56677e;
    font-size: 18px;
}

.missing-page__links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
}

@media (max-width: 800px) {
    .portal-banner { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
    .portal-copy { padding: 24px; }
    .resource-grid { grid-template-columns: 1fr; }
}
@media (min-width: 651px) and (max-width: 720px) {
    .service-carousel__controls:not([hidden]) {
        top: 14px;
        bottom: auto;
    }
}
@media (max-width: 650px) {
    .site-header__inner { min-height: 68px; }
    .portal-banner { grid-template-columns: 1fr; border-radius: 18px; }
    .portal-copy { padding: 23px 18px; }
    .portal-location { margin-bottom: 12px; font-size: 13px; }
    .portal-lead { margin-bottom: 18px; line-height: 1.45; }
    .service-carousel { min-height: clamp(218px, 60vw, 290px); border-radius: 0 0 18px 18px; }
    .service-slide__content { padding: 82px 14px 14px; }
    .service-carousel__controls:not([hidden]) { right: 10px; bottom: 14px; }
    .service-slide__link { padding: 0 12px; }
    .portal-copy .site-search { min-height: 48px; }
    .portal-copy .site-search button { min-width: 64px; }
    .section-heading { flex-direction: row; flex-wrap: wrap; gap: 8px 16px; }
    .category-card { min-height: 78px; padding: 12px 16px; }
    .category-card__icon { width: 48px; height: 48px; flex-basis: 48px; }
    .category-card__icon svg { width: 25px; height: 25px; }
    .missing-page { grid-template-columns: 1fr; min-height: 480px; gap: 22px; }
    .missing-page__code { font-size: 100px; }
}
body.accessibility-mode .portal-banner,
body.accessibility-mode .resource-link,
body.accessibility-mode .portal-copy .site-search {
    background: var(--a11y-surface) !important;
    border: 2px solid var(--a11y-border);
}
body.accessibility-mode .service-slide { background: var(--a11y-surface) !important; }
body.accessibility-mode .service-slide--photo::after,
body.accessibility-mode .service-slide__illustration { display: none; }
body.accessibility-mode .service-slide--photo img { opacity: .12; }
body.accessibility-mode .service-carousel__controls:not([hidden]) {
    position: static;
    justify-content: center;
    background: var(--a11y-surface);
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .category-card, .category-card__icon, .service-card { transition: none; }
}
