/*
Theme Name: dds_cristophestyling.com
Author: Дарья Ветрова
Description: Информационный онлайн-журнал о технологиях стиля, красоты и умного гардероба.
Version: 1.1
Text Domain: cstyle
Requires at least: 6.0
Requires PHP: 8.0
*/

/* ===== Переменные ===== */
:root {
    --ink: #1c1d29;
    --ink-soft: #4a4d63;
    --muted: #7a7e95;
    --line: #e3e4ed;
    --bg: #ffffff;
    --bg-soft: #f5f5fb;
    --accent: #6b4ef0;
    --accent-2: #14b8c4;
    --accent-ink: #ffffff;
    --footer-bg: #16172a;
    --footer-ink: #d9daf0;
    --footer-muted: #9a9cc0;
    --radius: 14px;
    --shadow: 0 6px 24px rgba(28, 29, 41, 0.08);
}

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

html { scroll-behavior: smooth; }

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

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

p { margin: 0 0 1em; }

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

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

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

.screen-reader-text {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

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

/* ===== Кнопки ===== */
.btn-primary {
    display: inline-block;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: var(--accent-ink);
    padding: 12px 24px;
    border-radius: 999px;
    border: 0;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary:hover {
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
    color: var(--accent-ink);
}

/* ===== Шапка ===== */
.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 0;
    flex-wrap: wrap;
}
.brand { display: flex; flex-direction: column; min-width: 0; }
.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
}
.brand-link:hover { text-decoration: none; }
.brand-logo, .brand-mark { display: block; height: 48px; width: auto; }
.brand-name { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.01em; }
.brand-tagline { margin: 6px 0 0; color: var(--muted); font-size: 0.85rem; }

.nav-toggle {
    display: none;
    margin-left: auto;
    width: 44px; height: 44px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}
.nav-toggle-bar {
    display: block;
    width: 20px; height: 2px;
    background: var(--ink);
}

.primary-nav { margin-left: auto; }
.primary-menu {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
}
.primary-menu a {
    color: var(--ink-soft);
    font-weight: 600;
    padding: 6px 0;
}
.primary-menu a:hover { color: var(--accent); text-decoration: none; }
.primary-menu .current-menu-item > a { color: var(--accent); }

/* ===== Основная область ===== */
.site-main { padding: 36px 0 56px; }
.home-wrap { width: 85%; margin-inline: auto; }

.page-shell { padding-top: 8px; }

.breadcrumbs {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 22px;
}
.breadcrumbs a { color: var(--ink-soft); }
.breadcrumbs .sep { margin: 0 6px; color: var(--line); }

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

.sidebar { min-width: 0; }

/* ===== Заголовки секций главной ===== */
.section-heading {
    font-size: 1.7rem;
    margin-bottom: 6px;
}
.section-sub {
    color: var(--muted);
    margin-bottom: 26px;
}

/* ===== Блок 1: интро ===== */
.intro-block {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 40px;
    align-items: center;
    padding: 30px 0 56px;
}
.intro-kicker {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 10px;
}
.intro-title { font-size: 2.4rem; letter-spacing: -0.02em; }
.intro-lead { color: var(--ink-soft); font-size: 1.08rem; }
.intro-media img {
    display: block;
    width: 100%;
    border-radius: var(--radius);
}

/* ===== Блок 2: рубрики ===== */
.topics-block { padding: 24px 0 56px; }
.topics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}
.topic-card {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 20px;
    min-width: 0;
}
.topic-icon { color: var(--accent); display: inline-flex; margin-bottom: 12px; }
.topic-card h3 { font-size: 1.1rem; }
.topic-card p { color: var(--ink-soft); margin: 0; font-size: 0.95rem; }

/* ===== Последние записи / списки карточек ===== */
.latest-block { padding: 24px 0 56px; }
.latest-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}
.post-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 26px;
    margin-bottom: 36px;
}

/* Карточка записи */
.card {
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.latest-grid .card,
.post-list .card { min-width: 0; }

.card-thumb-wrap {
    overflow: hidden;
}
.card-thumb-wrap a { display: block; }
.card-thumb-wrap img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    min-width: 0;
}
.card-title { font-size: 1.2rem; margin-bottom: 8px; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-meta { color: var(--muted); font-size: 0.82rem; margin-bottom: 10px; }
.card-excerpt { color: var(--ink-soft); }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    align-self: flex-start;
    font-weight: 600;
    padding-top: 8px;
}

/* В списке блога — горизонтальные карточки на десктопе */
.post-list .card {
    flex-direction: row;
}
.post-list .card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
}
.post-list .card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.post-list .card-thumb-wrap img {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
}

/* ===== Блок 3: шаги ===== */
.steps-block { padding: 24px 0 56px; }
.steps-list {
    list-style: none;
    margin: 0; padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    counter-reset: step;
}
.step-item {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 20px;
    min-width: 0;
}
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: #fff;
    font-weight: 700;
    margin-bottom: 12px;
}
.step-item h3 { font-size: 1.05rem; }
.step-item p { color: var(--ink-soft); margin: 0; font-size: 0.95rem; }

/* ===== Блок 4: галерея ===== */
.gallery-block { padding: 24px 0 24px; }
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.gallery-item {
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    min-width: 0;
}
.gallery-item img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}
.gallery-item figcaption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 10px 12px;
    background: linear-gradient(to top, rgba(22,23,42,0.78), rgba(22,23,42,0));
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ===== Архив / страница / запись ===== */
.archive-head { margin-bottom: 24px; }
.page-title { font-size: 2rem; }
.archive-desc { color: var(--ink-soft); }
.blog-intro { color: var(--ink-soft); }

.single-thumb {
    margin-bottom: 24px;
    border-radius: var(--radius);
    overflow: hidden;
}
.single-thumb img { display: block; width: 100%; height: auto; }
.single-meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 16px; }
.single-content { font-size: 1.05rem; }
.single-content img { border-radius: 10px; }
.single-tags { margin-top: 24px; }
.single-tags a {
    display: inline-block;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 14px;
    margin: 0 6px 6px 0;
    font-size: 0.85rem;
}

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

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

/* ===== Пагинация (type => plain → .page-numbers) ===== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 0;
}
.pagination .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;
    color: var(--ink-soft);
    font-weight: 600;
    background: var(--bg);
}
.pagination a.page-numbers:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}
.pagination .page-numbers.current {
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    border-color: transparent;
    color: #fff;
}
.pagination .page-numbers.dots {
    border: 0;
    background: none;
}

/* ===== Комментарии ===== */
.comments-area { margin-top: 48px; }
.comments-title { font-size: 1.4rem; }
.comment-list {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
}
.comment-list ol { list-style: none; padding-left: 24px; }
.comment-item { margin-bottom: 18px; }
.comment-inner {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 20px;
}
.comment-meta { display: flex; gap: 12px; align-items: baseline; margin-bottom: 8px; }
.comment-author { font-weight: 700; }
.comment-date { color: var(--muted); font-size: 0.8rem; }
.comment-reply a { font-size: 0.85rem; font-weight: 600; }

.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 label { display: block; margin-bottom: 12px; font-weight: 600; }
.comment-form textarea { min-height: 120px; }

/* ===== Форма поиска ===== */
.search-form {
    display: flex;
    gap: 10px;
    margin: 16px 0;
}
.search-field {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
}
.search-submit {
    padding: 10px 20px;
    border: 0;
    border-radius: 10px;
    background: var(--ink);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

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

/* ===== Подвал (тёмный фон → светлый текст) ===== */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-ink);
    margin-top: 60px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px;
    padding: 48px 0;
}
.footer-col { min-width: 0; }
.footer-col .widget { margin-bottom: 0; color: var(--footer-ink); }
.footer-col .widget-title {
    color: #fff;
    font-size: 1.05rem;
    margin-bottom: 14px;
}
.footer-col .widget,
.footer-col .widget p,
.footer-col .widget li { color: var(--footer-ink); }
.footer-col .widget a { color: #fff; }
.footer-col .widget a:hover { color: var(--accent-2); text-decoration: none; }
.footer-col .widget ul {
    list-style: none;
    margin: 0; padding: 0;
}
.footer-col .widget li {
    padding: 6px 0;
}
.footer-col .post-date { color: var(--footer-muted); font-size: 0.8rem; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
}
.copyright {
    margin: 0;
    color: var(--footer-muted);
    font-size: 0.85rem;
    text-align: center;
}

/* ===== Cookie-баннер ===== */
.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: var(--ink);
    color: #fff;
    z-index: 900;
    box-shadow: 0 -6px 24px rgba(0,0,0,0.18);
}
.cookie-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 0;
    flex-wrap: wrap;
}
.cookie-text { margin: 0; flex: 1; min-width: 240px; font-size: 0.9rem; color: #e8e8f4; }
.cookie-accept {
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 10px 26px;
    font-weight: 600;
    cursor: pointer;
}

/* ===== 404 ===== */
.error-404 { text-align: center; padding: 30px 0 40px; }
.error-404 .search-form { max-width: 460px; margin-inline: auto; }
.error-text { color: var(--ink-soft); }

/* ===== Адаптив ===== */
@media (max-width: 960px) {
    .home-wrap, .layout-single { width: 92%; }

    .layout-with-sidebar {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .intro-block { grid-template-columns: 1fr; gap: 28px; }
    .intro-title { font-size: 2rem; }
    .topics-grid,
    .steps-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .latest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .nav-toggle { display: inline-flex; }
    .primary-nav {
        flex-basis: 100%;
        margin-left: 0;
        display: none;
    }
    .primary-nav.is-open { display: block; }
    .primary-menu {
        flex-direction: column;
        gap: 0;
        margin-top: 12px;
    }
    .primary-menu li { border-top: 1px solid var(--line); }
    .primary-menu a { display: block; padding: 12px 0; }

    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 600px) {
    .topics-grid,
    .steps-list,
    .latest-grid,
    .gallery-grid { grid-template-columns: 1fr; }

    .intro-title { font-size: 1.7rem; }
    .page-title { font-size: 1.6rem; }
    .section-heading { font-size: 1.4rem; }

    /* Горизонтальные карточки списка → вертикальные */
    .post-list .card { flex-direction: column; }
    .post-list .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
    .post-list .card-thumb-wrap a { position: static; }
    .post-list .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
}
