/*
Theme Name: dds_gc-edu.ru
Author: Максим Волков
Description: Информационная тема для образовательной платформы по Data Science, бизнес-аналитике и финансовому моделированию.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: gcedu
*/

/* ===== Tokens ===== */
:root {
    --maxw: 1180px;
    --navy: #0f1f3d;
    --navy-2: #16294d;
    --blue: #2f6df6;
    --blue-2: #4d8bff;
    --teal: #16a394;
    --teal-2: #39d3c3;
    --ink: #1a2433;
    --muted: #5d6b80;
    --line: #e2e8f2;
    --bg: #f6f8fc;
    --card: #ffffff;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(15, 31, 61, 0.08);
}

/* ===== Base ===== */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

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(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; color: var(--navy); margin: 0 0 0.5em; }

p { margin: 0 0 1em; }

.muted { color: var(--muted); }

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--navy);
    color: #fff;
    padding: 10px 16px;
    z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ===== Shell (single width source) ===== */
.shell {
    width: min(92%, var(--maxw));
    margin-inline: auto;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    background: var(--blue);
    color: #fff;
    padding: 12px 22px;
    border-radius: 10px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background .15s ease;
}
.btn:hover { background: var(--navy); color: #fff; text-decoration: none; }

/* ===== Header ===== */
.site-head {
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.head-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 0;
    flex-wrap: wrap;
}
.brand-link { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-link:hover { text-decoration: none; }
.brand-logo { max-height: 56px; width: auto; display: block; }
.brand-mark { flex: 0 0 auto; display: block; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 700; font-size: 1.2rem; color: var(--navy); }
.brand-tag { font-size: .82rem; color: var(--muted); }

.primary-nav { min-width: 0; }
.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.nav-list a {
    display: block;
    padding: 8px 14px;
    color: var(--ink);
    border-radius: 8px;
    font-weight: 500;
}
.nav-list a:hover { background: var(--bg); color: var(--blue); text-decoration: none; }
.nav-list .current-menu-item > a { color: var(--blue); }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}
.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--navy);
    transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Layouts ===== */
.page-wrap { padding: 28px 0 56px; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 2.45fr) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}
.layout-single { display: block; }
.layout-single .content-area {
    max-width: 880px;
    margin-inline: auto;
}
.content-area { min-width: 0; }

/* ===== Breadcrumbs ===== */
.crumbs {
    font-size: .88rem;
    color: var(--muted);
    margin-bottom: 18px;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--blue); }
.crumbs .sep { margin: 0 6px; color: var(--line); }

/* ===== Cards grid ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 26px;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    min-width: 0;
}
.card-thumb { display: block; }
.card-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 22px 22px;
    min-width: 0;
}
.card-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: .8rem;
    color: var(--muted);
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.card-cat a { color: var(--teal); font-weight: 600; }
.card-title { font-size: 1.18rem; margin: 0 0 10px; }
.card-title a { color: var(--navy); }
.card-title a:hover { color: var(--blue); text-decoration: none; }
.card-excerpt { color: var(--ink); font-size: .96rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    padding-top: 12px;
    font-weight: 600;
    color: var(--blue);
}

/* ===== Single / page ===== */
.post-full {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
}
.post-title { font-size: 2rem; }
.post-meta { color: var(--muted); font-size: .9rem; margin-bottom: 8px; display: flex; gap: 14px; flex-wrap: wrap; }
.post-cover { margin: 0 0 22px; border-radius: 10px; overflow: hidden; }
.post-cover img { display: block; width: 100%; }
.post-content { font-size: 1.02rem; }
.post-content img { border-radius: 10px; }
.post-content h2 { margin-top: 1.4em; }
.post-tags { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.post-tags a { display: inline-block; background: var(--bg); padding: 4px 12px; border-radius: 20px; margin: 0 6px 6px 0; font-size: .85rem; }

.list-head { margin-bottom: 26px; }
.page-title { font-size: 1.9rem; }
.list-intro { color: var(--muted); }

/* ===== Tables ===== */
.post-content table { border-collapse: collapse; width: 100%; margin: 1.2em 0; }
.post-content table, .post-content th, .post-content td { border: 1px solid var(--line); }
.post-content th, .post-content td { padding: 10px 12px; text-align: left; }
.post-content th { background: var(--bg); }

/* ===== Sidebar ===== */
.sidebar { min-width: 0; }
.widget {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 24px;
    color: var(--ink);
}
.widget-title { font-size: 1.05rem; margin: 0 0 14px; color: var(--navy); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.widget li:last-child { border-bottom: none; }
.widget a { color: var(--ink); }
.widget a:hover { color: var(--blue); }
.widget .post-date { display: block; font-size: .8rem; color: var(--muted); }

/* ===== Front page ===== */
.front .block { padding: 56px 0; }
.block-title { font-size: 1.7rem; text-align: center; margin-bottom: 34px; }

.block-intro {
    background: linear-gradient(135deg, var(--navy), var(--navy-2));
    color: #eaf0fb;
}
.intro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 44px;
    align-items: center;
}
.intro-title { color: #fff; font-size: 2.4rem; margin-bottom: .4em; }
.intro-copy p { color: #cdd8ee; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; color: var(--teal-2); margin-bottom: 8px; }
.intro-art img { display: block; width: 100%; border-radius: var(--radius); }

.block-dirs { background: #fff; }
.dirs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 24px;
}
.dir {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
    min-width: 0;
    background: var(--bg);
}
.dir-ico { display: inline-flex; padding: 12px; background: #fff; border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 14px; }
.dir h3 { font-size: 1.2rem; }

.block-latest { background: var(--bg); }

.block-steps { background: #fff; }
.steps {
    list-style: none;
    counter-reset: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    gap: 24px;
}
.step {
    position: relative;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    min-width: 0;
}
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font-weight: 700;
    margin-bottom: 12px;
}
.step h3 { font-size: 1.1rem; }

.block-faq {
    background: linear-gradient(135deg, #eef3fc, #e6fbf7);
}
.faq-wrap { max-width: 820px; }
.faq-item {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 6px 20px;
    margin-bottom: 14px;
}
.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--navy);
    padding: 12px 0;
    list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; float: right; color: var(--blue); font-weight: 700; }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { margin: 0 0 14px; color: var(--ink); }

/* ===== Pagination (type=plain → .page-numbers) ===== */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 40px;
}
.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font-weight: 600;
}
.pager a.page-numbers:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.pager .page-numbers.current { background: var(--blue); border-color: var(--blue); color: #fff; }
.pager .page-numbers.dots { border: none; background: none; }

/* ===== Comments ===== */
.comments {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    margin-top: 28px;
    box-shadow: var(--shadow);
}
.comments-title { font-size: 1.3rem; }
.comment-list { list-style: none; margin: 0 0 20px; padding: 0; }
.comment-list ol { list-style: none; padding-left: 24px; }
.comment-item { margin-bottom: 18px; }
.comment-inner { border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.comment-head { display: flex; gap: 12px; align-items: baseline; margin-bottom: 6px; }
.comment-author { font-weight: 600; }
.comment-date { font-size: .8rem; color: var(--muted); }

.search-form { width: 100%; }
.search-row { display: flex; gap: 8px; }
.search-input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
}
.search-submit {
    border: none;
    background: var(--blue);
    color: #fff;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    margin-top: 4px;
}
.comment-form p { margin-bottom: 14px; }

.error-404 { text-align: center; }

/* ===== Footer ===== */
.site-foot { background: var(--navy); color: #c7d2e6; margin-top: 40px; }
.foot-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 36px;
    padding: 52px 0;
}
.foot-col { min-width: 0; }
.foot-col .widget {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    color: #c7d2e6;
}
.foot-col .widget-title { color: #fff; }
.foot-col .widget a { color: #aebfdb; }
.foot-col .widget a:hover { color: var(--teal-2); }
.foot-col .widget li { border-bottom-color: rgba(255, 255, 255, .08); }
.foot-col .widget .post-date { color: #8294b6; }
.foot-base { border-top: 1px solid rgba(255, 255, 255, .1); }
.copyright { padding: 18px 0; margin: 0; font-size: .88rem; color: #97a7c6; }

/* ===== Cookie banner (hidden rule BEFORE main block) ===== */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--navy);
    color: #eaf0fb;
    z-index: 90;
    box-shadow: 0 -6px 24px rgba(0, 0, 0, .2);
}
.cookie-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 0;
    flex-wrap: wrap;
}
.cookie-text { margin: 0; flex: 1; min-width: 220px; font-size: .9rem; }
.cookie-accept {
    border: none;
    background: var(--teal);
    color: #fff;
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.cookie-accept:hover { background: var(--teal-2); color: var(--navy); }

/* ===== Responsive ===== */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: minmax(0, 1fr); }
    .intro-grid { grid-template-columns: minmax(0, 1fr); }
    .intro-title { font-size: 2rem; }
}

@media (max-width: 600px) {
    .nav-toggle { display: flex; }
    .primary-nav {
        flex-basis: 100%;
        display: none;
    }
    .primary-nav.is-open { display: block; }
    .nav-list { flex-direction: column; gap: 2px; }
    .front .block { padding: 40px 0; }
    .post-full { padding: 22px; }
    .post-title { font-size: 1.6rem; }
}
