/*
Theme Name: dds_concursocica.com
Author: Екатерина Соловьёва
Description: Информационная тема для образовательного хаба Concursocica — олимпиады, подготовка к экзаменам, профориентация и карьера.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: cica
*/

/* ============================================================
   Переменные
   ============================================================ */
:root {
    --ink: #1b2333;
    --muted: #5a6275;
    --primary: #2f3d8f;
    --primary-dark: #232d6b;
    --accent: #e07a3c;
    --accent-soft: #fbe9dc;
    --line: #e3e6ef;
    --bg: #f5f6fb;
    --surface: #ffffff;
    --soft: #eef1fa;
    --footer-bg: #181f33;
    --footer-ink: #cfd4e4;
    --footer-line: #2c3450;
    --radius: 14px;
    --shadow: 0 8px 26px rgba(27, 35, 51, .08);
    --shell: min(92%, 1180px);
}

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

html { scroll-behavior: smooth; }

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

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

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

h1, h2, h3, h4 {
    line-height: 1.25;
    color: var(--ink);
    margin: 0 0 .6em;
    font-weight: 700;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.22rem; }

p { margin: 0 0 1.1em; }

.shell { width: var(--shell); margin-inline: auto; }

/* ============================================================
   Шапка
   ============================================================ */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 18px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-logo { display: block; height: 52px; width: auto; }
.brand-text { min-width: 0; }
.brand-name {
    display: block;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--ink);
    line-height: 1.3;
    max-width: 540px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.brand-desc {
    display: block;
    font-size: .82rem;
    color: var(--muted);
    max-width: 540px;
    margin-top: 2px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.nav-toggle {
    margin-left: auto;
    display: none;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 9px 12px;
    cursor: pointer;
    color: var(--ink);
    font-size: 1rem;
}

.main-nav { margin-left: auto; }
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.main-nav a {
    display: block;
    padding: 9px 14px;
    border-radius: 9px;
    color: var(--ink);
    font-weight: 600;
    font-size: .96rem;
}
.main-nav a:hover { background: var(--soft); text-decoration: none; }
.main-nav .current-menu-item > a { background: var(--primary); color: #fff; }

/* ============================================================
   Хлебные крошки
   ============================================================ */
.crumbs {
    width: var(--shell);
    margin: 18px auto 0;
    font-size: .88rem;
    color: var(--muted);
}
.crumbs a { color: var(--primary); }
.crumbs .sep { margin: 0 6px; color: var(--muted); }

/* ============================================================
   Раскладки контент / сайдбар
   ============================================================ */
.site-main { padding: 28px 0 50px; }

.layout-with-sidebar {
    width: var(--shell);
    margin-inline: auto;
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 38px;
    align-items: start;
}
.layout-single {
    width: 85%;
    max-width: 1024px;
    margin-inline: auto;
}
.content-area { min-width: 0; }

/* ============================================================
   Сайдбар (светлый фон → тёмный текст)
   ============================================================ */
.sidebar { min-width: 0; }
.sidebar .widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 24px;
    color: var(--ink);
}
.sidebar .widget-title {
    font-size: 1.05rem;
    margin: 0 0 14px;
    color: var(--ink);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
}
.sidebar .widget a { color: var(--primary); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.sidebar li:last-child { border-bottom: 0; }
.sidebar .post-date { display: block; font-size: .8rem; color: var(--muted); }

/* ============================================================
   Карточки записей (A8, A10)
   ============================================================ */
.cards { display: grid; gap: 24px; }
.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.card-thumb {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}
.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.card-body {
    flex: 1;
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
}
.card-title { font-size: 1.2rem; margin: 0 0 8px; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--primary); text-decoration: none; }
.card-meta { font-size: .82rem; color: var(--muted); margin-bottom: 10px; }
.card-excerpt { color: var(--muted); }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    align-self: flex-start;
    padding-top: 12px;
    font-weight: 600;
    color: var(--accent);
}
.card-more:hover { text-decoration: underline; }

/* Лента: одна колонка карточек на странице блога/архива */
.feed .card { margin-bottom: 0; }
.feed { display: grid; gap: 26px; }

/* ============================================================
   Контент записи / страницы
   ============================================================ */
.entry {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 34px;
    box-shadow: var(--shadow);
}
.entry-title { font-size: 2rem; margin-bottom: 10px; }
.entry-meta { color: var(--muted); font-size: .88rem; margin-bottom: 20px; }
.entry-thumb { border-radius: 12px; overflow: hidden; margin-bottom: 22px; }
.entry-thumb img { width: 100%; display: block; }
.entry-content { min-width: 0; }
.entry-content img { border-radius: 10px; }
.entry-content h2 { margin-top: 1.4em; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content blockquote {
    margin: 1.4em 0;
    padding: 14px 20px;
    border-left: 4px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0 10px 10px 0;
}

/* Таблицы */
.entry-content table { border-collapse: collapse; width: 100%; margin: 1.4em 0; }
.entry-content table, .entry-content th, .entry-content td { border: 1px solid var(--line); }
.entry-content th, .entry-content td { padding: 10px 12px; text-align: left; }
.entry-content th { background: var(--soft); }

/* ============================================================
   Главная
   ============================================================ */
.home-section { padding: 50px 0; }
.home-section:nth-child(even) { background: var(--surface); }
.section-head { max-width: 720px; margin-bottom: 30px; }
.eyebrow {
    display: inline-block;
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 8px;
}
.section-head h2 { font-size: 1.85rem; }
.section-head p { color: var(--muted); margin-bottom: 0; }

/* Блок: текст + иллюстрация */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 44px;
    align-items: center;
}
.split.reverse .split-media { order: -1; }
.split-text h2 { font-size: 1.95rem; }
.split-text p { color: var(--muted); }
.split-media img { width: 100%; display: block; border-radius: var(--radius); }
.btn {
    display: inline-block;
    margin-top: 8px;
    padding: 12px 22px;
    background: var(--primary);
    color: #fff;
    border-radius: 10px;
    font-weight: 600;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn-ghost {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-ghost:hover { background: var(--primary); color: #fff; }

/* Блок: сетка направлений */
.tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}
.tile {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
}
.home-section:nth-child(even) .tile { background: var(--bg); }
.tile-icon {
    width: 48px;
    height: 48px;
    display: block;
    margin-bottom: 14px;
}
.tile h3 { font-size: 1.12rem; margin-bottom: 6px; }
.tile p { color: var(--muted); font-size: .94rem; margin-bottom: 0; }

/* Блок: шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
    counter-reset: step;
}
.step {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 22px;
    position: relative;
}
.home-section:nth-child(even) .step { background: var(--bg); }
.step::before {
    counter-increment: step;
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 14px;
}
.step h3 { font-size: 1.08rem; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: .93rem; margin-bottom: 0; }

/* Блок: FAQ */
.faq { max-width: 820px; }
.faq-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 14px;
    overflow: hidden;
}
.home-section:nth-child(even) .faq-item { background: var(--bg); }
.faq-item summary {
    cursor: pointer;
    padding: 18px 22px;
    font-weight: 600;
    list-style: none;
    position: relative;
    padding-right: 50px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.4rem;
    color: var(--accent);
    line-height: 1;
}
.faq-item[open] summary::after { content: "–"; }
.faq-answer { padding: 0 22px 18px; color: var(--muted); }
.faq-answer p { margin-bottom: 0; }

/* Лента последних записей на главной */
.home-feed {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

/* ============================================================
   Пагинация (D5, type=plain → стилизуем .page-numbers)
   ============================================================ */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 36px 0 0;
}
.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}
.pager a.page-numbers:hover { background: var(--soft); }
.pager .page-numbers.current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.pager .page-numbers.dots {
    border: 0;
    background: transparent;
}

/* ============================================================
   Поиск
   ============================================================ */
.search-form {
    display: flex;
    gap: 8px;
    max-width: 420px;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 1rem;
    background: var(--surface);
    color: var(--ink);
}
.search-form .search-submit {
    padding: 11px 18px;
    border: 0;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}
.search-form .search-submit:hover { background: var(--primary-dark); }

/* ============================================================
   Комментарии
   ============================================================ */
.comments-area { margin-top: 34px; }
.comments-area .comment-list { list-style: none; margin: 0 0 24px; padding: 0; }
.comments-area .comment-list .children { list-style: none; margin: 0 0 0 28px; padding: 0; }
.comment-inner {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 14px;
}
.comment-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.comment-author { font-weight: 700; }
.comment-date { font-size: .8rem; color: var(--muted); }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 1rem;
    margin-top: 5px;
    background: var(--surface);
    color: var(--ink);
}
.comment-form p { margin-bottom: 14px; }
.comment-form .submit {
    padding: 12px 22px;
    border: 0;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

/* ============================================================
   404
   ============================================================ */
.error-404 { text-align: center; padding: 30px 0; }
.error-404 .code { font-size: 4.5rem; font-weight: 800; color: var(--primary); line-height: 1; }
.error-404 .search-form { margin: 24px auto 0; }

/* ============================================================
   Контакты (статичные, без телефона — D8)
   ============================================================ */
.contact-links { list-style: none; padding: 0; margin: 16px 0 0; }
.contact-links li { margin-bottom: 8px; }

/* ============================================================
   Подвал (тёмный фон → светлый текст)
   ============================================================ */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-ink);
    padding: 48px 0 0;
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px;
}
.site-footer .widget { margin-bottom: 10px; color: var(--footer-ink); }
.site-footer .widget-title {
    color: #fff;
    font-size: 1.05rem;
    margin-bottom: 14px;
}
.site-footer .widget p { color: var(--footer-ink); }
.site-footer .widget a { color: #fff; }
.site-footer .widget a:hover { color: var(--accent); text-decoration: none; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 6px 0; border-bottom: 1px solid var(--footer-line); }
.site-footer li:last-child { border-bottom: 0; }
.site-footer .post-date { color: #97a0bd; font-size: .8rem; display: block; }
.footer-bottom {
    border-top: 1px solid var(--footer-line);
    margin-top: 34px;
    padding: 20px 0;
    text-align: center;
    font-size: .86rem;
    color: #97a0bd;
}

/* ============================================================
   Cookie-баннер (D6, A11) — правило [hidden] ДО основного блока
   ============================================================ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    background: var(--ink);
    color: #fff;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .3);
}
.cookie-banner p { margin: 0; flex: 1; min-width: 220px; font-size: .92rem; }
.cookie-banner a { color: var(--accent); }
.cookie-accept {
    padding: 10px 22px;
    border: 0;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.cookie-accept:hover { background: #c9692f; }

/* ============================================================
   Адаптив
   ============================================================ */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 30px; }
    .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-feed { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .split { grid-template-columns: 1fr; gap: 26px; }
    .split.reverse .split-media { order: 0; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1, .entry-title { font-size: 1.6rem; }
    .nav-toggle { display: block; }
    .main-nav {
        flex-basis: 100%;
        margin-left: 0;
        display: none;
    }
    .main-nav.is-open { display: block; }
    .main-nav ul { flex-direction: column; gap: 4px; }
    .tiles, .steps, .home-feed { grid-template-columns: 1fr; }
    .layout-single { width: 92%; }
    .entry { padding: 22px 18px; }
    .brand-name { -webkit-line-clamp: 3; }
}
