/*
Theme Name: dds_alfa8.ru
Author: Алексей Крылов
Description: Тема образовательной платформы по SEO и digital-маркетингу. Швейцарский стиль: модульная сетка, контрастная типографика, холодная палитра.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: alfa8
*/

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@500;600;700;800&family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;1,400&display=swap");

/* ---------- Токены ---------- */
:root {
    --c-page: #F5F7FA;
    --c-white: #FFFFFF;
    --c-navy: #0A192F;
    --c-aside: #EDF2F7;
    --c-text: #1A202C;
    --c-accent: #2B6CB0;
    --c-accent-dark: #1E4E8C;
    --c-red: #E53E3E;
    --c-muted: #718096;
    --c-line: #E2E8F0;
    --f-head: "Inter", "Helvetica Neue", Arial, sans-serif;
    --f-body: "IBM Plex Sans", "Segoe UI", Roboto, Arial, sans-serif;
    --r: 4px;
}

/* ---------- Служебное: hidden ---------- */
.cookie-banner[hidden] { display: none !important; }
.site-nav[hidden] { display: none !important; }

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; }
}
body {
    margin: 0;
    background: var(--c-page);
    color: var(--c-text);
    font-family: var(--f-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    overflow-x: hidden;
    border-top: 4px solid var(--c-accent);
}
/* тонкая линия модульной сетки по левому краю */
body::before {
    content: "";
    position: fixed;
    top: 0;
    bottom: 0;
    left: 24px;
    width: 1px;
    background: var(--c-line);
    pointer-events: none;
    z-index: 0;
}
p, li, dd, td, th, .card-title, .brand-desc, .page-title, h1, h2, h3, h4 {
    overflow-wrap: break-word;
    hyphens: auto;
}
p { margin: 0 0 1.1em; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4, h5, h6 {
    font-family: var(--f-head);
    color: var(--c-text);
    line-height: 1.2;
    letter-spacing: -0.015em;
    margin: 1.6em 0 0.6em;
}
h1 { font-size: 2.25rem; font-weight: 800; }
h2 { font-size: 1.75rem; font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 600; }
/* квадратная точка 4×4 у H2/H3 */
.entry-content h2::before, .entry-content h3::before,
.track-title::before,
.widget-title::before, .discussion-title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    background: var(--c-accent);
    margin-right: 0.55em;
    vertical-align: baseline;
}
a {
    color: var(--c-accent);
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size .25s ease, color .2s ease;
}
a:hover, a:focus-visible { background-size: 100% 1px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
}
table { border-collapse: collapse; width: 100%; margin: 0 0 1.4em; }
table, th, td { border: 1px solid #CBD5E0; }
th, td { padding: .6em .8em; text-align: left; vertical-align: top; }
th { background: var(--c-aside); font-family: var(--f-head); font-weight: 600; }
blockquote {
    margin: 1.6em 0;
    padding: 1em 1.4em;
    border-left: 4px solid var(--c-accent);
    background: var(--c-white);
}
pre, code { font-family: Consolas, "Courier New", monospace; font-size: .92em; }
pre { overflow-x: auto; padding: 1em 1.2em; background: var(--c-navy); color: #E2E8F0; border-radius: var(--r); }
hr { border: 0; border-top: 1px solid var(--c-line); margin: 2em 0; }
.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}
.skip-link {
    position: absolute;
    left: 1rem;
    top: -100px;
    z-index: 100;
    background: var(--c-white);
    padding: .6em 1em;
    border-radius: var(--r);
}
.skip-link:focus { top: 1rem; }

/* ---------- Контейнер ---------- */
.shell {
    width: min(92%, 1240px);
    margin-inline: auto;
    position: relative;
    z-index: 1;
}

/* ---------- Кнопки ---------- */
.btn {
    display: inline-block;
    font-family: var(--f-head);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.2;
    padding: .85em 1.5em;
    border-radius: var(--r);
    border: 2px solid var(--c-accent);
    background-image: none;
    cursor: pointer;
    text-align: center;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.btn-solid { background-color: var(--c-accent); color: var(--c-white); }
.btn-solid:hover, .btn-solid:focus-visible {
    background-color: var(--c-accent-dark);
    border-color: var(--c-accent-dark);
    color: var(--c-white);
    transform: translateY(-2px);
}
.btn-ghost { background-color: transparent; color: var(--c-accent); }
.btn-ghost:hover, .btn-ghost:focus-visible {
    border-color: var(--c-accent-dark);
    color: var(--c-accent-dark);
    transform: translateY(-2px);
}
.btn-on-dark { color: var(--c-white); border-color: rgba(255,255,255,.7); }
.btn-on-dark:hover, .btn-on-dark:focus-visible { color: var(--c-white); border-color: var(--c-white); }

/* ---------- Шапка ---------- */
.masthead { background: var(--c-navy); color: var(--c-white); position: relative; z-index: 5; }
.masthead-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.1rem 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--c-white);
    background-image: none;
    min-width: 0;
    flex: 1 1 420px;
}
.brand-mark { flex: 0 0 auto; display: block; }
.brand-logo { display: block; width: 48px; height: 48px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
    font-family: var(--f-head);
    font-weight: 700;
    font-size: .98rem;
    line-height: 1.3;
}
.brand-desc {
    font-size: .8rem;
    line-height: 1.4;
    color: #A0AEC0;
    margin-top: .25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.nav-toggle {
    display: none;
    align-items: center;
    gap: .6rem;
    background: transparent;
    border: 1px solid rgba(255,255,255,.4);
    color: var(--c-white);
    border-radius: var(--r);
    padding: .55em .9em;
    font-family: var(--f-head);
    font-size: .95rem;
    cursor: pointer;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    position: relative;
}
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .2rem 1.8rem;
}
.nav-list a {
    color: #E2E8F0;
    font-family: var(--f-head);
    font-weight: 500;
    font-size: .98rem;
    padding: .3em 0;
    display: inline-block;
}
.nav-list a:hover, .nav-list .current-menu-item > a { color: var(--c-white); background-size: 100% 2px; }
.nav-list .current-menu-item > a { background-image: linear-gradient(var(--c-red), var(--c-red)); }
.nav-list .sub-menu { list-style: none; margin: 0; padding: 0 0 0 1rem; }

/* ---------- Хлебные крошки ---------- */
.crumbs {
    font-size: .88rem;
    color: var(--c-muted);
    padding: 1.6rem 0 0;
}
.crumbs-sep { margin: 0 .35em; color: #A0AEC0; }
.crumbs span:last-child { color: var(--c-text); }

/* ---------- Раскладки ---------- */
.page-wrap { padding-bottom: 4rem; }
.layout { padding-top: 1rem; }
.layout-wide { display: block; width: 85%; margin-left: auto; margin-right: auto; }
.layout-aside {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    column-gap: 6%;
    align-items: start;
}
.content-area { min-width: 0; }
.page-title { font-size: 2.6rem; margin-top: .6rem; }

/* ---------- Заголовки секций ---------- */
.section-title {
    position: relative;
    font-size: 2.1rem;
    font-weight: 800;
    margin: 0 0 2.2rem;
    padding-left: 1.1rem;
}
.section-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: .12em;
    bottom: .12em;
    width: 4px;
    background: var(--c-accent);
}

/* ---------- Главная ---------- */
.front { width: 85%; margin: 0 auto; padding: 3rem 0 5rem; position: relative; z-index: 1; }
.fs {
    background: var(--c-page);
    padding: 4.5rem 3rem;
    border-radius: var(--r);
}
.fs-alt { background: var(--c-white); border: 1px solid var(--c-line); }
.fs + .fs { margin-top: 2rem; }

.fs-hero {
    position: relative;
    overflow: hidden;
    background: var(--c-navy);
    min-height: 520px;
    display: flex;
    align-items: flex-end;
    padding: 5rem 3.5rem 4rem;
}
.fs-hero-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.fs-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(10,25,47,.92) 0%, rgba(10,25,47,.72) 55%, rgba(10,25,47,.25) 100%);
}
.fs-hero-inner { position: relative; z-index: 1; max-width: 46rem; min-width: 0; }
.fs-hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--c-white);
    margin: 0 0 1.4rem;
}
.fs-hero-lead { color: rgba(255,255,255,.72); font-size: 1.2rem; max-width: 38rem; margin: 0 0 2.2rem; }
.fs-hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; }

.facts {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.fact {
    padding: .5rem 1.8rem;
    border-left: 1px solid var(--c-line);
    min-width: 0;
}
.fact:first-child { border-left: 0; padding-left: 0; }
.fact-num {
    display: block;
    font-family: var(--f-head);
    font-weight: 800;
    font-size: 3.6rem;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--c-accent);
    margin-bottom: .8rem;
}
.fact-label { display: block; color: var(--c-muted); font-size: .98rem; line-height: 1.45; }

.fs-latest-more { margin: 2.4rem 0 0; }

.tracks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.track {
    border: 1px solid var(--c-line);
    border-radius: var(--r);
    background: var(--c-white);
    padding: 2rem 1.8rem;
    min-width: 0;
    transition: border-color .2s ease;
}
.track:hover { border-color: var(--c-accent); }
.track-icon { display: block; margin-bottom: 1.4rem; }
.track-title { margin: 0 0 .7rem; font-size: 1.25rem; }
.track-text { margin: 0; color: #4A5568; }

.fs-quote { background: var(--c-navy); padding: 5.5rem 3rem; }
.statement {
    margin: 0 auto;
    max-width: 52rem;
    background: transparent;
    border-left: 4px solid var(--c-accent);
    padding: .4rem 0 .4rem 2.4rem;
}
.statement p {
    margin: 0;
    color: var(--c-white);
    font-family: var(--f-head);
    font-size: 2.3rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    text-align: center;
}

/* ---------- Карточки ---------- */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.6rem; }
.layout-aside .cards-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
    display: flex;
    flex-direction: column;
    background: var(--c-white);
    border: 1px solid var(--c-line);
    border-radius: var(--r);
    overflow: hidden;
    min-width: 0;
    transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: var(--c-accent); transform: translateY(-4px); }
.card-thumb a { display: block; background-image: none; }
.card-thumb img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.card-body { flex: 1; display: flex; flex-direction: column; padding: 1.4rem 1.5rem 1.6rem; min-width: 0; }
.card-meta { font-size: .82rem; color: var(--c-muted); margin-bottom: .6rem; display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.card-meta .meta-cat { color: var(--c-accent); }
.card-title { font-size: 1.2rem; margin: 0 0 .7rem; line-height: 1.3; }
.card-title a { color: var(--c-text); }
.card-title a:hover { color: var(--c-accent); }
.card-excerpt { color: #4A5568; font-size: .97rem; flex: 1; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more { align-self: flex-start; margin-top: 1rem; font-family: var(--f-head); font-weight: 600; font-size: .95rem; }
.empty-state { color: var(--c-muted); }

/* ---------- Запись / страница ---------- */
.entry-meta { color: var(--c-muted); font-size: .9rem; display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.entry-thumb { margin: 0 0 2rem; }
.entry-thumb img { display: block; width: 100%; height: auto; border-radius: var(--r); }
.entry-content { font-size: 1.08rem; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.entry-content li { margin-bottom: .35em; }
.entry-content ul li::marker { color: var(--c-accent); }
.entry-content img { border-radius: var(--r); }
.entry-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2rem; }
.entry-tags a { border: 1px solid var(--c-line); border-radius: var(--r); padding: .3em .8em; font-size: .88rem; background-image: none; }
.entry-tags a:hover { border-color: var(--c-accent); }
.archive-desc { color: var(--c-muted); margin-bottom: 2rem; }

/* ---------- Сайдбар ---------- */
.sidebar {
    background: var(--c-aside);
    border-radius: var(--r);
    padding: 1.8rem 1.6rem;
    min-width: 0;
    margin-top: 1.2rem;
    color: var(--c-text);
}
.sidebar .widget + .widget { margin-top: 2rem; }
.sidebar .widget-title { font-size: 1.1rem; margin: 0 0 1rem; color: var(--c-text); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: .6rem 0; border-bottom: 1px solid #CBD5E0; color: var(--c-text); }
.sidebar li:last-child { border-bottom: 0; }
.sidebar a { color: #1E4E8C; }
.sidebar .post-date { display: block; font-size: .82rem; color: #4A5568; }

/* ---------- Пагинация ---------- */
.pager { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 3rem; align-items: center; }
.pager .page-numbers, .pager > span, .pager > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.6rem;
    height: 2.6rem;
    padding: 0 .9rem;
    border: 1px solid var(--c-line);
    border-radius: var(--r);
    background: var(--c-white);
    background-image: none;
    color: var(--c-text);
    font-family: var(--f-head);
    font-weight: 600;
    font-size: .95rem;
}
.pager a.page-numbers:hover { border-color: var(--c-accent); color: var(--c-accent); }
.pager .page-numbers.current { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-white); }
.pager .page-numbers.dots { border: 0; background: transparent; min-width: auto; padding: 0 .3rem; }

/* ---------- Поиск ---------- */
.search-form { display: flex; gap: .6rem; margin: 1.4rem 0; max-width: 34rem; }
.search-field {
    flex: 1;
    min-width: 0;
    padding: .8em 1em;
    font: inherit;
    border: 1px solid #CBD5E0;
    border-radius: var(--r);
    background: var(--c-white);
    color: var(--c-text);
}
.search-field:focus { border-color: var(--c-accent); outline: none; }
.notfound-code {
    font-family: var(--f-head);
    font-weight: 800;
    font-size: 7rem;
    line-height: 1;
    color: var(--c-accent);
    margin: 1rem 0 0;
    letter-spacing: -0.05em;
}

/* ---------- Комментарии ---------- */
.discussion { margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid var(--c-line); }
.note-list, .note-list .children { list-style: none; margin: 0; padding: 0; }
.note-list .children { padding-left: 1.8rem; }
.note { border: 1px solid var(--c-line); border-radius: var(--r); background: var(--c-white); padding: 1.2rem 1.4rem; margin-bottom: 1rem; }
.note-head { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-bottom: .5rem; }
.note-author { font-family: var(--f-head); font-weight: 600; }
.note-date { color: var(--c-muted); font-size: .85rem; }
.note-wait { color: var(--c-red); font-size: .9rem; }
.note-reply a { font-size: .9rem; font-weight: 600; }
.comment-respond { margin-top: 2rem; }
.comment-form label { display: block; font-family: var(--f-head); font-weight: 600; font-size: .92rem; margin-bottom: .3rem; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
    width: 100%;
    padding: .75em 1em;
    font: inherit;
    border: 1px solid #CBD5E0;
    border-radius: var(--r);
    background: var(--c-white);
}
.comment-form-cookies-consent { display: flex; gap: .5rem; align-items: flex-start; }
.comment-form-cookies-consent label { display: inline; font-weight: 400; font-family: var(--f-body); }
.comment-form .submit {
    font-family: var(--f-head);
    font-weight: 600;
    font-size: 1rem;
    padding: .85em 1.6em;
    background: var(--c-accent);
    color: var(--c-white);
    border: 2px solid var(--c-accent);
    border-radius: var(--r);
    cursor: pointer;
    transition: background-color .2s ease, transform .2s ease;
}
.comment-form .submit:hover { background: var(--c-accent-dark); border-color: var(--c-accent-dark); transform: translateY(-2px); }
.form-note { color: var(--c-muted); font-size: .9rem; }

/* ---------- Подвал ---------- */
.colophon { background: var(--c-navy); color: #CBD5E0; padding: 4rem 0 2rem; position: relative; z-index: 1; }
.colophon-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3rem; }
.colophon-col { min-width: 0; }
.colophon .widget-title { color: var(--c-white); font-size: 1.05rem; margin: 0 0 1rem; }
.colophon .widget-title::before { background: #63B3ED; }
.colophon p, .colophon li, .colophon .textwidget { color: #CBD5E0; font-size: .95rem; }
.colophon a { color: #90CDF4; }
.colophon a:hover { color: var(--c-white); }
.colophon ul { list-style: none; margin: 0; padding: 0; }
.colophon li { padding: .3rem 0; }
.colophon-copy {
    margin: 3rem 0 0;
    padding-top: 1.6rem;
    border-top: 1px solid rgba(255,255,255,.12);
    font-size: .88rem;
    color: #A0AEC0;
}

/* ---------- Cookie ---------- */
.cookie-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    max-width: 960px;
    margin: 0 auto;
    background: var(--c-navy);
    color: #E2E8F0;
    border-left: 4px solid var(--c-accent);
    border-radius: var(--r);
    padding: 1.2rem 1.6rem;
}
.cookie-text { margin: 0; font-size: .92rem; flex: 1; min-width: 0; }
.cookie-accept { flex: 0 0 auto; }

/* ---------- Адаптив ---------- */
@media (max-width: 960px) {
    body::before { display: none; }
    .nav-toggle { display: inline-flex; }
    .site-nav { flex-basis: 100%; }
    .js .site-nav:not(.is-open) { display: none; }
    .nav-list { flex-direction: column; gap: 0; padding: .6rem 0 .4rem; border-top: 1px solid rgba(255,255,255,.12); }
    .nav-list a { padding: .65em 0; }
    .front { width: 92%; }
    .layout-wide { width: 100%; }
    .layout-aside { display: block; }
    .sidebar { margin-top: 3rem; }
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2.2rem; }
    .fact:nth-child(3) { border-left: 0; padding-left: 0; }
    .tracks { grid-template-columns: minmax(0, 1fr); }
    .fs-hero-title { font-size: 2.8rem; }
    .statement p { font-size: 1.9rem; }
    .colophon-grid { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
}
@media (max-width: 600px) {
    body { font-size: 1rem; }
    .brand-desc { display: none; }
    .front { width: 100%; padding-top: 1.5rem; }
    .fs { padding: 3rem 1.4rem; }
    .fs-hero { padding: 3.5rem 1.4rem 2.6rem; min-height: 440px; }
    .fs-quote { padding: 3.5rem 1.4rem; }
    .fs-hero-title { font-size: 2.2rem; }
    .fs-hero-lead { font-size: 1.05rem; }
    .section-title { font-size: 1.6rem; }
    .page-title { font-size: 1.9rem; }
    .cards, .layout-aside .cards-list { grid-template-columns: minmax(0, 1fr); }
    .facts { grid-template-columns: minmax(0, 1fr); }
    .fact { border-left: 0; padding: 0 0 1.4rem; border-bottom: 1px solid var(--c-line); }
    .fact:last-child { border-bottom: 0; padding-bottom: 0; }
    .fact-num { font-size: 3rem; }
    .statement { padding-left: 1.2rem; }
    .statement p { font-size: 1.45rem; }
    .search-form { flex-direction: column; }
    .cookie-banner { flex-direction: column; align-items: stretch; padding: 1.1rem 1.2rem; }
    .notfound-code { font-size: 5rem; }
}
