/*
Theme Name: dds_shrift.su
Author: Анна Шилова
Description: Информационная тема для образовательного портала копирайтеров и контент-маркетологов. Японский минимализм, асимметрия, фиолетово-графитовая палитра.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: shrift
*/

/* ============ ПЕРЕМЕННЫЕ ============ */
:root {
    --bg:        #F8F6FC;
    --bg-alt:    #EFEBF5;
    --bg-side:   #F3F0F8;
    --bg-foot:   #1A1829;
    --text:      #1E1A2B;
    --accent:    #7C4DFF;
    --accent-2:  #B39DDB;
    --muted:     #9A92A8;
    --line:      #DCD6E5;
    --font-head: "Futura", "Century Gothic", "Trebuchet MS", "Segoe UI", sans-serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ============ БАЗА ============ */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.7;
    color: var(--text);
    background-color: var(--bg);
    background-image: radial-gradient(var(--line) 1px, transparent 1px);
    background-size: 26px 26px;
    overflow-x: hidden;
}

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

a { color: var(--accent); text-decoration: none; }

h1, h2, h3, h4 {
    font-family: var(--font-head);
    color: var(--text);
    line-height: 1.15;
    margin: 0 0 0.6em;
}

p { margin: 0 0 1em; }

.shell { width: min(92%, 1180px); margin-inline: auto; }

/* ============ КНОПКИ ============ */
.btn {
    display: inline-block;
    font-family: var(--font-head);
    font-size: 0.92rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.85em 1.8em;
    border-radius: 2px;
    border: 2px solid var(--accent);
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { transform: translate(2px, 2px); background: var(--text); border-color: var(--text); color: #fff; }
.btn-outline { background: transparent; color: var(--accent); }
.btn-outline:hover { transform: translate(2px, 2px); background: var(--accent); color: #fff; }

/* Анимированное подчёркивание текстовых ссылок в контенте */
.single-content a:not(.btn),
.widget a {
    position: relative;
}
.single-content a:not(.btn)::after {
    content: "";
    position: absolute;
    left: 50%; right: 50%; bottom: -2px;
    height: 2px;
    background: var(--accent);
    transition: left 0.2s ease, right 0.2s ease;
}
.single-content a:not(.btn):hover::after { left: 0; right: 0; }

/* ============ ШАПКА ============ */
.site-header {
    background: transparent;
    padding: 1.4rem 0;
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(4px);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.9rem; min-width: 0; }
.brand-link { display: block; line-height: 0; flex: none; }
.brand-logo { max-height: 54px; width: auto; display: block; }
.brand-mark svg { display: block; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    color: var(--text);
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.brand-desc {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.35;
    margin-top: 0.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.primary-nav .nav-list {
    list-style: none;
    display: flex;
    gap: 1.6rem;
    margin: 0; padding: 0;
    flex-wrap: wrap;
}
.primary-nav a {
    font-family: var(--font-head);
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    color: var(--text);
    position: relative;
    padding-bottom: 3px;
}
.primary-nav a::after {
    content: "";
    position: absolute;
    left: 50%; right: 50%; bottom: 0;
    height: 2px;
    background: var(--accent);
    transition: left 0.2s ease, right 0.2s ease;
}
.primary-nav a:hover::after,
.primary-nav .current-menu-item > a::after { left: 0; right: 0; }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px; height: 42px;
    background: none;
    border: 2px solid var(--text);
    border-radius: 2px;
    cursor: pointer;
    padding: 0 8px;
}
.nav-toggle span { display: block; height: 2px; background: var(--text); transition: 0.2s; }
.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); }

/* ============ ОСНОВНОЙ КОНТЕЙНЕР ============ */
.site-main { display: block; padding: 2.5rem 0 4rem; }

.breadcrumbs {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 1.8rem;
    padding-top: 0.5rem;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { margin: 0 0.4rem; color: var(--accent-2); }
.breadcrumbs span { color: var(--text); }

/* Раскладки */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 6%;
    align-items: start;
}
.layout-single .content-area {
    width: 85%;
    margin-inline: auto;
}

/* ============ САЙДБАР ============ */
.sidebar {
    background: var(--bg-side);
    border-left: 2px solid var(--accent);
    padding: 1.6rem 1.6rem;
    color: var(--text);
}
.sidebar .widget { margin-bottom: 2rem; }
.sidebar .widget:last-child { margin-bottom: 0; }
.sidebar .widget-title {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text);
    padding-left: 0.7rem;
    border-left: 3px solid var(--accent);
    margin-bottom: 1rem;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.sidebar li:last-child { border-bottom: none; }
.sidebar a { color: var(--text); }
.sidebar a:hover { color: var(--accent); }
.sidebar .post-date { display: block; font-size: 0.78rem; color: var(--muted); }

/* ============ КАРТОЧКИ ЗАПИСЕЙ ============ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.8rem;
}
.cards-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.8rem;
}

.card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 0;
    overflow: hidden;
    transition: transform 0.18s ease, border-color 0.18s ease;
}
.card:hover { border-color: var(--accent); transform: translateX(-6px); }

.card-thumb { display: block; overflow: hidden; }
.card-thumb a { display: block; }
.card-thumb img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    filter: grayscale(0.25) saturate(1.05);
}
.card-body {
    flex: 1;
    padding: 1.4rem 1.5rem 1.6rem;
    display: flex;
    flex-direction: column;
}
.card-meta { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.5rem; }
.card-title {
    font-size: 1.3rem;
    line-height: 1.25;
    margin: 0 0 0.6rem;
}
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); }
.card-excerpt { color: #46415a; font-size: 0.95rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    padding-top: 0.8rem;
    font-family: var(--font-head);
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent);
}
.card-more:hover { color: var(--text); }

/* ============ ГЛАВНАЯ ============ */
.front { display: block; }
.fs { position: relative; padding: 4.5rem 0; overflow: hidden; }
.fs-alt { background: var(--bg-alt); }
.fs-title {
    font-size: 2.1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-left: 1rem;
    border-left: 4px solid var(--accent);
    margin-bottom: 2.2rem;
}
.grad {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.accent { color: var(--accent); }

/* Blob-пятна */
.blob {
    position: absolute;
    width: 420px; height: 420px;
    background: var(--accent-2);
    border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%;
    filter: blur(70px);
    opacity: 0.35;
    z-index: 0;
    pointer-events: none;
}
.blob-hero { top: -120px; right: -80px; }
.blob-quote { bottom: -140px; left: -100px; opacity: 0.28; }

/* Hero */
.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 60px;
    gap: 2rem;
    align-items: center;
}
.hero-kicker {
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 1.4rem;
}
.hero-title {
    font-size: 4.2rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin: 0 0 1.4rem;
    margin-left: -2px;
}
.hero-lead {
    font-size: 1.15rem;
    max-width: 620px;
    color: #3b3550;
    margin-bottom: 2rem;
}
.hero-side { display: flex; justify-content: center; }
.hero-vertical {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 0.85rem;
    color: var(--accent-2);
}

/* Сетка направлений */
.dirs-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.8rem;
}
.dir-card {
    background: var(--bg);
    border: 1px solid var(--line);
    padding: 2rem 1.8rem;
    transition: transform 0.18s ease, border-color 0.18s ease;
}
.dir-card:hover { transform: translateY(6px); border-color: var(--accent); }
.dir-ico { display: block; margin-bottom: 1.2rem; }
.dir-title {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-variant: small-caps;
    margin-bottom: 0.7rem;
}
.dir-card p { font-size: 0.95rem; color: #46415a; margin: 0; }

/* Свежие записи */
.fs-cta-inline { margin-top: 2.2rem; }

/* Таймлайн */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
    content: "";
    position: absolute;
    left: 7px; top: 6px; bottom: 6px;
    width: 0;
    border-left: 2px dotted var(--accent);
}
.tl-item {
    position: relative;
    padding-left: 2.6rem;
    margin-bottom: 2rem;
}
.tl-item:last-child { margin-bottom: 0; }
.tl-dot {
    position: absolute;
    left: 0; top: 4px;
    width: 16px; height: 16px;
    border-radius: 50%;
    border: 3px solid var(--bg-alt);
}
.tl-dot-1 { background: var(--accent-2); }
.tl-dot-2 { background: #9a7de0; }
.tl-dot-3 { background: #8a63e6; }
.tl-dot-4 { background: var(--accent); }
.tl-stage {
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.3rem;
}
.tl-body p { margin: 0; color: #3b3550; }

/* Цитата */
.fs-quote { padding: 5rem 0; }
.quote-wrap { position: relative; z-index: 1; }
.quote {
    position: relative;
    margin: 0;
    padding: 0.5rem 0 0.5rem 2.4rem;
    border-left: 8px solid var(--accent);
    max-width: 900px;
}
.quote-text {
    font-family: var(--font-head);
    font-size: 2rem;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text);
    margin: 0 0 1.2rem;
}
.quote-sign {
    text-align: right;
    font-size: 0.9rem;
    color: var(--muted);
    letter-spacing: 0.05em;
}

/* ============ ЗАПИСЬ / СТРАНИЦА ============ */
.page-head { margin-bottom: 2rem; }
.page-title {
    font-size: 2.2rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding-left: 1rem;
    border-left: 4px solid var(--accent);
}
.single-title {
    font-size: 2.4rem;
    letter-spacing: 0.01em;
    margin-bottom: 0.8rem;
}
.single-meta { font-size: 0.85rem; color: var(--muted); margin-bottom: 1.5rem; }
.single-meta a { color: var(--accent); }
.single-meta .meta-cats { margin-left: 0.8rem; }
.single-thumb { margin: 0 0 2rem; }
.single-thumb img { width: 100%; display: block; }
.single-content { font-size: 1.05rem; }
.single-content h2 { font-size: 1.7rem; margin-top: 2rem; }
.single-content h3 { font-size: 1.35rem; margin-top: 1.6rem; }
.single-content img { display: block; margin: 1.4rem 0; }
.single-content blockquote {
    margin: 1.6rem 0;
    padding: 1.2rem 1.6rem;
    background: var(--bg-alt);
    border-left: 5px solid var(--accent);
    border-radius: 0 4px 4px 0;
}
.single-content blockquote p { margin: 0; }
.single-content ul, .single-content ol { padding-left: 1.4rem; }
.single-content code {
    background: var(--bg-alt);
    padding: 0.15em 0.4em;
    border-radius: 2px;
    font-size: 0.92em;
}
.single-content pre {
    background: var(--text);
    color: #F8F6FC;
    padding: 1.2rem;
    overflow-x: auto;
    border-radius: 3px;
}
.single-tags { margin-top: 2rem; }
.single-tags a {
    display: inline-block;
    font-size: 0.8rem;
    padding: 0.25em 0.7em;
    margin: 0 0.3rem 0.4rem 0;
    border: 1px solid var(--line);
    color: var(--muted);
    border-radius: 2px;
}
.single-tags a:hover { border-color: var(--accent); color: var(--accent); }

/* Таблицы в контенте */
.single-content table { border-collapse: collapse; width: 100%; margin: 1.4rem 0; }
.single-content table, .single-content th, .single-content td { border: 1px solid var(--line); }
.single-content th, .single-content td { padding: 0.6rem 0.8rem; text-align: left; }
.single-content th { background: var(--bg-alt); }

/* ============ ПАГИНАЦИЯ ============ */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 3rem;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 0.7rem;
    border: 1px solid var(--line);
    border-radius: 2px;
    font-family: var(--font-head);
    color: var(--text);
    transition: 0.15s;
}
.pagination a.page-numbers:hover { border-color: var(--accent); color: var(--accent); }
.pagination .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.pagination .page-numbers.dots { border: none; }

/* ============ ПОИСК / 404 ============ */
.search-form { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }
.search-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.search-field {
    flex: 1;
    min-width: 0;
    padding: 0.7em 1em;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: #fff;
    font: inherit;
}
.search-field:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.search-submit {
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.7em 1.6em;
    border: 2px solid var(--accent);
    background: var(--accent);
    color: #fff;
    border-radius: 2px;
    cursor: pointer;
}
.search-submit:hover { background: var(--text); border-color: var(--text); }

.error-404 { text-align: center; padding: 2rem 0; }
.error-code {
    font-size: 6rem;
    color: var(--accent);
    letter-spacing: 0.05em;
    margin: 0;
}
.error-title { font-family: var(--font-head); font-size: 1.6rem; text-transform: uppercase; letter-spacing: 0.04em; }
.error-text { color: #46415a; max-width: 520px; margin: 0 auto 1.5rem; }
.error-404 .search-form { max-width: 480px; margin: 0 auto 1.5rem; }

.no-posts { padding: 2rem 0; color: var(--muted); }

/* ============ КОММЕНТАРИИ ============ */
.comments-area { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.comments-title { font-size: 1.4rem; text-transform: uppercase; letter-spacing: 0.03em; }
.comment-list { list-style: none; margin: 0 0 2rem; padding: 0; }
.comment-list ol.children { list-style: none; margin: 1rem 0 0; padding-left: 1.5rem; border-left: 2px solid var(--line); }
.comment-inner { padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
.comment-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
.comment-author { font-family: var(--font-head); font-weight: 700; }
.comment-date { font-size: 0.8rem; color: var(--muted); }
.comment-await { font-size: 0.85rem; color: var(--accent); }
.comment-reply a { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.comment-respond {
    margin-top: 1.5rem;
    background: var(--bg-side);
    border: 1px solid var(--line);
    padding: 1.6rem 1.8rem;
    border-radius: 0;
}
.comment-form-comment textarea,
.comment-form-author input,
.comment-form-email input,
.comment-form-url input {
    width: 100%;
    padding: 0.6em 0.8em;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: #fff;
    font: inherit;
    margin-top: 0.3rem;
}
.comment-form .form-submit input {
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.7em 1.8em;
    border: 2px solid var(--accent);
    background: var(--accent);
    color: #fff;
    border-radius: 2px;
    cursor: pointer;
}
.comment-form .form-submit input:hover { background: var(--text); border-color: var(--text); }

/* ============ ПОДВАЛ ============ */
.site-footer { background: var(--bg-foot); color: #cfc9dd; padding: 3.5rem 0 2rem; margin-top: 2rem; }
.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
}
.footer-col .widget { margin-bottom: 1.5rem; }
.footer-col .widget-title {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
    margin-bottom: 1rem;
    padding-left: 0.7rem;
    border-left: 3px solid var(--accent);
}
.footer-col, .footer-col p { color: #cfc9dd; }
.footer-col a { color: #d9d3e8; }
.footer-col a:hover { color: var(--accent-2); }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { padding: 0.35rem 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.footer-col li:last-child { border-bottom: none; }
.footer-col .post-date { display: block; font-size: 0.78rem; color: #8f88a3; }
.footer-bottom { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.1); }
.copyright { font-size: 0.85rem; color: #8f88a3; margin: 0; }

/* ============ COOKIE-БАННЕР ============ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--text);
    color: #F8F6FC;
    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.5rem;
    flex-wrap: wrap;
}
.cookie-text { margin: 0; font-size: 0.9rem; flex: 1; min-width: 240px; }
.cookie-accept {
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.6em 1.8em;
    border: 2px solid var(--accent);
    background: var(--accent);
    color: #fff;
    border-radius: 2px;
    cursor: pointer;
    flex: none;
}
.cookie-accept:hover { background: #fff; color: var(--text); border-color: #fff; }

/* ============ АДАПТИВ ============ */
@media (max-width: 960px) {
    .hero-title { font-size: 3.2rem; }
    .layout-with-sidebar { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
    .sidebar { border-left: none; border-top: 2px solid var(--accent); }
    .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dirs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .nav-toggle { display: flex; }
    .primary-nav {
        flex-basis: 100%;
        display: none;
    }
    .primary-nav.is-open { display: block; }
    .primary-nav .nav-list { flex-direction: column; gap: 0.4rem; margin-top: 1rem; }

    .fs { padding: 3rem 0; }
    .fs-title { font-size: 1.6rem; }
    .hero-grid { grid-template-columns: minmax(0, 1fr); }
    .hero-side { display: none; }
    .hero-title { font-size: 2.4rem; }
    .hero-lead { font-size: 1.05rem; }

    .cards-grid { grid-template-columns: minmax(0, 1fr); }
    .dirs-grid { grid-template-columns: minmax(0, 1fr); }
    .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 1.8rem; }

    .layout-single .content-area { width: 100%; }

    .single-title { font-size: 1.8rem; }
    .quote-text { font-size: 1.4rem; }
    .quote { padding-left: 1.4rem; border-left-width: 6px; }
    .error-code { font-size: 4rem; }

    .cookie-inner { flex-direction: column; align-items: flex-start; }
}
