/*
Theme Name: Chebpt_theme
Theme URI: https://chebpt.ru
Author: IT Life
Author URI: https://it-life74.ru
Description: Тема для сайта ГБПОУ «Чебаркульский профессиональный техникум». Журнальный стиль. Соответствует ФЗ-273 ст.29, Приказу Рособрнадзора №1493.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: chpt-magazine
Tags: education, magazine, responsive-layout, custom-menu, custom-logo, featured-images
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
*/

/* ===== LAYOUT 7: Журнальный медийный ===== */

/* --- Сброс --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
    color: #212121;
    background: #fafafa;
    line-height: 1.65;
}

a {
    color: #c62828;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #b71c1c;
    text-decoration: underline;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- WordPress Admin Bar Support --- */
body.admin-bar .main-nav {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .main-nav {
        top: 46px;
    }
}

/* --- Шапка --- */
.header {
    position: relative;
}

.header-bg {
    background: linear-gradient(135deg, #212121 0%, #424242 40%, #c62828 100%);
    padding: 40px 0 50px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 40px,
        rgba(255,255,255,0.02) 40px,
        rgba(255,255,255,0.02) 80px
    );
}

.header-content {
    position: relative;
    z-index: 1;
}

.header-logo {
    margin-bottom: 16px;
}

.header-logo img,
.header-logo .custom-logo {
    max-width: 70px;
    max-height: 70px;
    border-radius: 50%;
}

.header-title {
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.header-title a {
    color: #fff;
    text-decoration: none;
}

.header-title a:hover {
    text-decoration: none;
    color: #fff;
}

.header-tagline {
    color: rgba(255,255,255,0.75);
    font-size: 1rem;
    font-weight: 300;
    margin-bottom: 16px;
}

.header-meta {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    color: rgba(255,255,255,0.65);
    font-size: 0.85rem;
}

/* --- Навигация --- */
.main-nav {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.nav-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    flex: 1;
}

.nav-list > li {
    position: relative;
}

.nav-list > li > a {
    display: block;
    padding: 14px 14px;
    color: #212121;
    font-size: 0.85rem;
    font-weight: 600;
    transition: color 0.2s, background 0.2s;
}

.nav-list > li > a:hover,
.nav-list > li:hover > a {
    color: #c62828;
    background: #fce4ec;
    text-decoration: none;
}

.nav-list > li.current-menu-item > a,
.nav-list > li.current-menu-ancestor > a,
.nav-list > li.current_page_item > a {
    color: #c62828;
    background: #fce4ec;
}

/* Dropdown */
.dropdown,
.nav-list > li > .sub-menu {
    list-style: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 280px;
    max-width: 360px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border-top: 3px solid #c62828;
    border-radius: 0 0 6px 6px;
    display: none;
    z-index: 9999;
}

/* Выравнивание вправо для последних пунктов меню */
.nav-list > li:nth-last-child(-n+3) > .sub-menu {
    left: auto;
    right: 0;
}

.has-dropdown:hover .dropdown,
.nav-list > .menu-item-has-children:hover > .sub-menu {
    display: block;
}

/* Фиксация nav для корректного позиционирования dropdown */
.main-nav .container {
    position: relative;
}

.dropdown li a,
.sub-menu li a {
    display: block;
    padding: 10px 20px;
    color: #424242;
    font-size: 0.82rem;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s, color 0.2s;
}

.dropdown li a:hover,
.sub-menu li a:hover {
    background: #fce4ec;
    color: #c62828;
    text-decoration: none;
}

.dropdown li:last-child a,
.sub-menu li:last-child a {
    border-bottom: none;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.nav-accessibility {
    font-size: 1.3rem;
    padding: 8px;
    color: #757575;
}

.nav-accessibility:hover {
    color: #c62828;
    text-decoration: none;
}

.nav-social {
    display: flex;
    gap: 6px;
}

.nav-social a {
    display: inline-block;
    background: #f5f5f5;
    color: #424242;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    transition: background 0.2s, color 0.2s;
}

.nav-social a:hover {
    background: #c62828;
    color: #fff;
    text-decoration: none;
}

/* Бургер */
.burger-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.burger-btn span {
    display: block;
    width: 26px;
    height: 3px;
    background: #212121;
    border-radius: 2px;
    transition: 0.3s;
}

.burger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.burger-btn.active span:nth-child(2) {
    opacity: 0;
}

.burger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* --- Основной контент --- */
.main-content {
    padding: 30px 0 50px;
}

.content-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 30px;
    align-items: start;
}

.content-main {
    min-width: 0;
    overflow-x: hidden; /* предотвращает смещение сайдбара */
}

/* --- Герой-карусель --- */
.hero-carousel {
    margin-bottom: 36px;
}

.hero-slide {
    display: none;
}

.hero-slide.active {
    display: block;
}

.hero-image-placeholder,
.hero-image-wrap {
    width: 100%;
    height: 420px;
    background: linear-gradient(135deg, #37474f 0%, #263238 60%, #c62828 100%);
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.hero-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    padding: 40px 30px 30px;
    color: #fff;
}

.hero-overlay a {
    color: #fff;
}

.hero-overlay a:hover {
    text-decoration: none;
    color: #fff;
}

.hero-category {
    display: inline-block;
    background: #c62828;
    color: #fff;
    padding: 3px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 3px;
    margin-bottom: 10px;
}

.hero-category a {
    color: #fff;
}

.hero-category a:hover {
    text-decoration: none;
}

.hero-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}

.hero-excerpt {
    font-size: 0.95rem;
    opacity: 0.85;
    margin-bottom: 8px;
    line-height: 1.5;
}

.hero-date {
    font-size: 0.8rem;
    opacity: 0.6;
}

/* --- Хлебные крошки --- */
.breadcrumbs {
    font-size: 0.85rem;
    color: #757575;
    margin-bottom: 20px;
    padding: 10px 0;
}

.breadcrumbs a {
    color: #757575;
}

.breadcrumbs a:hover {
    color: #c62828;
}

/* --- Секция новостей --- */
.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #212121;
    margin-bottom: 24px;
    position: relative;
}

.section-title span {
    background: #fafafa;
    padding-right: 16px;
    position: relative;
    z-index: 1;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    background: #e0e0e0;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.news-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.3s, transform 0.2s;
}

.news-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.news-card-image {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #eceff1, #cfd8dc);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #90a4ae;
    font-size: 0.9rem;
    font-weight: 600;
}

.news-card-category {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #c62828;
    color: #fff;
    padding: 2px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 3px;
}

.news-card-category a {
    color: #fff;
}

.news-card-category a:hover {
    text-decoration: none;
}

.news-card-body {
    padding: 16px 20px 20px;
}

.news-card-date {
    display: block;
    font-size: 0.75rem;
    color: #9e9e9e;
    margin-bottom: 6px;
}

.news-card-body h3 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
}

.news-card-body h3 a {
    color: #212121;
}

.news-card-body h3 a:hover {
    color: #c62828;
    text-decoration: none;
}

.news-card-body p {
    font-size: 0.85rem;
    color: #616161;
    line-height: 1.5;
}

/* --- Содержимое записей и страниц --- */
.entry-content {
    line-height: 1.8;
    font-size: 1rem;
    color: #333;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    margin: 1.6em 0 0.6em;
    color: #212121;
    line-height: 1.3;
    font-weight: 700;
}

.entry-content h1 { font-size: 1.8rem; }
.entry-content h2 {
    font-size: 1.4rem;
    border-bottom: 2px solid #f5f5f5;
    padding-bottom: 0.3em;
}
.entry-content h3 {
    font-size: 1.2rem;
    color: #c62828;
}
.entry-content h4 { font-size: 1.05rem; }

.entry-content p {
    margin-bottom: 1em;
}

.entry-content ul {
    margin: 0 0 1em 0;
    padding-left: 1.5em;
    list-style: none;
}

.entry-content ul > li {
    position: relative;
    padding-left: 1.2em;
}

.entry-content ul > li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: #c62828;
    font-weight: 700;
}

.entry-content ol {
    margin: 0 0 1em 0;
    padding-left: 2em;
}

.entry-content li {
    margin-bottom: 0.4em;
    line-height: 1.7;
}

.entry-content a {
    color: #c62828;
    border-bottom: 1px dotted #c62828;
}

.entry-content a:hover {
    border-bottom-style: solid;
    text-decoration: none;
}

/* Блок-цитаты и выделения */
.entry-content strong,
.entry-content b {
    font-weight: 700;
    color: #1a1a1a;
}

.entry-content blockquote {
    border-left: 4px solid #c62828;
    padding: 12px 20px;
    margin: 1.5em 0;
    background: #fce4ec;
    color: #424242;
    font-style: italic;
}

/* Обёртка для широких таблиц */
.entry-content .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.5em 0;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.entry-content table {
    border-collapse: collapse;
    margin: 0;
    width: 100%;
    font-size: 0.9rem;
}

.entry-content .table-responsive table {
    margin: 0;
    min-width: 100%;
}

.entry-content th,
.entry-content td {
    border: 1px solid #e0e0e0;
    padding: 9px 13px;
    text-align: left;
    vertical-align: top;
    line-height: 1.5;
}

.entry-content th {
    background: #c62828;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

.entry-content tr:nth-child(even) td {
    background: #fafafa;
}

/* Hover только на data-таблицах (с <th>), не на layout-таблицах старого HTML */
.entry-content table:has(th) tr:hover td {
    background: #fce4ec;
    transition: background 0.15s;
}

/* Таблица-сетка без данных (вёрстка старого сайта) */
.entry-content table[cellpadding],
.entry-content table[border] {
    border: none;
}
.entry-content table[cellpadding] td,
.entry-content table[border] td {
    border: 1px solid #e0e0e0;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.entry-content pre {
    background: #263238;
    color: #eceff1;
    padding: 16px 20px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1.5em 0;
    font-size: 0.9rem;
}

.entry-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

.entry-content pre code {
    background: none;
    padding: 0;
}

/* Страничный заголовок */
.page-header-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #212121;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 3px solid #c62828;
}

.entry-meta {
    font-size: 0.85rem;
    color: #9e9e9e;
    margin-bottom: 20px;
}

.entry-meta a {
    color: #757575;
}

.entry-meta a:hover {
    color: #c62828;
}

.entry-featured-image {
    margin-bottom: 24px;
    border-radius: 8px;
    overflow: hidden;
}

.entry-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Сайдбар --- */
.content-sidebar {
    min-width: 0;
}

.sidebar-widget {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.widget-title {
    font-size: 1rem;
    font-weight: 700;
    color: #212121;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 3px solid #c62828;
}

/* Поиск */
.sidebar-search,
.search-form {
    display: flex;
}

.sidebar-search-input,
.search-form .search-field {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.sidebar-search-input:focus,
.search-form .search-field:focus {
    border-color: #c62828;
}

.sidebar-search-btn,
.search-form .search-submit {
    background: #c62828;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.sidebar-search-btn:hover,
.search-form .search-submit:hover {
    background: #b71c1c;
}

/* Меню */
.sidebar-menu {
    list-style: none;
}

.sidebar-menu > li {
    border-bottom: 1px solid #f5f5f5;
}

.sidebar-menu > li > a {
    display: block;
    padding: 8px 0;
    color: #424242;
    font-size: 0.88rem;
    font-weight: 500;
    transition: color 0.2s;
}

.sidebar-menu > li > a:hover {
    color: #c62828;
    text-decoration: none;
}

.sidebar-menu > li:last-child {
    border-bottom: none;
}

.submenu,
.sidebar-menu .sub-menu {
    list-style: none;
    display: none;
    padding-left: 16px;
    padding-bottom: 8px;
}

.has-children.open .submenu,
.sidebar-menu .menu-item-has-children.open > .sub-menu {
    display: block;
}

.submenu li a,
.sidebar-menu .sub-menu li a {
    display: block;
    padding: 4px 0;
    color: #757575;
    font-size: 0.8rem;
    transition: color 0.2s;
}

.submenu li a:hover,
.sidebar-menu .sub-menu li a:hover {
    color: #c62828;
    text-decoration: none;
}

.menu-toggle-link::after,
.sidebar-menu .menu-item-has-children > a::after {
    content: ' +';
    float: right;
    color: #bdbdbd;
}

.has-children.open .menu-toggle-link::after,
.sidebar-menu .menu-item-has-children.open > a::after {
    content: ' -';
}

/* Баннеры */
.sidebar-banners {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-banner {
    display: block;
}

.sidebar-banner-inner {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 6px;
    transition: opacity 0.2s;
    padding: 10px;
}

.sidebar-banner:hover .sidebar-banner-inner {
    opacity: 0.85;
    text-decoration: none;
}

.banner-gosuslugi { background: linear-gradient(135deg, #1565c0, #0d47a1); }
.banner-priem { background: linear-gradient(135deg, #c62828, #b71c1c); }
.banner-nok { background: linear-gradient(135deg, #2e7d32, #1b5e20); }
.banner-ws { background: linear-gradient(135deg, #e65100, #bf360c); }
.banner-anti { background: linear-gradient(135deg, #4527a0, #311b92); }
.banner-dop { background: linear-gradient(135deg, #00838f, #006064); }

/* Полезные ссылки */
.useful-links {
    list-style: none;
}

.useful-links li {
    padding: 6px 0;
    border-bottom: 1px solid #f5f5f5;
}

.useful-links li:last-child {
    border-bottom: none;
}

.useful-links li a {
    color: #424242;
    font-size: 0.85rem;
}

.useful-links li a:hover {
    color: #c62828;
}

/* Соцсети сайдбар */
.sidebar-social {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.social-btn {
    display: block;
    text-align: center;
    padding: 10px;
    border-radius: 6px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    transition: opacity 0.2s;
}

.social-btn:hover {
    opacity: 0.85;
    text-decoration: none;
    color: #fff;
}

.social-vk { background: #4a76a8; }
.social-tg { background: #0088cc; }
.social-ok { background: #ee8208; }

/* --- WordPress Alignment Classes --- */
.alignleft {
    float: left;
    margin: 0.5em 1.5em 1em 0;
}

.alignright {
    float: right;
    margin: 0.5em 0 1em 1.5em;
}

.aligncenter {
    display: block;
    margin: 1em auto;
}

.alignwide {
    margin-left: -20px;
    margin-right: -20px;
    max-width: calc(100% + 40px);
}

.alignfull {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    max-width: 100vw;
    width: 100vw;
}

/* --- WordPress Caption / Gallery --- */
.wp-caption {
    max-width: 100%;
    margin-bottom: 1.5em;
    background: #f5f5f5;
    border-radius: 6px;
    overflow: hidden;
}

.wp-caption img {
    display: block;
    max-width: 100%;
    height: auto;
}

.wp-caption-text {
    padding: 8px 12px;
    font-size: 0.85rem;
    color: #757575;
    text-align: center;
}

figure.wp-block-image {
    margin: 1.5em 0;
}

figcaption,
.blocks-gallery-caption {
    font-size: 0.85rem;
    color: #757575;
    text-align: center;
    margin-top: 6px;
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1.5em;
}

.gallery-item {
    flex: 1 1 calc(33.333% - 8px);
    max-width: calc(33.333% - 8px);
}

.gallery-columns-2 .gallery-item {
    flex: 1 1 calc(50% - 8px);
    max-width: calc(50% - 8px);
}

.gallery-columns-4 .gallery-item {
    flex: 1 1 calc(25% - 8px);
    max-width: calc(25% - 8px);
}

.gallery-item img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* --- WordPress Widget Styles --- */
.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget ul li {
    padding: 6px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.88rem;
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul li a {
    color: #424242;
}

.widget ul li a:hover {
    color: #c62828;
}

.widget select {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.9rem;
}

.widget .calendar_wrap table {
    width: 100%;
    border-collapse: collapse;
}

.widget .calendar_wrap th,
.widget .calendar_wrap td {
    text-align: center;
    padding: 6px;
    font-size: 0.85rem;
}

.widget .tagcloud a {
    display: inline-block;
    padding: 4px 10px;
    margin: 2px;
    background: #f5f5f5;
    border-radius: 3px;
    font-size: 0.8rem !important;
    color: #424242;
}

.widget .tagcloud a:hover {
    background: #c62828;
    color: #fff;
    text-decoration: none;
}

/* --- Комментарии --- */
.comments-area {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.comments-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #212121;
    margin-bottom: 24px;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-list .comment {
    padding: 16px 0;
    border-bottom: 1px solid #f5f5f5;
}

.comment-list .comment:last-child {
    border-bottom: none;
}

.comment-author {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.comment-author img {
    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
}

.comment-meta {
    font-size: 0.8rem;
    color: #9e9e9e;
    margin-bottom: 8px;
}

.comment-content {
    font-size: 0.92rem;
    line-height: 1.6;
    color: #424242;
}

.comment-content p {
    margin-bottom: 0.5em;
}

.comment-reply-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: #c62828;
}

.comment-list .children {
    list-style: none;
    padding-left: 30px;
    margin: 0;
}

.comment-respond {
    margin-top: 30px;
}

.comment-reply-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.comment-form label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: #424242;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 14px;
    transition: border-color 0.2s;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: #c62828;
    outline: none;
}

.comment-form .submit {
    background: #c62828;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.comment-form .submit:hover {
    background: #b71c1c;
}

/* --- Пагинация --- */
.pagination,
.nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 36px;
    flex-wrap: wrap;
}

.pagination .page-numbers,
.nav-links .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: #fff;
    color: #424242;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    text-decoration: none;
}

.pagination .page-numbers:hover,
.nav-links .page-numbers:hover {
    background: #fce4ec;
    border-color: #c62828;
    color: #c62828;
    text-decoration: none;
}

.pagination .page-numbers.current,
.nav-links .page-numbers.current {
    background: #c62828;
    color: #fff;
    border-color: #c62828;
}

.pagination .page-numbers.dots,
.nav-links .page-numbers.dots {
    border: none;
    background: none;
    min-width: auto;
    padding: 0 4px;
}

/* Навигация записей (одиночная) */
.post-navigation {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 2px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.post-navigation a {
    display: block;
    padding: 12px 16px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #424242;
    transition: border-color 0.2s, color 0.2s;
    max-width: 48%;
}

.post-navigation a:hover {
    border-color: #c62828;
    color: #c62828;
    text-decoration: none;
}

.nav-label {
    display: block;
    font-size: 0.75rem;
    color: #9e9e9e;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 4px;
}

/* --- 404 Страница --- */
.page-404 {
    text-align: center;
    padding: 60px 20px;
}

.page-404 h1 {
    font-size: 5rem;
    font-weight: 700;
    color: #c62828;
    margin-bottom: 16px;
}

.page-404 p {
    font-size: 1.1rem;
    color: #616161;
    margin-bottom: 24px;
}

.page-404 .search-form {
    max-width: 400px;
    margin: 0 auto;
}

/* --- Кнопка «Все новости» --- */
.all-news-link {
    display: inline-block;
    margin-top: 24px;
    padding: 10px 24px;
    background: #c62828;
    color: #fff;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.all-news-link:hover {
    background: #b71c1c;
    color: #fff;
    text-decoration: none;
}

/* ===== Полноширинный макет (широкие таблицы / ручной выбор) ===== */

.layout-full-width .content-layout {
    grid-template-columns: 1fr;
    max-width: 100%;
}

.layout-full-width .content-layout > .content-sidebar {
    display: none;
}

/* Горизонтальный сайдбар под контентом */
.sidebar-horizontal-wrap {
    display: none;
    margin-top: 36px;
    padding-top: 28px;
    border-top: 3px solid #e0e0e0;
}

.layout-full-width .sidebar-horizontal-wrap {
    display: block;
}

.sidebar-horizontal-wrap .content-sidebar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    align-items: start;
}

.sidebar-horizontal-wrap .sidebar-widget {
    margin-bottom: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.sidebar-horizontal-wrap .sidebar-widget-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #212121;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #c62828;
}

.sidebar-horizontal-wrap .sidebar-menu > li > a {
    padding: 5px 0;
    font-size: 0.88rem;
}

.sidebar-horizontal-wrap .sidebar-banner-item {
    margin-bottom: 8px;
}

.sidebar-horizontal-wrap .sidebar-links-list li {
    margin-bottom: 6px;
}

.sidebar-horizontal-wrap .sidebar-social {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Индикатор для редактора */
.chpt-layout-notice {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 4px;
    padding: 8px 14px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: #795548;
}

/* --- Подвал --- */
.footer {
    background: #212121;
    color: #bdbdbd;
    padding: 40px 0 0;
    font-size: 0.85rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #424242;
}

.footer-col h4 {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.footer-col p {
    margin-bottom: 6px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 6px;
}

.footer-col a {
    color: #bdbdbd;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: #fff;
}

.footer-social {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.footer-social a {
    display: inline-block;
    background: #424242;
    color: #fff;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.footer-social a:hover {
    background: #c62828;
    text-decoration: none;
}

.footer-gov-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
}

.footer-gov-links a {
    font-size: 0.82rem;
}

.footer-bottom {
    padding: 16px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    color: #757575;
    font-size: 0.8rem;
}

.footer-bottom-left {
    display: flex;
    gap: 20px;
}

.footer-bottom-left a {
    color: #757575;
}

.footer-bottom-left a:hover {
    color: #fff;
}

/* --- Screen Reader Text --- */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 960px) {
    /* Бургер */
    .burger-btn {
        display: flex;
    }

    .nav-list {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 0 8px 24px rgba(0,0,0,0.12);
        z-index: 200;
    }

    .nav-list.open {
        display: flex;
    }

    .nav-list > li > a {
        border-bottom: 1px solid #f5f5f5;
    }

    .dropdown,
    .sub-menu {
        position: static;
        box-shadow: none;
        border-top: none;
        min-width: 0;
    }

    .has-dropdown:hover .dropdown,
    .menu-item-has-children:hover > .sub-menu {
        display: none;
    }

    .has-dropdown.dropdown-open .dropdown,
    .menu-item-has-children.dropdown-open > .sub-menu {
        display: block;
    }

    .dropdown li a,
    .sub-menu li a {
        padding-left: 30px;
    }

    .nav-right {
        display: none;
    }

    /* Две колонки -> одна */
    .content-layout {
        grid-template-columns: 1fr;
    }

    .content-sidebar {
        order: 2;
    }

    /* Шапка */
    .header-title {
        font-size: 1.4rem;
    }

    .header-meta {
        flex-direction: column;
        gap: 6px;
    }

    /* Герой */
    .hero-image-placeholder,
    .hero-image-wrap {
        height: 280px;
    }

    .hero-title {
        font-size: 1.3rem;
    }

    /* Новости */
    .news-grid {
        grid-template-columns: 1fr;
    }

    /* Подвал */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    /* Пагинация */
    .post-navigation {
        flex-direction: column;
    }

    .post-navigation a {
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    body.admin-bar .main-nav {
        top: 0;
    }

    .header-bg {
        padding: 24px 0 30px;
    }

    .header-title {
        font-size: 1.15rem;
    }

    .hero-image-placeholder,
    .hero-image-wrap {
        height: 220px;
    }

    .hero-overlay {
        padding: 20px 16px 16px;
    }

    .hero-title {
        font-size: 1.1rem;
    }

    .hero-excerpt {
        display: none;
    }

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

    .news-card-image {
        height: 140px;
    }

    .gallery-item {
        flex: 1 1 calc(50% - 8px);
        max-width: calc(50% - 8px);
    }

    .page-404 h1 {
        font-size: 3rem;
    }
}
