/* ===== ГЛОБАЛЬНЫЕ СТИЛИ ===== */
@import url('https://fonts.googleapis.com/css2?family=Geologica:wght,CRSV@100..900,0&display=swap');

:root {
    --primary: #3A4A5A;
    --primary-hover: #2F3C4A;
    --primary-active: #242F3A;
    --primary-rgb: 58, 74, 90;

    --body-bg: #F4F6F9;
    --card-bg: #FBFCFE;
    --header-bg: var(--primary);

    --text-primary: #25323E;
    --text-on-primary: #F4F6F9;
    --text-primary-rgb: 37, 50, 62;

    --accent: #C54C5E;
    --accent-hover: #AD3E4F;
    --accent-active: #943040;

    --green-accent: #6B8E6B;
    --green-accent-hover: #7A9A7A;

    --border-color: #D1D5DB;

    --shadow-color: rgba(58, 74, 90, 0.15);
    --shadow: 0 2px 10px var(--shadow-color);
    --shadow-hover: 0 8px 25px rgba(58, 74, 90, 0.2);

    --overlay-color: rgba(37, 50, 62, 0.8);

    --radius: 6px;
    --transition: 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "Geologica", sans-serif;
    font-weight: 300;
    color: var(--text-primary);
    background: var(--body-bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

a { text-decoration: none; color: inherit; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Шапка ── */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

.header-utility {
    background: var(--primary);
    color: var(--text-on-primary);
    font-size: 0.8rem;
}

.header-utility-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 38px;
    padding-top: 4px;
    padding-bottom: 4px;
}

.header-utility-label {
    opacity: 0.92;
    line-height: 1.3;
}

.header-utility-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-main {
    padding: 18px 0;
}

.header-main-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-icon img {
    width: 56px;
    height: 56px;
    display: block;
}

.site-title {
    font-size: clamp(1.15rem, 2.2vw, 1.55rem);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.header-contacts {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: var(--body-bg);
    border: 1px solid var(--border-color);
    border-radius: 999px;
}

.header-contacts a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    opacity: 0.85;
    transition: background 0.2s, opacity 0.2s;
}

.header-contacts a:hover {
    opacity: 1;
    background: var(--card-bg);
}

.header-contacts a img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.search-form {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    overflow: hidden;
    background: var(--body-bg);
    width: min(300px, 34vw);
    min-width: 200px;
}

.search-form input {
    border: none;
    padding: 10px 14px;
    outline: none;
    font-size: 0.9rem;
    font-family: inherit;
    width: 100%;
    background: transparent;
    color: var(--text-primary);
}

.search-form button {
    background: var(--primary);
    border: none;
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.search-form button:hover {
    background: var(--primary-hover);
}

.search-form button img {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
}

/* ── Навигационная панель ── */
.header-nav {
    background: var(--header-bg);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.header-nav-inner {
    display: flex;
    align-items: stretch;
    position: relative;
}

.burger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px 12px;
    align-self: center;
}

.burger img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

.nav-links {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
}

.nav-links a {
    color: var(--text-on-primary);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    font-weight: 500;
    font-size: 0.92rem;
    transition: var(--transition);
    white-space: nowrap;
    line-height: 1.3;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.12);
}

.nav-links a.active {
    background: var(--primary-active);
    color: var(--text-on-primary);
    box-shadow: inset 0 -3px 0 var(--green-accent);
}

.dropdown-menu a.active {
    background: var(--primary-active);
    color: var(--text-on-primary);
}

.dropdown {
    position: relative;
    flex-shrink: 0;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dropdown-toggle.active {
    background: var(--primary-active);
    box-shadow: inset 0 -3px 0 var(--green-accent);
}

.dropdown-arrow {
    width: 12px;
    height: 12px;
    margin-left: 2px;
    transition: transform 0.3s;
    filter: brightness(0) invert(1);
}

.dropdown:hover .dropdown-arrow,
.dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--header-bg);
    min-width: 240px;
    box-shadow: var(--shadow);
    border-radius: 0 0 var(--radius) var(--radius);
    z-index: 1001;
    overflow: hidden;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    color: var(--text-on-primary) !important;
    padding: 12px 18px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    white-space: nowrap !important;
    font-size: 0.9rem !important;
    box-shadow: none !important;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background: var(--primary-hover);
}

/* Совместимость со старой разметкой */
.header-top { background: var(--card-bg); }
.header-right { display: flex; align-items: center; gap: 14px; }

/* ── Общие секции ── */
.section {
    padding: 40px 0;
}
.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--green-accent);
    border-radius: 2px;
}
.page-description {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 30px;
    line-height: 1.7;
    max-width: 800px;
}

/* --- Слайдер (главная, о проекте) --- */
.slider-section {
    padding-bottom: 0;
}

.slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--body-bg);
}

.slider-track {
    display: flex;
    transition: transform 0.5s ease;
    will-change: transform;
}

.slider-slide-wrapper {
    position: relative;
    flex: 0 0 auto;
    height: 400px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--body-bg);
}

.slider-image-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(15px) brightness(0.85);
    transform: scale(1.1);
    z-index: 1;
}

.slider-image-main {
    position: relative;
    z-index: 2;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.slider-caption {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(var(--text-primary-rgb, 58, 74, 90), 0.75);
    color: var(--text-on-primary);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    z-index: 3;
    max-width: 90%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

.slider-btn:hover { background: var(--primary-hover); }
.slider-btn.prev { left: 15px; }
.slider-btn.next { right: 15px; }

.slider-btn img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

.slider-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--card-bg);
    cursor: pointer;
    transition: background 0.3s;
}

.slider-dot.active { background: var(--text-on-primary); }

@media (max-width: 600px) {
    .slider-slide-wrapper {
        height: 250px;
    }
}

/* Двухколоночная сетка для списков контента (мероприятия, образование) */
.content-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Изображение с размытым фоном (квадратное) ── */
.card-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%; /* квадрат */
    overflow: hidden;
    border-radius: var(--radius);
    margin: 10px 0;
    background: var(--body-bg);
}
.card-image-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(15px) brightness(0.7);
    transform: scale(1.1);
    z-index: 1;
}
.card-image-main {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
}
.card-image-caption {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(var(--primary-rgb), 0.8);
    color: var(--text-on-primary);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    z-index: 3;
    max-width: 90%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

/* ── Базовые карточки ── */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 25px;
    position: relative;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}
.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-date {
    display: inline-block;
    align-self: flex-start;
    border: 1px solid var(--primary);
    border-radius: 25px;
    padding: 2px 8px;
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 15px;
    width: fit-content;
}
.card-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary);
    flex-grow: 1;
    margin-bottom: 15px;
}

/* Кнопки админ-панели */
.admin-edit-btn,
.admin-delete-btn,
.hide-btn,
.restore-btn {
    position: absolute;
    top: 15px;
    background: var(--card-bg);
    border: 1px solid var(--primary);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    color: var(--primary);
    transition: var(--transition);
    z-index: 6;
}
.admin-edit-btn { right: 60px; }
.admin-delete-btn {
    right: 15px;
    border-color: var(--accent);
    color: var(--accent);
}
.hide-btn,
.restore-btn { right: 105px; }

.admin-delete-btn:hover { background: var(--accent); color: var(--text-on-primary); }
.hide-btn:hover,
.admin-edit-btn:hover,
.restore-btn:hover { background: var(--primary); color: var(--text-on-primary); }

.admin-edit-btn:hover img,
.hide-btn:hover img,
.restore-btn:hover img {
    filter: brightness(0) invert(1);
}

body.admin-mode .admin-edit-btn,
body.admin-mode .admin-delete-btn,
body.admin-mode .hide-btn,
body.admin-mode .restore-btn {
    display: flex;
}

/* Общая кнопка-ссылка */
.btn-link {
    display: inline-block;
    background: var(--accent);
    color: var(--text-on-primary);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    align-self: flex-start;
}
.btn-link:hover {
    background: var(--accent-hover);
}

.read-more-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    align-self: flex-start;
    padding: 0;
    margin-bottom: 10px;
    transition: opacity var(--transition);
}
.read-more-btn:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ── Подвал ── */
.footer {
    background: var(--header-bg);
    color: var(--text-on-primary);
    padding: 30px 0 20px;
    margin-top: 40px;
}
.footer-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}
.footer-left {
    flex: 1 1 300px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.footer-logo-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.footer-logo-title img { width: 60px; height: 60px; background-color: var(--body-bg); border-radius: 50%; padding: 3px;}
.footer-logo-title h4 {
    margin: 0;
    color: var(--text-on-primary);
    font-size: 1.1rem;
    opacity: 0.9;
}
.footer-description {
    color: var(--text-on-primary);
    opacity: 0.85;
    line-height: 1.5;
    margin: 0;
}
.footer-contacts-icons {
    display: flex;
    gap: 16px;
    margin-top: 5px;
}
.footer-contacts-icons a {
    opacity: 0.7;
    transition: opacity 0.3s;
}
.footer-contacts-icons a:hover { opacity: 1; }
.footer-contacts-icons img {
    width: 26px;
    height: 26px;
    filter: brightness(0) invert(1);
}
.footer-nav {
    flex: 1 1 300px;
    display: flex;
    gap: 30px;
}
.footer-nav-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.footer-nav-col a {
    color: var(--text-on-primary);
    opacity: 0.85;
    transition: var(--transition);
    font-size: 0.9rem;
    white-space: nowrap;
}
.footer-nav-col a:hover {
    opacity: 1;
    text-decoration: underline;
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.85rem;
}
.admin-link {
    color: var(--text-on-primary);
    opacity: 0.6;
    font-size: 0.75rem;
    transition: var(--transition);
}
.admin-link:hover {
    opacity: 1;
    color: var(--accent);
}

/* ── Пагинация ── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap;
}
.page-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s, color 0.3s;
    color: var(--text-primary);
    font-family: inherit;
}
.page-btn:hover {
    background: var(--green-accent);
    color: var(--text-on-primary);
}
.page-btn.active {
    background: var(--green-accent);
    color: var(--text-on-primary);
    border-color: var(--green-accent);
    font-weight: 600;
}

/* Кнопки сортировки */
.sort-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.sort-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: background 0.3s, color 0.3s;
}
.sort-btn.active {
    background: var(--green-accent);
    color: var(--text-on-primary);
    border-color: var(--green-accent);
}
.sort-btn:hover:not(.active) {
    background: var(--body-bg);
}

/* ========== СКРЫТЫЕ КАРТОЧКИ ========== */
.card-hidden {
    position: relative;
    overflow: hidden;
}

.card-hidden-overlay {
    position: absolute;
    inset: 0;
    background: rgba(251, 252, 254, 0.75);
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-hidden .card-hidden-overlay {
    opacity: 1;
    z-index: 5;
}

/* ── Модальное окно редакторов ── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--overlay-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.modal-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: var(--shadow-hover);
}
.modal-close {
    position: absolute;
    top: 10px; right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
}
.modal-close img {
    width: 16px;
    height: 16px;
}

/* Список редакторов */
.editors-list {
    margin-bottom: 25px;
}
.editor-card {
    background: var(--body-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.editor-info {
    display: flex;
    align-items: center;
    gap: 20px;
}
.editor-username {
    font-weight: 600;
    min-width: 120px;
}
.editor-password {
    display: flex;
    align-items: center;
    gap: 5px;
}
.password-field {
    width: 120px;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--card-bg);
    font-family: monospace;
    letter-spacing: 2px;
}
.toggle-pwd-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
}
.toggle-pwd-btn img {
    width: 20px;
    height: 20px;
    vertical-align: middle;
}
.editor-actions {
    display: flex;
    gap: 8px;
}
.change-pwd-btn,
.delete-editor-btn {
    padding: 5px 12px;
    border: 1px solid var(--primary);
    background: var(--card-bg);
    color: var(--text-primary);
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.3s, color 0.3s;
}
.delete-editor-btn {
    border-color: var(--accent);
    color: var(--accent);
}
.change-pwd-btn:hover {
    background: var(--primary);
    color: var(--text-on-primary);
}
.delete-editor-btn:hover {
    background: var(--accent);
    color: var(--text-on-primary);
}
.admin-edit-btn img,
.admin-delete-btn img,
.hide-btn img,
.restore-btn img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.admin-delete-btn img {filter: hue-rotate(136deg) saturate(2.4) brightness(1.86);}

.admin-delete-btn:hover {
    background: var(--accent);
    color: var(--text-on-primary);
}
.admin-delete-btn:hover img {
    filter: brightness(0) invert(1);
}

/* Форма добавления */
.add-editor-form {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.add-editor-form h3 {
    width: 100%;
    margin-bottom: 10px;
}
.add-editor-form input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    background: var(--body-bg);
}
.add-editor-form button {
    background: var(--primary);
    color: var(--text-on-primary);
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: background 0.3s;
}
.add-editor-form button:hover {
    background: var(--primary-hover);
}

/* ── Адаптивность ── */
@media (max-width: 768px) {
    .burger { display: block; }
    .header-nav-inner { flex-wrap: wrap; }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--header-bg);
        flex-direction: column;
        z-index: 50;
        padding: 8px 0 12px;
        box-shadow: var(--shadow);
        width: auto;
        flex-wrap: nowrap;
        overflow-x: visible;
    }
    .nav-links.active { display: flex; }
    .nav-links a,
    .nav-links .dropdown-toggle {
        padding: 12px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        width: 100%;
        white-space: nowrap;
        box-shadow: none !important;
    }
    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.08);
        border-radius: 0;
        min-width: 0;
    }
    .dropdown.active .dropdown-menu { display: block; }
    .dropdown:hover .dropdown-menu { display: none; }
    .dropdown.active:hover .dropdown-menu { display: block; }
    .footer-grid {
        gap: 10px;
    }
    .footer-nav { flex-direction: column; gap: 20px; }
}

@media (max-width: 900px) {
    .header-utility-label {
        font-size: 0.72rem;
    }

    .header-main-inner {
        flex-wrap: wrap;
    }

    .header-tools {
        width: 100%;
        justify-content: space-between;
    }

    .search-form {
        flex: 1;
        width: auto;
        min-width: 0;
    }
}

@media (max-width: 600px) {
    .header-main {
        padding: 14px 0;
    }

    .header-main-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .logo-area {
        justify-content: center;
        text-align: center;
    }

    .header-tools {
        flex-direction: column;
        align-items: stretch;
    }

    .header-contacts {
        justify-content: center;
    }

    .search-form {
        width: 100%;
    }

    .section-title { font-size: 1.5rem; }
}

/* ========== ОВЕРЛЕЙ ДЛЯ ВСЕХ МОДАЛЬНЫХ ОКОН ========== */
.modal-overlay,
.admin-confirm-overlay,
#contentModal.active {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

/* Свёрнутое окно контента – без затемнения */
#contentModal.minimized {
    position: fixed;
    bottom: 20px;
    right: 20px;
    top: auto;
    left: auto;
    width: auto;
    height: auto;
    background: none;
    z-index: 3000;
    display: block;  /* показываем свёрнутое */
}

/* Чтобы взаимодействовать со свёрнутым окном */
#contentModal.minimized .modal-inner {
    pointer-events: auto;
    box-shadow: var(--shadow-hover);
}

/* ===== ОВЕРЛЕЙ (ЗАТЕМНЕНИЕ) ДЛЯ ВСЕХ МОДАЛЬНЫХ ОКОН ===== */
.modal-overlay,
.admin-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-color);
    display: flex;          /* ← ОБЯЗАТЕЛЬНО */
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

/* Чтобы контент внутри оверлея не растягивался */
.modal-content,
.admin-confirm-dialog {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Кнопка закрытия */
.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.5rem;
    z-index: 10;
}
.modal-close img {
    width: 20px;
    height: 20px;
    display: block;
}



/* Файлы в карточках */
.card-files {
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-primary);
    text-decoration: none;
    border: 1px solid var(--border-color);
    transition: background 0.3s;
}

.btn-file {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-on-primary);
    transition: var(--transition);
    white-space: nowrap;
}

.btn-file-download {
    background: var(--primary);
}

.btn-file-download:hover {
    background: var(--primary-hover);
}

/* Миниатюра файла-изображения */
.card-file-image-wrapper {
    position: relative;
    display: block;
    line-height: 0;
}

.file-thumbnail {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 300px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    object-fit: cover;
}