:root {
    --primary: #1b365d;
    --accent: #b8860b;
    --bg: #f4f6f8;
    --text: #1f2933;
    --muted: #6b7280;
    --card: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", "Open Sans", sans-serif;
    font-size: calc(16px * var(--a11y-font-scale, 1));
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover,
a:focus {
    color: #244f86;
    text-decoration: none;
}

.container {
    width: min(1100px, 92%);
    margin: 0 auto;
}

.site-header {
    background: var(--primary);
    color: #fff;
    padding: 14px 0;
}

.site-header a {
    text-decoration: none !important;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 2000;
    padding: 10px 14px;
    border-radius: 6px;
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.site-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.site-socials {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.site-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    color: #fff !important;
    background: rgba(255, 255, 255, 0.14);
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1;
}

.site-social--telegram {
    font-size: 1.15rem;
}

.site-social:hover,
.site-social:focus {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.28);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.site-header .brand,
.site-header .brand:link,
.site-header .brand:visited,
.site-header .brand:hover,
.site-header .brand:focus,
.site-header .brand:active,
.site-header .brand *,
.site-header .brand:hover *,
.site-header .brand:focus *,
.site-header .brand:active * {
    color: #fff !important;
    text-decoration: none !important;
}

.site-header .brand:hover .brand-description,
.site-header .brand:focus .brand-description,
.site-header .brand:active .brand-description {
    opacity: 0.92;
}

.brand-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.brand-logo {
    height: 62px;
    width: auto;
    display: block;
    border-radius: 8px;
    background: #ffffff;
    padding: 4px;
}

.brand-text {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    line-height: 1.1;
}

.brand-description {
    font-size: 0.92rem;
    line-height: 1.2;
    opacity: 0.92;
}

.site-nav {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 8px;
    flex: 1;
}

.site-header-bottom {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 8px;
}

.home-bottom-banners {
    margin-top: 26px;
    padding: 22px;
    border-radius: 14px;
    background: var(--primary);
}

.home-bottom-banners .rich-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
}

.home-bottom-banners .rich-content > * {
    margin: 0;
}

.home-bottom-banners .rich-content img {
    display: inline-block;
    max-width: min(100%, 360px);
    height: auto;
    border-radius: 4px;
    vertical-align: middle;
}

.home-bottom-banners .rich-content p {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.home-bottom-banners .rich-content a {
    display: inline-flex;
    align-items: center;
}

.mobile-menu-toggle {
    display: none;
}

.site-nav a {
    color: #fff;
    text-decoration: none;
    opacity: 0.95;
}

.site-nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.site-nav-dropdown-link::after {
    content: "";
    display: inline-block;
    margin-left: 6px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid rgba(255, 255, 255, 0.85);
    vertical-align: middle;
}

.site-nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 30;
    display: none !important;
    min-width: 260px;
    max-width: min(360px, 90vw);
    padding: 8px;
    background: #ffffff;
    color: var(--text);
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
}

.site-nav-dropdown-menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -10px;
    height: 10px;
}

.site-nav-dropdown:hover .site-nav-dropdown-menu,
.site-nav-dropdown:focus-within .site-nav-dropdown-menu {
    display: grid !important;
    gap: 4px;
}

.site-nav .site-nav-dropdown-menu a {
    color: var(--primary);
    padding: 8px 10px;
    border-radius: 8px;
    line-height: 1.25;
}

.site-nav .site-nav-dropdown-menu a:hover,
.site-nav .site-nav-dropdown-menu a:focus {
    background: #eef3f8;
    text-decoration: none;
}

.site-accessibility {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    margin-top: 0;
    margin-left: auto;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.a11y-control-slot {
    min-width: 0;
    display: inline-flex;
    align-items: center;
}

.a11y-eye,
.a11y-controls button {
    width: auto;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 1rem;
}

.a11y-eye {
    min-width: 52px;
    min-height: 40px;
}

.a11y-controls {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.a11y-controls button {
    min-width: 42px;
    text-align: center;
}

.a11y-label {
    width: auto;
    border: 0;
    background: transparent;
    color: #fff;
    padding: 0;
    font-size: 0.95rem;
    line-height: 1;
    white-space: nowrap;
    margin-left: 2px;
}

.site-accessibility.is-open .a11y-eye {
    display: none;
}

.site-accessibility:not(.is-open) .a11y-controls {
    display: none;
}

main {
    padding: 24px 0 40px;
}

.home-layout {
    position: relative;
    overflow: visible;
}

.home-layout.has-sidebars {
    min-height: 1px;
}

.home-main {
    width: 100%;
    min-width: 0;
    position: relative;
    z-index: 2;
}

.home-main > section {
    margin-bottom: 20px;
}

.home-side {
    display: none;
}

.home-side-content {
    background: var(--card);
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    word-break: break-word;
}

.home-side-content img,
.home-side-content iframe {
    max-width: 100%;
}

.home-side-content img {
    height: auto;
}

.home-side-content iframe {
    display: block;
}

.friendly-sidebar {
    margin: -14px;
    padding: 0 12px 16px;
    border-radius: 10px;
    background: #98c9ef;
    color: #073c64;
    font-size: 14px;
    line-height: 1.35;
    text-align: center;
    overflow: hidden;
}

.friendly-sidebar__title {
    margin: 0 -12px 12px;
    padding: 8px 10px;
    background: #5d9bd1;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
}

.friendly-sidebar p {
    margin: 0 0 16px;
}

.friendly-sidebar__banner,
.friendly-sidebar__image {
    display: block;
    margin: 0 auto 18px;
}

.friendly-sidebar__banner img,
.friendly-sidebar__image img {
    display: block;
    margin: 0 auto;
}

.friendly-sidebar__banner.is-tight,
.friendly-sidebar__image.is-tight {
    margin-bottom: 10px;
}

.friendly-sidebar__banner.is-bordered img {
    border: 1px solid #c8c8c8;
}

.friendly-sidebar__text-link {
    display: inline-block;
    margin: -6px 0 18px;
    color: #064b7a;
    font-weight: 700;
}

.friendly-sidebar__movie {
    color: #d60000;
    font-size: 18px;
    font-weight: 700;
}

.home-side.is-empty {
    display: none;
}

@media (min-width: 1360px) {
    /* На широком экране боковые блоки занимают собственные колонки. */
    .home-layout.has-sidebars {
        display: grid;
        grid-template-columns:
            minmax(0, min(260px, calc((100vw - min(1100px, 92vw)) / 2 - 20px)))
            minmax(0, min(1100px, 92vw))
            minmax(0, min(260px, calc((100vw - min(1100px, 92vw)) / 2 - 20px)));
        gap: 20px;
        width: min(calc(100vw - 40px), 1620px);
        left: 50%;
        transform: translateX(-50%);
    }

    .home-layout.has-sidebars .home-main {
        grid-column: 2;
        width: auto;
    }

    .home-layout.has-sidebars .home-side:not(.is-empty) {
        display: block;
        position: static;
        width: auto;
        z-index: 1;
    }

    .home-layout.has-sidebars .home-side-left {
        grid-column: 1;
        grid-row: 1;
    }

    .home-layout.has-sidebars .home-side-right {
        grid-column: 3;
        grid-row: 1;
    }

    .home-layout.has-sidebars .home-side-content {
        position: sticky;
        top: 18px;
    }
}

.hero {
    background: linear-gradient(135deg, #1b365d, #334e68);
    color: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.home-hero-custom > *:first-child {
    margin-top: 0;
}

.home-hero-custom > *:last-child {
    margin-bottom: 0;
}

.home-feedback-banner {
    display: inline-block;
    width: auto;
    max-width: 100%;
    min-width: 0;
    margin-top: 0;
    border-radius: 8px;
    vertical-align: top;
}

.home-feedback-banner img {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
}

.cards {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.card {
    background: var(--card);
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.documents-list {
    background: var(--card);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.document-row {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 54px;
    padding: 10px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.document-row:last-child {
    border-bottom: 0;
}

.document-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
}

.document-category {
    flex: 0 0 180px;
    color: var(--muted);
    font-size: 14px;
}

.document-description {
    flex: 1 1 auto;
    color: var(--text);
    font-size: 15px;
    line-height: 1.35;
}

@media (max-width: 760px) {
    .document-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .document-title,
    .document-category,
    .document-description {
        flex: none;
        width: 100%;
    }
}

.activity-card-image {
    display: block;
    margin-bottom: 12px;
}

.activity-card-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    display: block;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.gallery-item {
    background: var(--card);
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.gallery-item img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.gallery-item h2,
.gallery-item h3 {
    margin: 10px 0 6px;
}

.gallery-item h4 {
    margin: 10px 0 6px;
}

.album-block {
    margin-bottom: 20px;
}

.news-lines {
    display: grid;
    gap: 14px;
}

.news-line {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 14px;
    align-items: start;
    background: var(--card);
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.news-line.no-image {
    grid-template-columns: 1fr;
}

.news-line-image-wrap {
    display: block;
    width: 170px;
}

.news-line-image {
    display: block;
    width: 170px;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.news-line-content {
    min-width: 0;
}

.news-line-date {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 0.92rem;
}

.news-line-title {
    margin: 0 0 8px;
    font-size: 1.5rem;
    line-height: 1.25;
}

.news-line-text {
    margin: 0;
}

.map-card {
    background: var(--card);
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 16px;
}

.map-card h2 {
    margin-top: 0;
}

.map-container {
    width: 100%;
    height: 420px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.home-institutions-map {
    width: 100%;
    height: min(620px, 65vh);
    min-height: 420px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.muted {
    color: var(--muted);
}

.filters {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.documents-filter {
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 320px) minmax(140px, 220px);
}

@media (max-width: 760px) {
    .documents-filter {
        grid-template-columns: 1fr;
    }
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

input,
textarea,
select,
button {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font: inherit;
}

button {
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
}

button:hover {
    opacity: 0.92;
}

.article img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.rich-content {
    overflow-wrap: anywhere;
}

.rich-content img {
    max-width: 100%;
    height: auto;
}

.rich-content table {
    max-width: 100%;
    border-collapse: collapse;
}

.legacy-news-content h1 {
    margin-top: 0;
}

.legacy-news-content .date {
    color: var(--muted);
    font-size: 0.92rem;
    margin-right: 8px;
}

.legacy-news-content .news_gallery_album {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(144px, 1fr));
    margin-top: 12px;
}

.legacy-news-content .gallery_image_element {
    display: block;
}

.about-page {
    padding: 24px 0 48px;
}

.about-page__heading {
    max-width: 900px;
    margin-bottom: 28px;
}

.about-page__heading h1 {
    margin: 4px 0 16px;
}

.eyebrow {
    margin: 0;
    color: var(--accent, #00b894);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: .86rem;
}

.about-layout {
    display: grid;
    grid-template-columns: minmax(205px, 260px) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.about-nav {
    position: sticky;
    top: 18px;
    display: grid;
    gap: 5px;
    padding: 14px;
    background: #fff;
    border: 1px solid #dde5ef;
    border-radius: 12px;
}

.about-nav a {
    padding: 8px 10px;
    color: #1f3f6b;
    border-radius: 7px;
}

.about-nav a:hover,
.about-nav a:focus-visible {
    color: #fff;
    background: #1f3f6b;
    text-decoration: none;
}

.about-sections {
    min-width: 0;
}

.about-section {
    margin-bottom: 22px;
    padding: 26px;
    background: #fff;
    border: 1px solid #dde5ef;
    border-radius: 12px;
    scroll-margin-top: 24px;
}

.about-section h2 {
    margin-top: 0;
}

.about-details {
    display: grid;
    gap: 14px;
    margin: 0;
}

.about-details > div {
    display: grid;
    grid-template-columns: minmax(170px, 240px) minmax(0, 1fr);
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #edf1f5;
}

.about-details > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.about-details dt {
    color: #526172;
    font-weight: 700;
}

.about-details dd {
    margin: 0;
}

.about-leaders {
    display: grid;
    gap: 18px;
}

.about-leader {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid #edf1f5;
}

.about-leader:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.about-leader img {
    width: 150px;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
}

.about-leader h3,
.about-system-list h3 {
    margin: 0 0 7px;
}

.about-document-list,
.about-system-list {
    display: grid;
    gap: 12px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.about-document-list li,
.about-system-list article {
    padding: 14px 0;
    border-bottom: 1px solid #edf1f5;
}

.about-document-list span {
    display: block;
    margin-top: 5px;
    color: #526172;
}

.about-institutions {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.about-social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.about-social-links a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 20px;
    color: #fff;
    background: #1f3f6b;
    font-weight: 700;
}

.about-social-links a:hover {
    color: #fff;
    background: #00a98f;
    text-decoration: none;
}

.gallery-item-link {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

.legacy-news-content .gallery_image_thumbail {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.gallery-page {
    display: grid;
    gap: 24px;
}

.gallery-section {
    display: grid;
    gap: 14px;
}

.album-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.album-card {
    background: var(--card);
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.album-card.is-active {
    outline: 2px solid var(--primary);
}

.album-stack-button {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 0;
    border-radius: 10px;
    background: transparent;
    padding: 0;
    cursor: pointer;
    margin-bottom: 10px;
}

.album-preview {
    position: absolute;
    width: calc(100% - 18px);
    height: calc(100% - 18px);
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #d8dee6;
    background: #fff;
    box-shadow: 0 6px 14px rgba(31, 41, 51, 0.18);
}

.album-preview-1 {
    top: 0;
    left: 0;
    z-index: 3;
}

.album-preview-2 {
    top: 6px;
    left: 6px;
    z-index: 2;
}

.album-preview-3 {
    top: 12px;
    left: 12px;
    z-index: 1;
}

.album-empty {
    width: 100%;
    height: 100%;
    border: 1px dashed #c7ced8;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.95rem;
}

.album-card h3 {
    margin: 6px 0 4px;
    font-size: 1.05rem;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.album-card .muted {
    margin: 0 0 6px;
    font-size: 0.9rem;
}

.album-count {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.album-modal {
    position: fixed;
    inset: 0;
    z-index: 990;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.album-modal[hidden] {
    display: none !important;
}

.album-modal-content {
    width: min(960px, 96vw);
    max-height: 92vh;
    overflow: auto;
    background: var(--card);
    border-radius: 12px;
    padding: 16px;
    position: relative;
}

.album-modal-content h3 {
    margin: 0 0 8px;
}

.album-modal-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.album-modal-item {
    border: 0;
    border-radius: 8px;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.album-modal-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.album-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: auto;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color: #111;
    font-size: 2rem;
    line-height: 1;
    padding: 2px 10px;
    cursor: pointer;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.2);
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
}

.media-tile {
    background: var(--card);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.media-tile-link {
    display: block;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.media-tile img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.pagination {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.pagination::-webkit-scrollbar {
    display: none;
}

.album-title-button {
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--primary);
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.pagination-link {
    min-width: 32px;
    padding: 6px 7px;
    border: 1px solid #cad2dd;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    color: var(--text);
    background: #fff;
}

.pagination-link.is-active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    flex-direction: column;
    gap: 10px;
}

.gallery-lightbox.is-open {
    display: flex;
}

.gallery-lightbox img {
    max-width: min(96vw, 1600px);
    max-height: 84vh;
    object-fit: contain;
}

.gallery-lightbox .gallery-lightbox-media {
    max-width: min(96vw, 1600px);
    max-height: 84vh;
    width: min(96vw, 1600px);
    border: 0;
    background: #000;
}

.gallery-lightbox iframe.gallery-lightbox-media {
    height: 84vh;
    background: #fff;
}

.gallery-lightbox audio.gallery-lightbox-media {
    height: auto;
    max-width: min(96vw, 900px);
    width: min(96vw, 900px);
    padding: 8px;
    background: #fff;
    border-radius: 10px;
}

.gallery-lightbox-file {
    max-width: min(96vw, 700px);
    background: #fff;
    color: #111;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.gallery-lightbox-file p {
    color: #111;
    margin: 0 0 10px;
}

.gallery-lightbox-file a {
    display: inline-block;
    width: auto;
    padding: 10px 14px;
    border-radius: 8px;
    background: #1b365d;
    color: #fff;
    text-decoration: none;
}

.gallery-lightbox p {
    margin: 0;
    color: #fff;
    max-width: min(92vw, 1400px);
    text-align: center;
}

.gallery-lightbox-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: auto;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color: #111;
    font-size: 2rem;
    line-height: 1;
    padding: 2px 10px;
    cursor: pointer;
}

.gallery-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #111;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.gallery-lightbox-prev {
    left: 16px;
}

.gallery-lightbox-next {
    right: 16px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

body.lightbox-opened {
    overflow: hidden;
}

body.a11y-mode {
    line-height: 1.75;
}

body.a11y-mode input,
body.a11y-mode textarea,
body.a11y-mode select,
body.a11y-mode button {
    border-width: 2px;
}

body.a11y-mode .a11y-label,
body.a11y-mode .a11y-eye,
body.a11y-mode .a11y-controls button {
    border-width: 2px;
}

body.a11y-mode *:focus-visible {
    outline: 3px solid #1b365d;
    outline-offset: 2px;
}

.site-footer {
    border-top: 1px solid #e5e7eb;
    padding: 16px 0;
    color: var(--muted);
    background: #fff;
}

.appeal-captcha {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: -8px 0 16px;
}

.appeal-captcha img {
    width: 190px;
    height: 62px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

.appeal-policy-confirmation {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.appeal-policy-confirmation input {
    width: auto;
    margin-top: 0.3em;
}

.site-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.site-footer__inner p {
    margin: 0;
}

.site-footer__inner > a {
    color: inherit;
    text-decoration: underline;
}

.document-archive-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #e5e7eb;
    color: #4b5563;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.35;
}

.yandex-metrika-informer {
    display: inline-flex;
    line-height: 0;
}

@media (max-width: 480px) {
    .site-footer__inner {
        align-items: flex-start;
        flex-direction: column;
    }
}

.cookie-consent {
    position: fixed;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    width: min(1100px, calc(100% - 20px));
    z-index: 1200;
    transition: opacity 0.24s ease, transform 0.24s ease, visibility 0.24s ease;
}

.cookie-consent.is-hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(14px);
    visibility: hidden;
    pointer-events: none;
}

.cookie-consent__inner {
    background: rgba(27, 54, 93, 0.82);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
    padding: 12px 14px;
}

.cookie-consent__title {
    margin: 0 0 6px;
    font-weight: 700;
}

.cookie-consent__text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.cookie-consent__btn {
    margin-top: 10px;
    border: 0;
    border-radius: 8px;
    padding: 7px 14px;
    font-weight: 700;
    background: #f59e0b;
    color: #1f2933;
    cursor: pointer;
}

.cookie-consent__btn:hover,
.cookie-consent__btn:focus {
    background: #fbbf24;
}

@media (max-width: 640px) {
    .about-page {
        padding-top: 16px;
    }

    .about-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .about-nav {
        position: static;
        display: flex;
        overflow-x: auto;
        gap: 8px;
        padding: 8px;
        white-space: nowrap;
    }

    .about-nav a {
        flex: 0 0 auto;
        padding: 8px 10px;
        border: 1px solid #dde5ef;
    }

    .about-section {
        padding: 18px;
    }

    .about-details > div,
    .about-leader {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .about-leader img {
        width: 120px;
        height: 145px;
    }

    .site-header-top {
        align-items: flex-start;
        gap: 10px;
    }

    .site-socials {
        max-width: 94px;
        gap: 5px;
    }

    .site-social {
        width: 30px;
        height: 30px;
        font-size: 0.6rem;
    }

    .site-social--telegram {
        font-size: 0.9rem;
    }

    .brand-logo {
        height: 46px;
    }

    .brand-text {
        font-size: 1.08rem;
    }

    .brand-description {
        font-size: 0.82rem;
    }

    .site-header-bottom {
        position: relative;
        align-items: flex-start;
        gap: 10px;
    }

    .mobile-menu-toggle {
        display: inline-flex;
        width: 44px;
        height: 40px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        padding: 8px;
        border: 1px solid rgba(255, 255, 255, 0.45);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.14);
        cursor: pointer;
    }

    .mobile-menu-toggle span {
        display: block;
        width: 22px;
        height: 2px;
        border-radius: 2px;
        background: #fff;
    }

    .site-nav {
        position: absolute;
        top: calc(100% + 4px);
        left: 0;
        right: 0;
        z-index: 100;
        display: none;
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 6px;
        margin: 0;
        padding: 14px;
        background: var(--primary);
        border-radius: 10px;
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.28);
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav > a,
    .site-nav-dropdown-link {
        display: block;
        padding: 7px 4px;
        font-size: 1.12rem;
        line-height: 1.35;
    }

    .site-nav-dropdown {
        display: block;
        width: 100%;
    }

    .site-nav-dropdown-menu {
        position: static;
        max-width: 100%;
        margin-top: 8px;
        box-shadow: none;
    }

    .site-accessibility {
        margin-left: 0;
        justify-content: flex-start;
    }

    .cookie-consent {
        bottom: 8px;
        width: calc(100% - 12px);
    }

    .cookie-consent__inner {
        padding: 10px 11px;
    }

    .cookie-consent__text {
        font-size: 0.84rem;
    }

    .cookie-consent__btn {
        width: 100%;
    }

    .map-container {
        height: 320px;
    }

    .home-institutions-map {
        height: 420px;
        min-height: 0;
    }

    .news-line {
        grid-template-columns: 1fr;
    }

    .news-line-image-wrap,
    .news-line-image {
        width: 100%;
    }

    .news-line-image {
        height: 180px;
    }

    .news-line-title {
        font-size: 1.35rem;
    }

    .album-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .album-modal-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .media-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .album-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .album-modal-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .media-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}
