/* roboto-300 - cyrillic_cyrillic-ext_latin_latin-ext */
@font-face {
  font-display: swap;
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 300;
  src: url('../fonts/roboto/roboto-v48-cyrillic_cyrillic-ext_latin_latin-ext-300.woff2') format('woff2');
}
/* roboto-regular - cyrillic_cyrillic-ext_latin_latin-ext */
@font-face {
  font-display: swap;
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/roboto/roboto-v48-cyrillic_cyrillic-ext_latin_latin-ext-regular.woff2') format('woff2');
}
/* roboto-500 - cyrillic_cyrillic-ext_latin_latin-ext */
@font-face {
  font-display: swap;
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 500;
  src: url('../fonts/roboto/roboto-v48-cyrillic_cyrillic-ext_latin_latin-ext-500.woff2') format('woff2');
}
/* roboto-700 - cyrillic_cyrillic-ext_latin_latin-ext */
@font-face {
  font-display: swap;
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 700;
  src: url('../fonts/roboto/roboto-v48-cyrillic_cyrillic-ext_latin_latin-ext-700.woff2') format('woff2');
}
/* =========================================================
   Design Tokens
========================================================= */
:root {
    --color-primary: #1b4994;
    --color-primary-2: #2c5aa0;
    --color-secondary: #e74c3c;
    --color-accent: #3498db;
    --color-bg: #f5f5f5;
    --color-text: #333;
    --radius-lg: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 2px 10px #2980b96b;
    --shadow-md: 0 8px 24px #1c3a7a;
    --container: 1200px;
    --header-h: 72px;
}

/* Dark mode variables */
.dark-mode {
    --color-primary: #1a2b5c;
    --color-primary-2: #1c3a7a;
    --color-secondary: #c0392b;
    --color-accent: #2980b9;
    --color-bg: #1f427ad3;
    --color-text: #e0e0e0;
}

/* Reset & base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {

}

body {
    font-family: Roboto, system-ui, -apple-system, Segoe UI, Arial, sans-serif;
    line-height: 1.6;
    color: var(--color-text); ;
    background: var(--color-bg);
    transition: background 0.3s ease, color 0.3s ease;
    margin: 0;
    padding: 0;
 }

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

a {
    color: inherit;
    transition: color 0.25s ease;
    text-decoration: none;
}

.container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

/* Skip link */
.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: #fff;
    padding: .5rem .75rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.skip-link:focus {
    left: .5rem;
    top: .5rem;
    z-index: 1000;
}

/* Appearance toggle */
.appearance-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    left: auto;
    z-index: 100;
}

.appearance-btn {
    background: var(--color-primary);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.appearance-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.appearance-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Header */
header.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background-image: url('../im/imeg/22.jpg');
    background-size: cover;
    background-position: center;
    color: #fff;
    box-shadow: var(--shadow-sm);
}

header.header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    filter: blur(5px);
    z-index: -1;
}

header.header::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 58, 110, 0.641);
    z-index: -1;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem 0;
    min-height: var(--header-h);
    position: relative;
    z-index: 1;
}

.brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
    color: #fff;
    margin-left: 3.5rem;
}

/* Стили для группы логотипа и заголовка */
.brand__group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.brand__logo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .2) inset;
}

.brand__title {
    line-height: 1.2;
    text-align: center;
}

.brand__title h1,
.brand__title p {
    font-weight: 600;
    margin: 0;
}

.brand__title h1 {
    font-size: 1.25rem;
    font-weight: 400;
}

.brand__title p {
    font-size: 1.1rem;
    font-weight: 400;
    opacity: .9;
}

.controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lang-switch {
    display: flex;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 8px;
    overflow: hidden;
}

.lang-btn {
    background: transparent;
    color: #fff;
    border: 0;
    padding: .5rem .7rem;
    cursor: pointer;
    font-weight: 500;
    transition: background .25s ease;
}

.lang-btn.active,
.lang-btn:hover {
    background: rgba(255, 255, 255, .18);
}

.search {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.search input {
    width: 220px;
    max-width: 50vw;
    padding: .55rem .7rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .35);
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.search input::placeholder {
    color: rgba(255, 255, 255, .8);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .65rem 1rem;
    border-radius: 10px;
    border: 0;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: transform .2s ease, background .25s ease, box-shadow .25s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn--danger {
    background: var(--color-secondary);
    color: #fff;
}

.btn--danger:hover {
    filter: brightness(.95);
}

.search__wrapper {
    position: relative;
}

.footer-address {
    font-size: 0.9rem;
    line-height: 1.5;
}

.footer-address p {
    margin: 0.3rem 0;
}

#symbol-modal-image,
#flag-modal-image {
    max-width: 200px;
    height: auto;
    border: 1px solid #ddd;
    padding: 5px;
    border-radius: var(--radius-sm);
}

#anthem-audio {
    width: 100%;
    margin-bottom: 1.5rem;
}


/* Main nav */
nav[aria-label="Главное меню"] {
    background: rgba(0, 0, 0, .12);
    backdrop-filter: blur(8px);
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.main-nav .search {
    margin-left: auto;
}

.menu-toggle {
    display: none;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .35);
    padding: .5rem .75rem;
    border-radius: 8px;
}

#main-menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

#main-menu > li {
    position: relative;
}

#main-menu a {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: .9rem 0.8rem;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 10px;
    transition: background 0.25s ease;
}

#main-menu a:hover {
    background: rgba(255, 255, 255, .14);
}

.has-dropdown:hover > .dropdown {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(9, 47, 85, 0.95);
    min-width: 220px;
    padding: .5rem 0;
    margin: 0;
    list-style: none;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.dropdown li {
    position: relative;
}

.dropdown li a {
    display: block;
    padding: 0.6rem 1rem;
    color: #fff;
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
    font-size: 0.9rem;
    border-radius: 0;
}

.dropdown li a:hover {
    background: rgba(255, 255, 255, .1);
}

/* === СТИЛИ ДЛЯ ВЛОЖЕННОГО МЕНЮ === */
.has-sub-dropdown > a::after {
    content: "▶";
    font-size: 0.7em;
    margin-left: 0.5rem;
    vertical-align: middle;
    display: inline-block;
    transition: transform 0.2s ease;
}

.has-sub-dropdown .dropdown {
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: 1px;
    margin-top: 0;
    display: none;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    background: rgba(9, 47, 85, 0.95);
    min-width: 220px;
    padding: .5rem 0;
    list-style: none;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

.has-sub-dropdown:hover > .dropdown {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Hero Slideshow */
.hero {
    width: 100%;
    height: 320px;
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.slideshow-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    background-size: cover;
    background-position: center;
}

.slide.active {
    opacity: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(25, 66, 133, 0.744);
}

.hero__inner {
    position: relative;
    z-index: 2;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    max-width: var(--container);
    margin: 0 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
}

.hero p[data-key="hero-text"] {
    font-size: clamp(1.3rem, 2.5vw, 1.6rem);
    opacity: .95;
    margin-bottom: 0.8rem;
    line-height: 1.2;
    text-align: justify;
    font-style: italic;
    text-shadow: 0 2px 8px rgba(255, 255, 255, 0.7);
}

.hero__author {
    margin-top: auto;
    text-align: right;
    font-style: italic;
    font-size: 1.4rem;
    align-self: flex-end;
    font-weight: 500;
    text-shadow: 0 2px 8px rgba(255, 255, 255, 0.7);
    margin-bottom: 2.8rem;
}

/* Main Content */
section {
    scroll-margin-top: calc(var(--header-h) + 24px);
}

.section-title {
    color: var(--color-primary);
    font-size: clamp(1.3rem, 2.4vw, 1.8rem);
    margin: 1.5rem 0;
    border-bottom: 3px solid var(--color-secondary);
    padding-bottom: .5rem;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.sidebar {
    width: 300px;
    min-width: 300px;
}

.sidebar .widget {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.1rem;
    min-height: 200px;
}

.widget h4 {
    color: var(--color-primary);
    font-size: 1.1rem;
    margin-bottom: .5rem;
    border-bottom: 2px solid #eee;
    padding-bottom: .4rem;
}

.socials {
    display: flex;
    gap: .6rem;
    margin-top: .5rem;
}

.socials a {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: var(--color-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: transform .2s ease, background .25s ease;
}

.socials a:hover {
    background: var(--color-secondary);
    transform: translateY(-3px);
}

/* Contacts Section */
.contact-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.contact-col {
    flex: 1 1 300px;
    max-width: 400px;
}

.icon-box {
    background: #fff;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: all 0.3s ease-in-out;
    height: 100%;
    border-bottom: 4px solid var(--color-primary);
}

.icon-box:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-secondary);
}

.icon-box .icon {
    margin: 0 auto;
    width: 64px;
    height: 64px;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: background 0.3s ease;
}

.icon-box:hover .icon {
    background: var(--color-secondary);
}

.icon-box .icon i {
    color: #fff;
    font-size: 28px;
}

.icon-box h2 {
    color: var(--color-primary);
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.icon-box p {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.dark-mode .icon-box,
.dark-mode .sidebar .widget {
    background-color: var(--color-primary-2);
}

.dark-mode .icon-box h2,
.dark-mode .news-item h4 {
    color: #fff;
}

.dark-mode .icon-box p {
    color: rgba(255, 255, 255, 0.8);
}

/* Widgets */
.widget-image.prokuror-style {
    background-color: rgba(34, 87, 168, 0.61);
    color: white;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    box-shadow: var(--shadow-sm);
    text-align: center;
    margin-bottom: 1.5rem;
}

.widget-image.prokuror-style h4,
.widget-image.prokuror-style p,
.widget-image.prokuror-style .name {
    color: white;
}

.widget-image.prokuror-style h4 {
    font-size: 1.1rem;
    margin: 0.8rem 0 0.5rem;
    font-weight: 600;
    border: none;
    padding: 0;
}

.widget-image.prokuror-style .gp-image {
    margin-bottom: 1rem;
}

.widget-image.prokuror-style .gp-image img {
    width: 100%;
    max-width: 200px;
    height: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    aspect-ratio: 3/4;
    border-radius: 0;
}

.widget-image.prokuror-style .name {
    font-weight: 700;
    font-size: 1rem;
}

.widget-image.prokuror-style.rounded {
    border-radius: var(--radius-lg);
    overflow: hidden;
    padding: 1rem;
    line-height: 1.2;
}

.widget-image.prokuror-style.rounded h4 {
    margin: 0.3rem 0;
    font-size: 1rem;
}

.widget-image.prokuror-style.rounded .name {
    margin: 0.2rem 0;
    font-size: 0.9rem;
}

.widget-image.prokuror-style.rounded .gp-image img {
    border-radius: var(--radius-sm);
    width: 100%;
    max-width: 250px;
    height: auto;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}


.widget-slider {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.slider-wrapper {
    display: flex;
    transition: transform 0.5s ease-in-out;
    flex-grow: 1;
}

.slider-slide {
    min-width: 100%;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
}

.slider-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.slider-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ccc;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.slider-indicator.active {
    background-color: var(--color-primary);
}

.widgetPresident {
    background: rgba(34, 87, 168, 0.61);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.widgetPresident .head {
    background: #1a3a6eaf;
    color: white;
    padding: 0.75rem 1rem;
    text-align: center;
}

.widgetHead {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

.widgetPresident .body {
    padding: 1rem;
    text-align: center;
}

.widgetPresident .img img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

.widgetPresident .body a {
    color: white;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    text-decoration: none;
}

.widgetPresident .body a:hover {
    text-decoration: underline;
}

.btn-default {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.btn-default:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.d-block {
    display: block;
}

.border {
    border: 1px solid #dee2e6;
}

/* Footer */
footer.footer {
    background: var(--color-primary);
    color: #fff;
    margin-top: 2rem;
    padding: 0.5rem 0;
}

.footer-main-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.footer-center-content {
    flex-grow: 1;
    padding: 0 1.5rem;
}

.footer-grid {
    display: grid;
    /* Меняем 3 на 4 колонки, чтобы статистика влезла красиво */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    align-items: start;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.footer h5 {
    color: var(--color-secondary);
    margin-bottom: .6rem;
    font-size: 1.05rem;
}

.footer a {
    color: rgba(255, 255, 255, .9);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
    color: #fff;
}

.footer-socials {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    justify-content: flex-start;
}

.footer-socials a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease, transform 0.3s ease;
    text-decoration: none;
}

.footer-socials a:hover {
    color: #fff;
    transform: scale(1.1);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, .15);
    padding-top: 1rem;
    color: rgba(255, 255, 255, .8);
    font-size: .92rem;
}

.footer-bottom p {
    margin: 0;
}

address {
    font-style: normal;
}

.developer-info p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.3rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, .9);
}

/* Animations */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(16px);
        transition: opacity .6s ease, transform .6s ease;
    }

    .reveal.is-visible {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utility & Component States */
.toast {
    position: fixed;
    inset-inline: 0;
    bottom: 16px;
    display: grid;
    place-content: center;
    pointer-events: none;
}

.toast__inner {
    background: #111;
    color: #fff;
    border-radius: 999px;
    padding: .5rem .9rem;
    font-size: .95rem;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .3s ease, transform .3s ease;
}

.toast.show .toast__inner {
    opacity: 1;
    transform: translateY(0);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    margin-top: 5px;
    display: none;
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    color: #333;
    text-decoration: none;
    display: block;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: #f5f5f5;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.search-result-text {
    font-size: 0.9rem;
    color: #666;
}

/* Partners Carousel */
.partners-carousel {
    width: 100%;
    overflow: hidden;
    padding: 1rem 0;
    position: relative;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
}

.partners-track {
    display: flex;
    align-items: center;
}

.partners-carousel:hover .partners-track {
    animation-play-state: paused;
}

.partner-item {
    height: 80px;
    width: 180px;
    padding: 0 1rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.partner-item img {
    height: 60px;
    width: auto;
    object-fit: contain;
    transition: all 0.3s ease;
    border-radius: var(--radius-lg);
}

.partner-item a:hover img {
    transform: scale(1.05);
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-180px * 8));
    }
}

/* News Section Styles */
.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.news-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: var(--color-primary);
    color: #fff;
    cursor: pointer;
    aspect-ratio: 4 / 3;
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
        box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.news-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-md);
}

.news-card.hidden {
    display: none;
}

.news-card figure {
    margin: 0;
    line-height: 0;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.news-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.news-card:hover .news-card__image {
    transform: scale(1.1);
}

.news-card__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    text-shadow: 0 1px 5px rgba(39, 39, 39, 0.5);
}

.news-card figure::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(67, 89, 149, 0.377) 10%, rgba(66, 93, 143, 0.612) 50%, transparent 100%);
    z-index: 1;
    transition: background 0.4s ease;
}

.news-card__date {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-secondary);
    margin-bottom: 0.5rem;
    display: block;
}

.news-card__title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    color: #fff;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.news-card:hover .news-card__title {
    transform: translateY(-20px);
}

.news-card__full-content {
    display: none;
}

.news-card__read-more {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    color: #fff;
    font-weight: 600;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
        transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.news-card:hover .news-card__read-more {
    opacity: 1;
    transform: translateY(0);
}

.news-card__read-more::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-secondary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) 0.1s;
}

.news-card:hover .news-card__read-more::after {
    transform: scaleX(1);
}

/* Pagination Styles */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.pagination-indicators {
    display: flex;
    gap: 0.6rem;
}

.pagination-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ccc;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.pagination-indicator:hover {
    background-color: var(--color-primary-2);
    transform: scale(1.1);
}

.pagination-indicator.active {
    background-color: var(--color-primary);
}

.pagination-arrow {
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-text);
    font-size: 1.2rem;
    line-height: 1;
    transition: all 0.3s ease;
}

.pagination-arrow:hover {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.pagination-arrow:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: transparent;
    border-color: #ddd;
}

.dark-mode .pagination-indicator.active {
    background-color: var(--color-secondary);
}

.dark-mode .pagination-indicator:hover {
    background-color: var(--color-accent);
}

.dark-mode .pagination-arrow {
    color: var(--color-text);
    border-color: #555;
}

.dark-mode .pagination-arrow:hover {
    background-color: var(--color-secondary);
    border-color: var(--color-secondary);
    color: #fff;
}

.dark-mode .pagination-arrow:disabled {
    border-color: #444;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background-color: rgba(255, 255, 255, 0.882);
    padding: 2rem;
    border-radius: var(--radius-lg);
    max-width: 800px;
    width: 90%;
    position: relative;
    transform: translateY(-50px);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.dark-mode .modal-content {
    background-color: var(--color-primary-2);
    color: var(--color-text);
}

.modal-close {
    color: #aaa;
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 28px;
    font-weight: bold;
    transition: color 0.2s ease;
    z-index: 50;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--color-secondary);
    text-decoration: none;
    cursor: pointer;
}

#modal-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

#modal-title {
    color: var(--color-primary);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

#modal-date {
    color: var(--color-secondary);
    font-weight: 600;
    margin-bottom: 1rem;
}

#modal-text {
    color: var(--color-text);
    line-height: 1.7;
}

.dark-mode #modal-title {
    color: #fff;
}

.dark-mode #modal-text {
    color: rgba(255, 255, 255, 0.85);
}

#symbol-modal-title {
    text-align: center;
}

.symbol-modal-image-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

#symbol-modal-text h3 {
    text-align: center;
    font-weight: bold;
    margin-top: 1rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    font-size: 1.1em;
}

#symbol-modal-text p {
    text-align: justify;
    margin-bottom: 0.75rem;
}

#symbol-modal-text .signature-block {
    text-align: right;
}

#flag-modal-title {
    text-align: center;
}

#flag-modal-text h3 {
    text-align: center;
    font-weight: bold;
    margin-top: 1rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    font-size: 1.1em;
}

#flag-modal-text p {
    text-align: justify;
    margin-bottom: 0.75rem;
}

#flag-modal-text .signature-block {
    text-align: right;
}

#anthem-modal-title {
    text-align: center;
}

#leadership-modal .modal-content {
    max-width: 1100px;
}

#leadership-grid-container {
   grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
   gap: 1.5rem;
   justify-content: center;
   display: grid;
}

#leadership-grid-container .leader-card:first-child {
    justify-self: center;
    max-width: 450px;
    grid-column: 1 / -1;
}

.leader-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
    padding: 1.5rem 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-bottom: 4px solid var(--color-primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: auto;
}

.leader-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-secondary);
}

.leader-card__image {
    height: 200px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    margin: 0 auto 1rem;
    border: 4px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 200px;
}

.leader-card__name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-primary);
    margin: 0 0 0.3rem 0;
}

.leader-card__title {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
    min-height: 50px;
}

.dark-mode .leader-card {
    color: var(--color-text);
    background-color: var(--color-primary-2);
}
.dark-mode .leader-card__name {
    color: #fff;
}
.dark-mode .leader-card__title {
    color: rgba(255, 255, 255, 0.8);
}


#structure-modal-title {
    text-align: center;
    margin-bottom: 1.5rem;
}

/* === БЛОК ИЗМЕНЕНИЙ ДЛЯ ТАБЛИЦ === */
.static-content #structure-modal-text {
    line-height: 1.7;
    color: #000000;
    padding: 0;
}

#structure-modal-text {
    line-height: 1.7;
    color: #000000;
    padding: 0 1rem;
}

.static-content h3,
#structure-modal-text h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.2em;
    color: #080808;
}

.static-content p,
#structure-modal-text p {
    text-align: justify;
    margin-bottom: 1rem;
    text-indent: 1.5em;
}

.dark-mode .static-content h3,
.dark-mode #structure-modal-text h3 {
    color: #fff;
}

#leadership-modal-title {
    text-align: center;
    margin-bottom: 2rem;
}


.section-heading-table {
    width: 100%;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    background-color: var(--color-primary);
    color: #fff;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-primary-2);
    box-shadow: var(--shadow-sm);
}

.section-heading-table td {
    padding: 0.8rem 1rem;
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
    line-height: 1.5;
}

/* Применяем стили и к модалке, и к странице */
.static-content table,
#structure-modal-text table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    font-size: 0.95rem;
    background-color: rgba(228, 228, 228, 0.88);
    color: #070707;
    border: 1px solid #000000; /* Добавлена внешняя рамка */
}

/* Применяем стили ячеек и к модалке, и к странице */
.static-content th,
.static-content td,
#structure-modal-text th,
#structure-modal-text td {
    border: 1px solid #000000;
    padding: 12px 15px;
    text-align: justify;
    vertical-align: top;
}

/* Скрываем a, и к модалке, и к странице */
.static-content thead,
#structure-modal-text thead {
    display: none;
}

/* Стилизуем первую ячейку (с номером) и к модалке, и к странице */
.static-content td:first-child,
#structure-modal-text td:first-child {
    width: 40px;
    font-weight: bold;
    text-align: center;
    background-color: rgba(228, 228, 228, 0.88);
    vertical-align: middle;
}
/* === КОНЕЦ БЛОКА ИЗМЕНЕНИЙ === */


#history-modal-title {
    text-align: center;
}

#history-modal-text {
    padding: 0 1rem;
}

#history-modal-text h3 {
    text-align: center;
}

#history-modal-text p {
    text-align: justify;
    text-indent: 1.5em;
    margin-bottom: 1rem;
}


#contact-form-modal .modal-content {
    max-width: 700px;
}

#contact-form-modal-title {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--color-primary);
}

.dark-mode #contact-form-modal-title {
    color: #fff;
}

.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feedback-form .form-group {
    display: flex;
    flex-direction: column;
}

.feedback-form label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.feedback-form input[type="text"],
.feedback-form input[type="email"],
.feedback-form input[type="tel"],
.feedback-form textarea {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid #ccc;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.feedback-form input[type="text"]:focus,
.feedback-form input[type="email"]:focus,
.feedback-form input[type="tel"]:focus,
.feedback-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(27, 73, 148, 0.2);
}

.phone-input-wrapper {
    display: flex;
    align-items: center;
}

.phone-input-wrapper span {
    padding: 0.75rem;
    background-color: #e9ecef;
    border: 1px solid #ccc;
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.phone-input-wrapper input {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-grid .form-group:last-child {
    grid-column: 1 / -1;
}

.form-disclaimer {
    font-size: 0.75rem;
    color: #666;
    background-color: #f8f9fa;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid #eee;
    max-height: 100px;
    overflow-y: auto;
}

.dark-mode .form-disclaimer {
    background-color: rgba(0,0,0,0.2);
    border-color: #444;
    color: #ccc;
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: 1.2em;
    height: 1.2em;
}

.g-recaptcha-placeholder {
    border: 1px solid #ccc;
    border-radius: var(--radius-sm);
    padding: 1rem;
    background: #f9f9f9;
    text-align: center;
    color: #555;
}

.submit-btn {
    background-color: #28a745;
    color: white;
    border: none;
    width: 60px;
    height: 45px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transition: background-color 0.3s;
}

.submit-btn:hover {
    background-color: #218838;
}

#citizen-reception-modal .modal-content {
    max-width: 950px;
    width: 95%;
}

.reception-table-main-title {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--color-primary);
    line-height: 1.4;
}

.dark-mode .reception-table-main-title {
    color: #fff;
}

.reception-table-container {
    overflow-x: auto;
    padding-bottom: 10px;
}

.reception-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    min-width: 700px;
}

.reception-table th,
.reception-table td {
    border: 2px solid #9cb2d1;
    padding: 10px 12px;
    text-align: center;
    vertical-align: middle;
}

.reception-table thead {
    background-color: var(--color-primary-2);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}

.reception-table tbody tr:nth-child(odd) {
    background-color: #f8f9fa;
}

.reception-table tbody tr:hover {
    background-color: #e9ecef;
}

.dark-mode .reception-table {
    color: var(--color-text);
}

.dark-mode .reception-table tbody tr:nth-child(odd) {
     background-color: rgba(0, 0, 0, 0.15);
}

.dark-mode .reception-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

.dark-mode .reception-table th,
.dark-mode .reception-table td {
    border-color: #5b7da8;
}

.reception-table td:nth-child(2) {
    text-align: left;
    font-weight: 500;
}


/* Media Queries */
@media (max-width: 900px) {
    .menu-toggle {
        display: inline-flex;
    }

    #main-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        background: var(--color-primary);
        padding: 0.5rem 0;
    }

    #main-menu.open {
        display: flex;
    }

    .has-dropdown:hover > .dropdown,
    .has-sub-dropdown:hover > .dropdown { /* Добавили has-sub-dropdown */
        display: none;
    }

    .has-dropdown.active > .dropdown,
    .has-sub-dropdown.active > .dropdown {
        display: block;
        height: auto;
        overflow: visible;
        position: static;
    }

    .has-dropdown > a::after,
    .has-sub-dropdown > a::after { /* Добавили has-sub-dropdown */
        content: "▼";
        float: right;
        transition: transform 0.3s ease;
    }

    .has-dropdown.active > a::after,
    .has-sub-dropdown.active > a::after { /* Добавили has-sub-dropdown */
        transform: rotate(180deg);
    }

    .dropdown {
        position: static;
        display: none;
        width: 100%;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 0;
        transform: none;
        opacity: 1;
        visibility: visible;
        transition: none;
        padding: 0; /* Убрали padding для мобильных */
        margin: 0; /* Убрали margin для мобильных */
    }

    .dropdown a {
        padding-left: 2rem !important;
    }

    .dropdown .dropdown a {
        padding-left: 3rem !important; /* Увеличили отступ для под-подменю */
    }

    .has-sub-dropdown .dropdown { /* Сброс стилей позиционирования для мобильных */
        margin-top: 0;
        margin-left: 0;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .search input {
        width: 52vw;
    }

    #contacts .contact-content {
        flex-direction: column;
    }

    .hero {
        min-height: 300px;
    }

    .hero p[data-key="hero-text"] {
        font-size: clamp(1.1rem, 2.8vw, 1.3rem);
    }

    .hero__author {
        font-size: 1.2rem;
    }

    .sidebar {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        gap: 1rem;
        padding-bottom: 1rem;
    }

    .container {
        width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .brand {
        width: 100%;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
        margin-left: 0;
        padding: 0 1rem;
    }

    .brand__title {
        flex-grow: 1;
        text-align: center;
    }

    .controls {
        flex-direction: column;
        gap: 0.8rem;
        width: 100%;
        align-items: flex-end;
    }

    .search {
        width: 100%;
        justify-content: center;
    }

    .search input {
        width: 100%;
        max-width: 350px;
    }

    .footer-main-content {
        flex-direction: column;
        gap: 0.5rem;
    }

    .footer-center-content {
        width: 100%;
        padding: 0;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 0.5rem;
        margin-bottom: 0.8rem;
    }

    .footer h5 {
        margin-top: 0.5rem;
        margin-bottom: 0.2rem;
    }

    .footer-address {
        line-height: 1.2;
    }

    .footer-address p {
        margin: 0;
    }

    .footer-socials {
        justify-content: center;
    }

    .developer-info p {
        justify-content: center;
    }

    .partner-item {
        height: 60px;
        width: 160px;
        padding: 0 1rem;
    }

    .appearance-toggle {
        bottom: 15px;
        right: 15px;
    }

    footer.footer {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        margin-top: 1rem;
    }

    .footer-bottom {
        padding-top: 0.8rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* ===============================================
   Исправление для новостей на мобильных (Адаптив)
   =============================================== */

@media (max-width: 768px) {
    /* Изменяем пропорции карточки, делаем её выше */
    .news-card {
        aspect-ratio: 1 / 1; /* Квадратная форма (больше места по вертикали) */
    }

    /* Уменьшаем отступы внутри */
    .news-card__content {
        padding: 1rem;
    }

    /* Уменьшаем размер шрифта заголовка */
    .news-card__title {
        font-size: 1rem; /* Было 1.25rem */
        line-height: 1.3;
        
        /* Ограничиваем текст 4 строками, если он очень длинный */
        display: -webkit-box;
        -webkit-line-clamp: 4;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        
        /* Отключаем сдвиг заголовка на мобильных (так как там нет hover мыши) */
        transform: translateY(0) !important;
    }

    /* Показываем дату всегда на месте */
    .news-card__date {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }

    /* Ссылку "Муфассал" (Read more) делаем видимой сразу, а не при наведении */
    .news-card__read-more {
        position: static; /* Возвращаем в поток документа */
        opacity: 1;
        transform: none;
        margin-top: 0.5rem;
        display: inline-block;
        font-size: 0.9rem;
    }
    
    /* Убираем линию подчеркивания при наведении, оставляем статику */
    .news-card__read-more::after {
        transform: scaleX(1);
        background: var(--color-secondary);
        width: 30px; /* Короткая линия */
    }
    
    /* Отключаем эффекты наведения для самой карточки, чтобы не дергалась при скролле */
    .news-card:hover .news-card__image {
        transform: none;
    }
    .news-card:hover .news-card__title {
        transform: none;
    }
}

/* Document List Styles (Modal) */
.document-modal-text .document-list {
    list-style: none;
    padding-left: 0;
    margin: 1rem 0 0 0;
}

.document-modal-text .document-list li {
    margin-bottom: 0.5rem;
}

.document-modal-text .document-list a {
    display: block;
    padding: 0.75rem 1rem;
    background-color: #f1f5f9;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--color-primary);
    font-weight: 500;
    border-left: 4px solid var(--color-primary-2);
    transition: all 0.2s ease-in-out;
}

.document-modal-text .document-list a:hover {
    background-color: #e2e8f0;
    color: #000;
    border-left-color: var(--color-secondary);
    transform: translateX(5px);
}

.dark-mode .document-modal-text .document-list a {
    background-color: rgba(0, 0, 0, 0.2);
    color: #a7c5ff;
    border-left-color: var(--color-accent);
}

.dark-mode .document-modal-text .document-list a:hover {
    background-color: rgba(0, 0, 0, 0.4);
    color: #fff;
}
/* Modal News Text Styles */
#modal-text p {
    text-align: justify;
    text-indent: 1.5em;
    margin-bottom: 1rem;
}
/* Modal Media Carousel Styles */
.modal-media-carousel {
    position: relative;
    width: 100%;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background-color: #e0e0e0;
}

.modal-media-viewport {
    width: 100%;
    overflow: hidden;
}

.modal-media-track {
    display: flex;
    transition: transform 0.4s ease-in-out;
}

.modal-media-slide {
    flex: 0 0 100%;
    width: 100%;
    aspect-ratio: 16 / 9;
}

/* Обновленный стиль для всех медиа-элементов, включая iframe */
.modal-media-slide img,
.modal-media-slide video,
.modal-media-slide iframe {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover; /* Для iframe это не сработает, но не помешает */
    border: 0;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    z-index: 10;
}

.carousel-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.carousel-btn.prev {
    left: 10px;
}

.carousel-btn.next {
    right: 10px;
}

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.carousel-dot:hover {
    background-color: white;
}

.carousel-dot.active {
    background-color: var(--color-secondary);
}
/* Modal Author Styles */
#modal-author {
    margin-top: 1.5rem;
    text-align: right;
    font-size: 0.9rem;
    font-style: italic;
    color: #555;
    border-top: 1px solid #e0e0e0;
    padding-top: 1rem;
}

.dark-mode #modal-author {
    color: rgba(255, 255, 255, 0.7);
    border-top-color: #444;
}
/* Archive Modal Styles */
.archive-year {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-secondary);
    padding-bottom: 0.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.archive-year:first-child {
    margin-top: 0;
}

.dark-mode .archive-year {
    color: #fff;
}

.archive-list {
    list-style: none;
    padding-left: 0;
}

.archive-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.dark-mode .archive-list li {
    border-bottom-color: #444;
}

.archive-date {
    font-weight: 600;
    color: #555;
    margin-right: 1rem;
}

.dark-mode .archive-date {
    color: rgba(255, 255, 255, 0.7);
}

.archive-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.archive-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    border-left: 4px solid transparent;
}

.archive-item:hover {
    background-color: #f1f5f9;
    border-left-color: var(--color-secondary);
    transform: translateX(5px);
}

.archive-item .archive-title {
    color: var(--color-primary);
    font-weight: 500;
}

.dark-mode .archive-item {
    border-bottom-color: #444;
}

.dark-mode .archive-item:hover {
    background-color: rgba(0, 0, 0, 0.2);
}

.dark-mode .archive-item .archive-title {
    color: #a7c5ff;
}

.archive-year-block {
    margin-bottom: 3rem;
}

.archive-year-block .pagination-controls {
    margin-top: 1.5rem;
}
/* Accessibility Panel Styles */
.accessibility-toggle {
    position: fixed;
    bottom: 90px; /* Чуть выше, чтобы не мешала кнопке "Вверх" или футеру */
    right: 20px;
    z-index: 9999 !important; /* Самый высокий приоритет */
}

.accessibility-btn {
    /* Добавим размер, чтобы пальцем было легче попасть */
    width: 55px;
    height: 55px;
    font-size: 1.4rem;
    /* Остальные стили оставь как были */
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.accessibility-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.accessibility-panel {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    width: 320px;
    max-width: 90vw;
    height: 100%;
    background: #fff;
    color: #333;
    z-index: 1050;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}

.accessibility-panel.show {
    transform: translateX(0);
}

.accessibility-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--color-primary);
    color: #fff;
}

.accessibility-panel__header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.accessibility-panel__close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.accessibility-panel__content {
    padding: 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
}

.acc-group {
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.acc-legend {
    font-weight: 600;
    padding: 0 0.5rem;
    margin-left: 0.5rem;
    font-size: 1rem;
    color: var(--color-primary);
}

.acc-group fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.acc-group.acc-group--toggles {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.acc-btn {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--color-primary-2);
    background: #fff;
    color: var(--color-primary-2);
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.acc-btn:hover {
    background: var(--color-primary-2);
    color: #fff;
}

.acc-btn.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.acc-btn--toggle {
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.acc-btn--toggle .fa {
    width: 20px;
    text-align: center;
}

.acc-btn--reset {
    background: var(--color-secondary);
    color: #fff;
    border-color: var(--color-secondary);
}
.acc-btn--reset:hover {
    background: #c0392b;
    border-color: #c0392b;
}

fieldset.acc-group {
    display: flex;
    gap: 0.5rem;
}
fieldset.acc-group .acc-btn {
    flex: 1;
}

@media (max-width: 768px) {
    .accessibility-toggle {
        bottom: 70px;
        right: 15px;
    }
}

/* Accessibility Feature Styles */
html.font-size-medium {
    font-size: 18px;
}
html.font-size-large {
    font-size: 20px;
}

html.grayscale {
    filter: grayscale(100%);
}

/* * ИСПРАВЛЕНО: Правило для подсветки ссылок
 * Мы делаем их не только подчеркнутыми, но и синими, 
 * и используем [href], чтобы "поймать" все ссылки.
 */
body.highlight-links a[href],
body.highlight-links .btn {
    text-decoration: underline !important;
    font-weight: bold !important;
    color: #0000EE !important; /* Классический синий цвет ссылок */
}
body.highlight-links .btn {
    color: #fff !important; /* Кнопки пусть остаются с белым текстом */
}

/* * ИСПРАВЛЕНО: Правило для отключения изображений
 * Мы используем display: none, чтобы они полностью исчезали.
 */
body.no-images img,
body.no-images .slide,
body.no-images .hero-overlay,
body.no-images .partners-track,
body.no-images .widget-image .gp-image,
body.no-images .news-card figure {
    display: none !important;
}

/* * Исключения: логотипы, иконки и кнопки, 
 * которые мы ХОТИМ оставить видимыми
 */
body.no-images .brand__logo,
body.no-images .fa,
body.no-images .appearance-btn,
body.no-images .accessibility-btn {
    display: block !important; /* или inline-block, в зависимости от элемента */
}
/* Восстанавливаем иконки (т.к. .fa это <i>) */
body.no-images .fa, 
body.no-images .appearance-btn svg {
    display: inline-block !important;
}
body.no-images .fa,
body.no-images .brand__logo,
body.no-images .appearance-btn svg,
body.no-images .accessibility-btn .fa {
    visibility: visible !important;
    height: auto !important;
    width: auto !important;
}

body.contrast-black-on-white,
body.contrast-white-on-black {
    text-shadow: none !important;
    box-shadow: none !important;
    background-image: none !important;
}

body.contrast-black-on-white {
    background-color: #fff !important;
    color: #000 !important;
}
body.contrast-black-on-white .header,
body.contrast-black-on-white .footer,
body.contrast-black-on-white nav[aria-label="Главное меню"],
body.contrast-black-on-white .modal-content,
body.contrast-black-on-white .sidebar .widget,
body.contrast-black-on-white .widgetPresident,
body.contrast-black-on-white .widgetPresident .head,
body.contrast-black-on-white .icon-box,
body.contrast-black-on-white .news-card,
body.contrast-black-on-white .document-modal-text .document-list a {
    background: #fff !important;
    color: #000 !important;
    border: 2px solid #000 !important;
}
body.contrast-black-on-white a,
body.contrast-black-on-white .brand__title,
body.contrast-black-on-white .lang-btn,
body.contrast-black-on-white #main-menu a,
body.contrast-black-on-white .section-title,
body.contrast-black-on-white .icon-box h2,
body.contrast-black-on-white #modal-title,
body.contrast-black-on-white .leader-card__name {
    color: #000 !important;
}
body.contrast-black-on-white .btn,
body.contrast-black-on-white .btn--danger,
body.contrast-black-on-white .icon-box .icon {
    background: #000 !important;
    color: #fff !important;
    border: none !important;
}
body.contrast-black-on-white .brand__logo {
    display: none;
}

body.contrast-white-on-black {
    background-color: #000 !important;
    color: #fff !important;
}
body.contrast-white-on-black .header,
body.contrast-white-on-black .footer,
body.contrast-white-on-black nav[aria-label="Главное меню"],
body.contrast-white-on-black .modal-content,
body.contrast-white-on-black .sidebar .widget,
body.contrast-white-on-black .widgetPresident,
body.contrast-white-on-black .widgetPresident .head,
body.contrast-white-on-black .icon-box,
body.contrast-white-on-black .news-card,
body.contrast-white-on-black .document-modal-text .document-list a {
    background: #000 !important;
    color: #fff !important;
    border: 2px solid #fff !important;
}
body.contrast-white-on-black a,
body.contrast-white-on-black .brand__title,
body.contrast-white-on-black .lang-btn,
body.contrast-white-on-black #main-menu a,
body.contrast-white-on-black .section-title,
body.contrast-white-on-black .icon-box h2,
body.contrast-white-on-black #modal-title,
body.contrast-white-on-black .leader-card__name {
    color: #fff !important;
}
body.contrast-white-on-black a {
    color: #FFFF00 !important;
    text-decoration: underline !important;
}
body.contrast-white-on-black .btn,
body.contrast-white-on-black .btn--danger,
body.contrast-white-on-black .icon-box .icon {
    background: #fff !important;
    color: #000 !important;
    border: none !important;
}
body.contrast-white-on-black .brand__logo {
    display: none;
}
/* Internal Page Styles */
.page-container {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.static-content h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5em;
    color: var(--color-primary);
}

.dark-mode .static-content h3 {
    color: #fff;
}

.static-content p {
    text-align: justify;
    text-indent: 1.5em;
    margin-bottom: 1rem;
    line-height: 1.8;
}

.leadership-page-grid {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
   gap: 1.5rem;
   justify-content: center;
}

.contact-details-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 3rem;
    align-items: center;
}

.contact-details {
    background: #fff;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.dark-mode .contact-details {
    background-color: var(--color-primary-2);
}

.contact-details h3 {
    color: var(--color-primary);
    font-size: 1.5rem;
    margin-top: 0;
}

.dark-mode .contact-details h3 {
    color: #fff;
}

.contact-details .footer-address p {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.contact-details .footer-address i {
    color: var(--color-secondary);
    font-size: 1.4rem;
    width: 25px;
    text-align: center;
}

.contact-map iframe {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
    .contact-details-wrapper {
        grid-template-columns: 1fr;
    }
}

.document-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.document-controls input,
.document-controls select {
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    flex: 1;
    min-width: 200px;
}

.document-table-container {
    overflow-x: auto;
}

.document-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.document-table th,
.document-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.document-table thead {
    background-color: var(--color-primary-2);
    color: white;
}

.document-table tbody tr:hover {
    background-color: #f5f5f5;
}

.dark-mode .document-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.dark-mode .document-table th,
.dark-mode .document-table td {
    border-bottom-color: #444;
}

.btn-download {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: var(--color-secondary);
    color: white !important;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    text-align: center;
}

.loader {
    text-align: center;
    padding: 2rem;
    font-style: italic;
    color: #888;
}

#main-menu a.active-nav-link {
    background: rgba(255, 255, 255, .14);
    color: var(--color-secondary);
}
/* =================================
   Стили для абзацев (Отступы и Выравнивание)
   ================================= */

/* Применяем ко всем текстовым блокам: новости, статика, биографии, модальные окна */
.article-body p,
.static-content p,
#biography-modal-content p,
#modal-text p {
    text-align: justify;       /* <--- ГЛАВНОЕ ИЗМЕНЕНИЕ: Выравнивание по ширине */
    text-justify: inter-word;  /* Улучшает распределение пробелов */
    text-indent: 30px;         /* Ваш отступ красной строки */
    margin-bottom: 10px;       
    line-height: 1.6;          
    
    /* Рекомендую добавить переносы слов, чтобы не было огромных дыр между словами на мобильных */
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto; 
}

/* Сброс для списков и таблиц, чтобы они не ломались */
.article-body ul, .article-body ol, .article-body li,
.static-content ul, .static-content ol, .static-content li,
.static-content table p,
#biography-modal-content ul, #biography-modal-content li {
    text-indent: 0;
    text-align: left; /* Списки лучше оставить по левому краю */
}

/* =================================
   Стили для страницы статьи
   ================================= */

.article-container {
    max-width: 900px;
    margin: 0 auto;
}

.article-title {
    color: var(--color-primary);
    font-size: 1.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.dark-mode .article-title {
    color: #fff;
}

.article-carousel {
    margin-bottom: 2rem;
}

.article-body {
    font-size: 1.1rem;
    line-height: 1.7;
}

/* * Блок метаданных (Дата + Автор)
 * Мы ставим рамку (линию) НАД всем блоком.
 */
.article-metadata {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0; /* <-- Это ЕДИНСТВЕННАЯ линия, НАД датой */
    
    text-align: right; 
    font-size: 1rem;
    color: #555;
}

/* * Стиль для даты.
 * Убираем все лишние отступы и рамки.
 */
.article-date {
    color: var(--color-secondary);
    font-weight: 600;
    margin: 0 0 0.5rem 0; /* <-- Отступ СНИЗУ, чтобы отодвинуть автора */
    padding: 0;
    border: none; 
}

/* * Стиль для автора.
 * Убираем все лишние отступы и рамки.
 */
.article-author {
    margin: 0;
    padding: 0;
    border: none; /* <-- Гарантирует, что МЕЖДУ датой и автором линии нет */
    font-style: italic;
}

/* Стили для темной темы */
.dark-mode .article-metadata {
    color: rgba(255, 255, 255, 0.7);
    border-top-color: #444;
}

/* =================================
   Стили для Аудио в карусели
   ================================= */
.audio-slide-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f0f0f0;
    padding: 1rem;
}

.dark-mode .audio-slide-container {
    background: #2a2a2a;
}

.audio-slide-container .fa-music {
    font-size: 5rem;
    color: var(--color-primary);
    opacity: 0.3;
}

.dark-mode .audio-slide-container .fa-music {
    color: #fff;
}

.audio-slide-container audio {
    width: 100%;
    max-width: 400px;
    margin-top: 2rem;
}
/* =================================
   Стили для Фотогалереи (Grid + Lightbox)
   ================================= */

/* Сетка изображений (только для типа gallery) */
.gallery-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.gallery-grid-item {
    position: relative;
    aspect-ratio: 4/3; /* Квадратные или прямоугольные плитки */
    overflow: hidden;
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-grid-item:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
    z-index: 2;
}

.gallery-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-grid-item:hover img {
    transform: scale(1.1);
}

/* Лайтбокс (Просмотр на весь экран) */
.lightbox {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10001;
}

.lightbox-close:hover {
    color: var(--color-secondary);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: background 0.3s;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* Подписи в лайтбоксе */
.lightbox-caption {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    font-size: 1.1rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* Адаптив для лайтбокса */
@media (max-width: 768px) {
    .gallery-grid-container {
        grid-template-columns: repeat(2, 1fr); /* 2 колонки на мобильных */
    }
    .lightbox-prev, .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 18px;
        background: rgba(0,0,0,0.3);
    }
}

/* Стили для статистики в колонке */
.site-statistics {
        flex-direction: row !important; /* <-- Важно: переключаем на строку */
        flex-wrap: wrap;      /* Разрешаем перенос на новую строку, если не влезут */
        justify-content: center; /* Выравниваем по центру */
        gap: 15px;            /* Отступ между элементами */
        margin-top: 0.5rem;
    }

    /* Гарантируем, что иконка и цифра не разрываются */
    .stat-row {
        display: inline-flex;
        align-items: center;
        white-space: nowrap; 
        background: rgba(255, 255, 255, 0.1); /* (Опционально) легкий фон для красоты */
        padding: 4px 8px;
        border-radius: 4px;
    }

.stat-row i {
    width: 20px; /* Фиксированная ширина иконки для ровности */
    text-align: center;
    color: var(--color-secondary);
}

.stat-row span {
    font-weight: 600;

}


/* =========================================
   МОБИЛЬНАЯ АДАПТАЦИЯ (MOBILE PATCH)
   ========================================= */

/* 1. Исправляем "вылезание" за края экрана */
html, body {
    overflow-x: hidden; /* Запрещаем горизонтальную прокрутку */
    width: 100%;
}

/* 2. Адаптация для телефонов (экраны до 768px) */
@media (max-width: 768px) {

    /* --- ШАПКА (HEADER) --- */
    .header-top {
        flex-direction: column;
        gap: 18px; /* Увеличили отступ между Логотипом и Языками */
        padding-top: 35px; /* ИСПРАВЛЕНИЕ: Опускаем контент вниз от "потолка" */
        padding-bottom: 15px;
    }

    .container {
        width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .brand {
        width: 100%;
        justify-content: center; /* Центрируем весь блок бренда */
        align-items: center;
        gap: 0.5rem;
        margin-left: 0;
        padding: 0 5px;
    }

    .brand__group {
        width: 100%;
        display: flex;
        justify-content: center; /* Центрируем логотипы и текст */
        align-items: center;
        gap: 12px;
    }

    /* Логотипы чуть крупнее, чтобы было солиднее */
    .brand__logo {
        width: 50px; 
        height: 50px;
        flex-shrink: 0;
    }

    /* Увеличиваем шрифты заголовков */
    .brand__title {
        flex-grow: 1;
        text-align: center;
    }

    .brand__title h1 {
        font-size: 15px; /* Чуть больше */
        line-height: 1.2;
        margin-bottom: 4px;
    }
    
    .brand__title p {
        font-size: 13px; /* ИСПРАВЛЕНИЕ: Было 11px, стало 13px (читабельнее) */
        line-height: 1.3;
        opacity: 0.95;
    }

    /* Исправление панели языков */
    .controls {
        flex-direction: row; 
        gap: 10px;
        width: 100%;
        justify-content: flex-end; /* Прижато вправо */
        align-items: center;
        margin-top: 0;
        
        /* ИЗМЕНЕНИЕ: Убрали padding-right и добавили отрицательный margin, 
           чтобы компенсировать отступ контейнера и встать вровень с кнопкой поиска */
        padding-right: 0; 
        margin-right: -6px; 
    }

    /* --- ГЛАВНОЕ МЕНЮ (Исправление) --- */
    .main-nav {
        padding: 10px;
        /* Убедимся, что элементы выстроены в ряд */
        flex-wrap: nowrap; 
        gap: 10px; /* Отступ между кнопкой меню и поиском */
    }

    .menu-toggle {
        width: auto;
        display: inline-flex; /* Гарантируем Flex-контейнер */
        align-items: center;  /* <--- САМОЕ ГЛАВНОЕ: Выравнивает по вертикали (центр) */
        justify-content: center;
        padding: 8px 16px;
        font-size: 16px;
        line-height: 1;       /* Убираем лишние отступы сверху/снизу у шрифта */
        flex-shrink: 0;
        gap: 8px;             /* Красивый отступ между полосками и словом */
    }

    /* Исправляем поиск, чтобы он занимал оставшееся место */
    .search {
        width: 100%;
        justify-content: center;
    }

    .search__wrapper {
        width: 100%;       /* Обертка поля ввода на всю доступную ширину */
    }

    .search input {
        width: 100%;       /* Поле ввода тянется */
        max-width: none;   /* Убираем ограничение */
        min-width: 100px;  /* Минимальная ширина, чтобы было удобно писать */
    }

    /* --- СЛАЙДЕР (HERO) --- */
    .hero {
        height: auto; /* Высота авто */
        min-height: 280px; /* Минимальная высота */
    }
    .hero__inner {
        padding: 15px;
        justify-content: flex-end; /* Текст снизу */
    }
    .hero p[data-key="hero-text"] {
        font-size: 14px;
        line-height: 1.5;
        
        /* Убираем "обводку" (фон) */
        background: transparent; 
        padding: 0;
        border-radius: 0;
        
        /* Добавляем тень буквам, чтобы они читались на светлом фоне */
        text-shadow: 1px 1px 3px #000000; 
    }
    .hero__author {
        font-size: 14px;
        margin-bottom: 10px;
    }

    /* --- КОНТЕНТ И БОКОВАЯ ПАНЕЛЬ --- */
    .content-grid {
        display: flex;
        flex-direction: column; /* Колонка, а не ряд */
        gap: 20px;
    }

    .sidebar {
        width: 100% !important; /* Боковая панель на всю ширину */
        min-width: 0 !important;
        margin: 0;
        padding: 0;
    }

    .widget {
        width: 100%;
        box-sizing: border-box;
    }

    /* --- НОВОСТИ (Сетка 2 колонки) --- */
    .news-grid {
        /* ИЗМЕНЕНО: Включаем 2 колонки */
        grid-template-columns: repeat(2, 1fr); 
        gap: 10px; /* Уменьшаем отступ между карточками, чтобы они влезли */
    }

    .news-card {
        /* Возвращаем пропорции (или делаем чуть выше), чтобы карточки были одинаковыми */
        aspect-ratio: auto;
        height: auto;
        min-height: auto; /* Убираем фиксированную минимальную высоту */
    }

    .news-card__content {
        padding: 0.5rem; /* Было 0.8rem, делаем компактнее */
    }

    .news-card__title {
        font-size: 12px; /* Было 14px, уменьшаем для компактности */
        margin-bottom: 3px;
        -webkit-line-clamp: 3; /* Ограничиваем 3 строками, чтобы не вылезало */
    }
    
    .news-card__date {
        font-size: 0.7rem; /* Дата еще мельче */
    }

    .news-card__read-more {
        font-size: 0.8rem;
        margin-top: auto; /* Прижимаем кнопку к низу */
    }
}
/* --- ПОИСК (Результаты) --- */
/* =========================================
   ИСПРАВЛЕНИЕ: СТИЛИ ПОИСКА ДЛЯ МОБИЛЬНЫХ
   ========================================= */

@media (max-width: 768px) {
    
    /* --- ПОИСК (Результаты) --- */
    /* Делаем широким ТОЛЬКО на телефонах */
    .search-results {
        width: 60vw;          /* Почти на всю ширину экрана */
        left: 50%;
        transform: translateX(-50%); /* Центрируем */
    }

    .search-result-item {
        padding: 15px;        /* Больше места для нажатия */
        font-size: 16px;      /* Крупный текст */
    }

    .search-result-title {
        font-size: 18px;      /* Заголовки еще крупнее */
        margin-bottom: 5px;
    }

    /* --- ТАБЛИЦЫ (Книги и Документы) --- */
    .document-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 20px;
    }

    .document-table th, 
    .document-table td {
        min-width: 120px;
        padding: 12px;
        font-size: 14px;
    }

    /* Кнопка скачивания покрупнее */
    .btn-download {
        padding: 10px 20px;
        font-size: 14px;
    }
}