/*
Theme Name: dds_aviaevents.ru
Author: Максим Крылов
Description: Информационно-образовательный портал по профориентации в авиации и аэрокосмической инженерии.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: aviaevents
*/

/* ===== Переменные ===== */
:root {
    --navy: #0a2540;
    --navy-2: #102a43;
    --sky: #54a0ff;
    --sky-2: #2b6cb0;
    --ink: #1c2733;
    --muted: #5b6b7b;
    --line: #dde5ee;
    --bg: #f4f7fb;
    --card-bg: #ffffff;
    --maxw: 1180px;
}

/* ===== База ===== */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.65;
    overflow-x: hidden;
}

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

a { color: var(--sky-2); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
    font-family: Georgia, "Times New Roman", serif;
    color: var(--navy);
    line-height: 1.25;
    margin: 0 0 0.5em;
}

p { margin: 0 0 1em; }

/* ===== Контейнер ширины (один источник) ===== */
.shell {
    width: min(92%, var(--maxw));
    margin-inline: auto;
}

.shell-wide {
    width: 85%;
    max-width: var(--maxw);
    margin-inline: auto;
}

/* ===== Шапка ===== */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
    text-decoration: none;
}
.brand .brand-logo { display: block; flex: 0 0 auto; }
.brand-text { min-width: 0; }
.brand-name {
    display: block;
    font-family: Georgia, serif;
    font-weight: 700;
    color: var(--navy);
    font-size: 1.05rem;
    line-height: 1.2;
}
.brand-desc {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.35;
    margin-top: 0.2rem;
}

/* ===== Навигация ===== */
.main-nav { min-width: 0; }
.nav-toggle {
    display: none;
    background: var(--navy);
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 0.5rem 0.9rem;
    font-size: 0.95rem;
    cursor: pointer;
}
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.main-nav a {
    display: block;
    padding: 0.5rem 0.85rem;
    color: var(--navy);
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
}
.main-nav a:hover { background: var(--bg); text-decoration: none; }
.main-nav .current-menu-item > a { background: var(--navy); color: #fff; }

/* ===== Хлебные крошки ===== */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--muted);
    padding: 1rem 0 0;
}
.breadcrumbs a { color: var(--sky-2); }
.breadcrumbs .sep { color: var(--line); margin: 0 0.15rem; }

/* ===== Основная сетка контента ===== */
.site-main { padding: 1.5rem 0 2.5rem; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 2.5%;
    align-items: start;
}
.layout-single .content-area { width: 100%; }
.content-area { min-width: 0; }

/* ===== Сайдбар ===== */
.sidebar {
    min-width: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.2rem;
}
.sidebar .widget { margin-bottom: 1.5rem; }
.sidebar .widget:last-child { margin-bottom: 0; }
.sidebar .widget-title {
    font-size: 1.05rem;
    color: var(--navy);
    margin-bottom: 0.7rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--sky);
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: 0.35rem 0; border-bottom: 1px dashed var(--line); }
.sidebar li:last-child { border-bottom: 0; }
.sidebar a { color: var(--sky-2); }
.sidebar .post-date { display: block; color: var(--muted); font-size: 0.8rem; }

/* ===== Карточки записей (A8, A10) ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 1.5rem;
}
.card {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    min-width: 0;
}
.card-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-thumb-ph {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--navy) 0%, var(--sky-2) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-thumb-ph svg { width: 64px; height: 64px; opacity: 0.9; }
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.1rem 1.2rem 1.2rem;
    min-width: 0;
}
.card-title { font-size: 1.15rem; margin-bottom: 0.4rem; }
.card-title a { color: var(--navy); }
.card-meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.6rem; }
.card-excerpt { color: var(--ink); font-size: 0.95rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    align-self: flex-start;
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--navy);
    color: #fff;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}
.card-more:hover { background: var(--sky-2); text-decoration: none; }

/* ===== Одиночная запись / страница ===== */
.entry {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.8rem;
}
.entry-title { font-size: 2rem; }
.entry-meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.2rem; }
.entry-thumb { border-radius: 10px; margin-bottom: 1.5rem; width: 100%; aspect-ratio: 16/7; object-fit: cover; display: block; }
.entry-content { min-width: 0; }
.entry-content img { border-radius: 8px; display: block; }
.entry-content h2 { margin-top: 1.6rem; }
.entry-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.2rem 0;
}
.entry-content table,
.entry-content th,
.entry-content td {
    border: 1px solid var(--line);
}
.entry-content th, .entry-content td { padding: 0.6rem 0.8rem; }
.entry-content th { background: var(--bg); text-align: left; }

/* ===== Список (архивы/поиск/блог) ===== */
.list-header { margin-bottom: 1.5rem; }
.list-header h1 { font-size: 1.8rem; }

/* ===== Пагинация (D5 plain → .page-numbers) ===== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 2rem;
    justify-content: center;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--navy);
    font-weight: 600;
    font-size: 0.9rem;
}
.pagination a.page-numbers:hover { background: var(--bg); text-decoration: none; }
.pagination .page-numbers.current {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
}
.pagination .page-numbers.dots { border: 0; background: none; }

/* ===== Главная ===== */
.home-section { padding: 2.5rem 0; }
.home-section:nth-child(even) { background: #fff; }
.section-head { text-align: center; margin-bottom: 1.8rem; }
.section-head h2 { font-size: 1.9rem; }
.section-head p { color: var(--muted); max-width: 680px; margin-inline: auto; }

/* Блок: текст + иллюстрация */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: center;
}
.split.reverse .split-media { order: -1; }
.split-text { min-width: 0; }
.split-text h2 { font-size: 1.9rem; }
.split-media { min-width: 0; }
.split-media img { width: 100%; border-radius: 14px; display: block; }

/* Блок: сетка профессий */
.dir-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 1.5rem;
}
.dir-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    min-width: 0;
}
.home-section:nth-child(even) .dir-card { background: var(--bg); }
.dir-card .dir-icon {
    width: 56px; height: 56px;
    margin: 0 auto 0.9rem;
    display: flex; align-items: center; justify-content: center;
    background: var(--navy);
    border-radius: 50%;
}
.dir-card .dir-icon svg { width: 30px; height: 30px; }
.dir-card h3 { font-size: 1.2rem; }
.dir-card p { color: var(--muted); font-size: 0.95rem; margin: 0; }

/* Блок: шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 1.5rem;
    counter-reset: step;
}
.step {
    background: #fff;
    border: 1px solid var(--line);
    border-left: 4px solid var(--sky);
    border-radius: 10px;
    padding: 1.3rem 1.4rem;
    min-width: 0;
}
.home-section:nth-child(even) .step { background: var(--bg); }
.step .step-num {
    display: inline-flex;
    width: 36px; height: 36px;
    align-items: center; justify-content: center;
    background: var(--navy);
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-family: Georgia, serif;
    margin-bottom: 0.7rem;
}
.step h3 { font-size: 1.15rem; }
.step p { color: var(--muted); font-size: 0.95rem; margin: 0; }

/* Блок: CTA */
.cta {
    background: linear-gradient(135deg, var(--navy) 0%, var(--sky-2) 100%);
    color: #fff;
    border-radius: 16px;
    padding: 2.6rem 2rem;
    text-align: center;
}
.cta h2 { color: #fff; }
.cta p { color: #e6eefb; max-width: 640px; margin: 0 auto 1.4rem; }
.cta .btn {
    display: inline-block;
    background: #fff;
    color: var(--navy);
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    font-weight: 700;
}
.cta .btn:hover { background: var(--sky); color: #fff; text-decoration: none; }

/* Последние записи на главной */
.latest-wrap { margin-top: 0.5rem; }

/* ===== Комментарии ===== */
.comments-area { margin-top: 2rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1.5rem; }
.comments-area .comment-list { list-style: none; margin: 0; padding: 0; }
.comment-item { border-bottom: 1px solid var(--line); padding: 1rem 0; }
.comment-item .children { list-style: none; padding-left: 1.5rem; }
.comment-meta { display: flex; gap: 0.8rem; align-items: baseline; margin-bottom: 0.4rem; }
.comment-author { font-weight: 700; color: var(--navy); }
.comment-date { color: var(--muted); font-size: 0.8rem; }

/* ===== Формы поиска / комментариев ===== */
.search-form { display: flex; gap: 0.5rem; }
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 0.95rem;
}
.search-form button, .search-submit {
    background: var(--navy);
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 0.6rem 1.1rem;
    cursor: pointer;
    font-weight: 600;
}
.comment-form input, .comment-form textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}
.comment-form .submit, .comment-form input[type="submit"] {
    width: auto;
    background: var(--navy);
    color: #fff;
    border: 0;
    padding: 0.7rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

/* ===== 404 ===== */
.error-404 { text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 3rem 1.5rem; }
.error-404 h1 { font-size: 4rem; color: var(--sky-2); }
.error-404 .search-form { max-width: 420px; margin: 1.5rem auto 1rem; }

/* ===== Подвал ===== */
.site-footer {
    background: var(--navy);
    color: #cdd9e6;
    margin-top: 2rem;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 2rem;
    padding: 2.5rem 0 1.5rem;
}
.footer-col { min-width: 0; }
.site-footer .widget-title { color: #fff; font-size: 1.1rem; margin-bottom: 0.8rem; }
.site-footer p { color: #cdd9e6; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 0.3rem 0; }
.site-footer a { color: var(--sky); }
.site-footer a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 1.2rem 0;
    text-align: center;
    font-size: 0.85rem;
    color: #9fb2c6;
}

/* ===== Cookie-баннер (A11, D6) ===== */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--navy-2);
    color: #e8eef6;
    padding: 1rem 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
}
.cookie-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    flex-wrap: wrap;
}
.cookie-banner p { margin: 0; font-size: 0.9rem; flex: 1; min-width: 0; }
.cookie-banner a { color: var(--sky); }
.cookie-accept {
    background: var(--sky);
    color: var(--navy);
    border: 0;
    border-radius: 6px;
    padding: 0.6rem 1.4rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.cookie-accept:hover { background: #fff; }

/* ===== Адаптив ===== */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .split { grid-template-columns: 1fr; }
    .split.reverse .split-media { order: 0; }
}

@media (max-width: 600px) {
    .header-inner { flex-direction: column; align-items: stretch; }
    .nav-toggle { display: block; align-self: flex-start; }
    .main-nav ul {
        display: none;
        flex-direction: column;
        margin-top: 0.6rem;
    }
    .main-nav.open ul { display: flex; }
    .entry { padding: 1.2rem; }
    .entry-title { font-size: 1.5rem; }
    .section-head h2, .split-text h2 { font-size: 1.5rem; }
}
