:root {
    --primary: #064e3b;
    --primary-light: #059669;
    --accent: #34d399;
    --bg: #f3f8f6;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; display: flex; flex-direction: column; min-height: 100vh; }

/* Шапка и меню */
header { background: var(--primary); color: #fff; padding: 1rem 0; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 10px rgba(6, 78, 59, 0.15); }
.container { max-width: 1050px; margin: 0 auto; padding: 0 20px; width: 100%; }
.nav-wrap { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 15px; }
nav { display: flex; gap: 8px; flex-wrap: wrap; }
nav a { text-decoration: none; color: #d1fae5; padding: 8px 14px; border-radius: 6px; font-size: 0.95rem; font-weight: 500; transition: 0.2s; }
nav a:hover, nav a.active { background: rgba(255,255,255,0.15); color: #fff; }
nav a.active { border-bottom: 2px solid var(--accent); }

/* Цельные блоки (секции) */
main { flex: 1; padding: 35px 0; }
.section-box { background: var(--card); padding: 32px; border-radius: 12px; box-shadow: 0 2px 8px rgba(6, 78, 59, 0.05); margin-bottom: 28px; }

.hero { display: grid; grid-template-columns: 240px 1fr; gap: 30px; align-items: center; }
.hero img { width: 100%; height: 260px; object-fit: cover; border-radius: 10px; background: #e2e8f0; border: 3px solid var(--primary-light); }

h1 { font-size: 1.8rem; color: var(--primary); margin-bottom: 10px; }
h2 { font-size: 1.35rem; color: var(--primary); margin-bottom: 22px; padding-bottom: 10px; border-bottom: 2px solid #ecfdf5; }
h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--primary); }
p { margin-bottom: 12px; }

/* Колонки без внутренних рамок (только тонкий разделитель) */
.columns-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.col-item { position: relative; }
.col-item:not(:last-child) { border-right: 1px solid var(--border); padding-right: 24px; }
.step-tag { display: inline-block; font-size: 0.8rem; font-weight: 700; color: var(--primary-light); background: #ecfdf5; padding: 2px 10px; border-radius: 20px; margin-bottom: 10px; }

/* Список-путеводитель внутри цельного блока */
.guide-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.guide-row:first-child { padding-top: 0; }
.guide-row:last-child { border-bottom: none; padding-bottom: 0; }
.guide-info p { margin-bottom: 0; color: var(--muted); font-size: 0.95rem; }

/* Сетка карточек для других страниц (Методичка и т.д.) */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-bottom: 25px; }
.card { background: var(--card); padding: 22px; border-radius: 10px; box-shadow: 0 2px 5px rgba(6, 78, 59, 0.05); border-top: 3px solid var(--primary-light); }

/* Кнопки */
.btn { display: inline-block; background: var(--primary); color: #fff; text-decoration: none; padding: 9px 18px; border-radius: 6px; font-size: 0.9rem; font-weight: 500; transition: 0.2s; white-space: nowrap; }
.btn:hover { background: var(--primary-light); }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

/* Новости, списки, галерея */
.news-item { background: var(--card); padding: 22px; border-radius: 10px; margin-bottom: 15px; box-shadow: 0 2px 4px rgba(6, 78, 59, 0.04); }
.news-date { font-size: 0.85rem; color: var(--primary-light); font-weight: 600; margin-bottom: 5px; }
ul.clean-list { margin-left: 20px; margin-bottom: 15px; }
ul.clean-list li { margin-bottom: 8px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.cert-box { background: var(--card); padding: 10px; border-radius: 8px; text-align: center; box-shadow: 0 2px 4px rgba(6, 78, 59, 0.05); }
.cert-box img { width: 100%; height: 220px; object-fit: cover; border-radius: 4px; background: #e2e8f0; }

/* Подвал */
footer { background: #042f2e; color: #a7f3d0; text-align: center; padding: 25px 20px; margin-top: auto; font-size: 0.9rem; }
/* Раскрывающиеся новости */
details.news-details { padding: 18px 0; border-bottom: 1px solid var(--border); }
details.news-details:first-child { padding-top: 0; }
details.news-details:last-child { border-bottom: none; padding-bottom: 0; }
details.news-details summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
details.news-details summary::-webkit-details-marker { display: none; }
details.news-details summary:hover h3 { color: var(--primary-light); }
.news-toggle-btn { font-size: 0.88rem; font-weight: 600; color: var(--primary); border: 1px solid var(--primary); padding: 7px 14px; border-radius: 6px; white-space: nowrap; transition: 0.2s; }
details.news-details summary:hover .news-toggle-btn { background: var(--primary); color: #fff; }
details.news-details[open] .news-toggle-btn { background: #ecfdf5; border-color: var(--primary-light); color: var(--primary); }
.news-full { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--border); color: var(--text); }
.news-full p:last-child { margin-bottom: 0; }

@media(max-width: 768px) {
    details.news-details summary { flex-direction: column; align-items: flex-start; }
}

@media(max-width: 768px) {
    .hero { grid-template-columns: 1fr; text-align: center; }
    .hero img { max-width: 220px; margin: 0 auto; }
    .columns-3 { grid-template-columns: 1fr; gap: 20px; }
    .col-item:not(:last-child) { border-right: none; border-bottom: 1px solid var(--border); padding-right: 0; padding-bottom: 20px; }
    .guide-row { flex-direction: column; align-items: flex-start; }
}
/* === ВЕРСИЯ ДЛЯ СЛАБОВИДЯЩИХ (ОВЗ) === */
.btn-a11y {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 7px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    transition: 0.2s;
}
.btn-a11y:hover {
    background: #fff;
    color: var(--primary);
}

/* Панель управления настройками для слабовидящих */
.a11y-panel {
    display: none;
    background: #f3f4f6;
    color: #000;
    border-bottom: 2px solid #000;
    padding: 12px 0;
    font-size: 16px !important;
}
body.a11y-active .a11y-panel {
    display: block;
}
.a11y-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}
.a11y-group {
    display: flex;
    align-items: center;
    gap: 6px;
}
.a11y-group button {
    padding: 5px 10px;
    border: 1px solid #000;
    background: #fff;
    color: #000;
    font-weight: 700;
    cursor: pointer;
    border-radius: 4px;
    font-size: 15px !important;
}
.a11y-group button.active-opt {
    background: #000;
    color: #fff;
}

/* Размеры шрифта */
body.a11y-font-md { font-size: 19px !important; line-height: 1.7 !important; }
body.a11y-font-lg { font-size: 22px !important; line-height: 1.8 !important; }
body.a11y-font-md h1, body.a11y-font-lg h1 { font-size: 2.1em !important; }
body.a11y-font-md h2, body.a11y-font-lg h2 { font-size: 1.5em !important; }

/* Отключение изображений */
body.a11y-no-img img { display: none !important; }

/* Цветовая схема 1: Черным по белому (высокий контраст) */
body.a11y-theme-white,
body.a11y-theme-white .section-box,
body.a11y-theme-white .card,
body.a11y-theme-white .news-item,
body.a11y-theme-white .cert-box,
body.a11y-theme-white .tag {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    box-shadow: none !important;
}
body.a11y-theme-white header,
body.a11y-theme-white footer {
    background: #000000 !important;
    color: #ffffff !important;
}
body.a11y-theme-white h1, body.a11y-theme-white h2, body.a11y-theme-white h3,
body.a11y-theme-white p, body.a11y-theme-white li, body.a11y-theme-white a,
body.a11y-theme-white span, body.a11y-theme-white strong {
    color: #000000 !important;
}
body.a11y-theme-white header a, body.a11y-theme-white footer p {
    color: #ffffff !important;
}
body.a11y-theme-white .btn, body.a11y-theme-white .btn-outline {
    background: #000000 !important;
    color: #ffffff !important;
    border: 2px solid #000000 !important;
}

/* Цветовая схема 2: Белым по черному (инверсия) */
body.a11y-theme-black,
body.a11y-theme-black .section-box,
body.a11y-theme-black .card,
body.a11y-theme-black .news-item,
body.a11y-theme-black .cert-box,
body.a11y-theme-black .tag,
body.a11y-theme-black header,
body.a11y-theme-black footer {
    background: #000000 !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
    box-shadow: none !important;
}
body.a11y-theme-black h1, body.a11y-theme-black h2, body.a11y-theme-black h3,
body.a11y-theme-black p, body.a11y-theme-black li, body.a11y-theme-black a,
body.a11y-theme-black span, body.a11y-theme-black strong {
    color: #ffffff !important;
}
body.a11y-theme-black .btn, body.a11y-theme-black .btn-outline {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #ffffff !important;
}

/* Цветовая схема 3: Темно-синим по голубому */
body.a11y-theme-blue,
body.a11y-theme-blue .section-box,
body.a11y-theme-blue .card,
body.a11y-theme-blue .news-item,
body.a11y-theme-blue .cert-box,
body.a11y-theme-blue .tag,
body.a11y-theme-blue header,
body.a11y-theme-blue footer {
    background: #9dd1ff !important;
    color: #063462 !important;
    border: 2px solid #063462 !important;
    box-shadow: none !important;
}
body.a11y-theme-blue h1, body.a11y-theme-blue h2, body.a11y-theme-blue h3,
body.a11y-theme-blue p, body.a11y-theme-blue li, body.a11y-theme-blue a,
body.a11y-theme-blue span, body.a11y-theme-blue strong {
    color: #063462 !important;
}
body.a11y-theme-blue .btn, body.a11y-theme-blue .btn-outline {
    background: #063462 !important;
    color: #9dd1ff !important;
    border: 2px solid #063462 !important;
}
