/*
Theme Name: dds_tefloca.com
Author: Анна Смирнова
Description: Информационная тема для сайта о мягкой подготовке ребёнка к чтению до школы. Природная пастельная гамма, модульная вёрстка, без динамических данных и форм сбора данных.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: tefloca
*/

/* ============================================================
   1. Дизайн-токены
   ============================================================ */
:root {
    --sand: #F9F6F0;
    --sand-soft: #F2ECDF;
    --grass: #8CA97C;
    --grass-deep: #6F8C61;
    --olive: #3A4D38;
    --olive-soft: #4F6549;
    --apricot: #E8BC9A;
    --apricot-soft: #F3D7C0;
    --card: #FFFFFF;
    --line: #E3DCCB;
    --footer-bg: #3A4D38;
    --footer-text: #EDEDE2;
    --footer-muted: #C3CDB8;
    --radius: 12px;
    --radius-lg: 20px;
    --shadow: 0 6px 20px rgba(58, 77, 56, 0.08);
    --shadow-hover: 0 12px 30px rgba(58, 77, 56, 0.16);
    --shell: min(92%, 1180px);
    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;
}

/* ============================================================
   2. Базовая типографика и сброс
   ============================================================ */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--sand);
    color: var(--olive);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.7;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
    font-family: var(--font-display);
    color: var(--olive);
    line-height: 1.25;
    margin: 0 0 0.6em;
    font-weight: 600;
}

h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }

p { margin: 0 0 1.1em; }

a {
    color: var(--grass-deep);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover { color: var(--olive); }

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

ul, ol { padding-left: 1.3em; }

blockquote {
    margin: 1.5em 0;
    padding: 0.6em 1.2em;
    border-left: 4px solid var(--grass);
    background: var(--sand-soft);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
}

code, pre {
    font-family: "SFMono-Regular", Consolas, monospace;
    background: var(--sand-soft);
    border-radius: 6px;
}
code { padding: 0.1em 0.4em; }
pre { padding: 1em; overflow-x: auto; min-width: 0; }

/* Таблицы — видимые границы */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    border: 1px solid var(--line);
}
th, td {
    border: 1px solid var(--line);
    padding: 0.6em 0.9em;
    text-align: left;
}
th { background: var(--sand-soft); }

/* ============================================================
   3. Контейнер ширины (единственное место)
   ============================================================ */
.shell {
    width: var(--shell);
    margin-inline: auto;
}

/* ============================================================
   4. Кнопки
   ============================================================ */
.btn {
    display: inline-block;
    padding: 0.7em 1.5em;
    background: #FFFFFF;
    color: var(--olive);
    border: 1.5px solid var(--grass);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.98rem;
    cursor: pointer;
    transition: box-shadow 0.25s ease, transform 0.25s ease, background 0.25s ease;
}
.btn:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
    background: var(--sand-soft);
    color: var(--olive);
}
.btn-accent {
    background: var(--apricot-soft);
    border-color: var(--apricot);
}

/* ============================================================
   5. Шапка
   ============================================================ */
.site-header {
    background: var(--sand);
    border-bottom: 1px solid var(--line);
    padding: 1.1em 0;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 1.5em;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.9em;
    min-width: 0;
}
.brand-logo,
.brand-svg {
    width: 52px;
    height: 52px;
    flex: none;
    display: block;
}
.brand-text { min-width: 0; }
.brand-name {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--olive);
    line-height: 1.2;
    display: block;
}
.brand-name a { color: inherit; }
.brand-desc {
    font-size: 0.82rem;
    color: var(--olive-soft);
    line-height: 1.4;
    margin-top: 0.2em;
    max-width: 46ch;
}
.header-contact {
    margin-left: auto;
    font-weight: 700;
    white-space: nowrap;
}

.main-nav { width: 100%; }
.nav-toggle {
    display: none;
    background: #FFFFFF;
    border: 1.5px solid var(--grass);
    border-radius: var(--radius);
    padding: 0.5em 0.9em;
    font-family: var(--font-body);
    font-weight: 700;
    color: var(--olive);
    cursor: pointer;
}
.nav-menu {
    list-style: none;
    margin: 0.8em 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em 1.4em;
}
.nav-menu a {
    color: var(--olive);
    font-weight: 700;
    padding: 0.3em 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.nav-menu a:hover,
.nav-menu .current-menu-item > a {
    border-color: var(--grass);
    color: var(--grass-deep);
}

/* ============================================================
   6. Основная раскладка
   ============================================================ */
.site-main { padding: 2.5em 0 3.5em; }

.layout-single { display: block; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 6%;
    align-items: start;
}

.content-area { min-width: 0; }

/* ============================================================
   7. Сайдбар (светлый фон → тёмный текст)
   ============================================================ */
.sidebar {
    min-width: 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.6em;
    box-shadow: var(--shadow);
}
.sidebar .widget { margin-bottom: 1.8em; }
.sidebar .widget:last-child { margin-bottom: 0; }
.sidebar .widget-title,
.sidebar .widgettitle {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--olive);
    margin: 0 0 0.7em;
    padding-bottom: 0.4em;
    border-bottom: 2px solid var(--apricot);
}
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li {
    padding: 0.45em 0;
    border-bottom: 1px dashed var(--line);
}
.sidebar li:last-child { border-bottom: none; }
.sidebar a { color: var(--olive); font-weight: 600; }
.sidebar a:hover { color: var(--grass-deep); }
.sidebar .post-date,
.sidebar .rss-date {
    display: block;
    font-size: 0.8rem;
    color: var(--olive-soft);
}

/* ============================================================
   8. Карточки записей
   ============================================================ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 1.6em;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

/* Вертикальная карточка: миниатюра через aspect-ratio */
.card-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}
.card-thumb-placeholder {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, var(--apricot-soft), var(--grass));
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.3em 1.4em 1.5em;
    min-width: 0;
}
.card-title {
    font-size: 1.25rem;
    margin: 0 0 0.5em;
}
.card-title a { color: var(--olive); }
.card-title a:hover { color: var(--grass-deep); }

.card-meta {
    font-size: 0.82rem;
    color: var(--olive-soft);
    margin-bottom: 0.7em;
}

.card-excerpt { flex: 1; }
.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}

.card-more { margin-top: 1em; align-self: flex-start; }

/* ============================================================
   9. Запись и страница (типографика контента)
   ============================================================ */
.entry {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 2em 2.2em;
    box-shadow: var(--shadow);
    min-width: 0;
}
.entry-header { margin-bottom: 1.2em; }
.entry-meta {
    font-size: 0.85rem;
    color: var(--olive-soft);
    margin-top: 0.3em;
}
.entry-thumb {
    display: block;
    width: 100%;
    border-radius: var(--radius);
    margin-bottom: 1.4em;
    object-fit: cover;
}
.entry-content img { border-radius: var(--radius); }

.layout-single .entry,
.layout-single .page-intro {
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
}

.page-intro { margin-bottom: 1.8em; }

/* ============================================================
   10. Хлебные крошки
   ============================================================ */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--olive-soft);
    margin-bottom: 1.4em;
    line-height: 1.6;
}
.breadcrumbs a { color: var(--grass-deep); font-weight: 600; }
.breadcrumbs .sep { color: var(--grass); margin: 0 0.2em; }

/* ============================================================
   11. Главная страница
   ============================================================ */
.hero {
    background: linear-gradient(160deg, var(--sand) 0%, var(--apricot-soft) 100%);
    border-radius: var(--radius-lg);
    padding: clamp(2em, 5vw, 3.5em);
    margin-bottom: 2.5em;
}
.hero h1 { margin-bottom: 0.4em; }
.hero p { font-size: 1.1rem; max-width: 62ch; }
.hero-actions { margin-top: 1.4em; display: flex; gap: 0.8em; flex-wrap: wrap; }

.section { margin-bottom: 3em; }
.section-lead {
    max-width: 70ch;
    color: var(--olive-soft);
    margin-bottom: 1.5em;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 1.4em;
}
.feature {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.6em;
    box-shadow: var(--shadow);
    min-width: 0;
}
.feature h3 { color: var(--grass-deep); }

.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7em;
    margin-top: 0.4em;
}
.category-chips span {
    background: var(--sand-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.45em 1.1em;
    font-weight: 700;
    font-size: 0.92rem;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 1.4em;
    counter-reset: step;
}
.step {
    background: var(--sand-soft);
    border-radius: var(--radius-lg);
    padding: 1.5em;
    min-width: 0;
    position: relative;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2em;
    height: 2.2em;
    border-radius: 50%;
    background: var(--grass);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 600;
    margin-bottom: 0.6em;
}

/* Слайдер отзывов / цитат */
.quote-slider {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 2em 2.2em 2.4em;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.quote-slide {
    display: none;
}
.quote-slide.is-active { display: block; }
.quote-slide p { font-size: 1.15rem; font-style: italic; }
.quote-slide cite { font-weight: 700; font-style: normal; color: var(--grass-deep); }
.slider-dots {
    display: flex;
    gap: 0.5em;
    margin-top: 1.2em;
}
.slider-dots button {
    width: 12px; height: 12px;
    border-radius: 50%;
    border: none;
    background: var(--line);
    cursor: pointer;
    padding: 0;
}
.slider-dots button.is-active { background: var(--grass); }

/* ============================================================
   12. Пагинация
   ============================================================ */
.pagination {
    margin-top: 2.4em;
    display: flex;
    justify-content: center;
}
.pagination .page-numbers {
    display: inline-block;
    padding: 0.5em 0.95em;
    margin: 0 0.2em;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    color: var(--olive);
    font-weight: 700;
    background: var(--card);
}
.pagination .page-numbers.current {
    background: var(--grass);
    border-color: var(--grass);
    color: #fff;
}
.pagination a.page-numbers:hover {
    border-color: var(--grass);
    color: var(--grass-deep);
}

/* ============================================================
   13. Комментарии
   ============================================================ */
.comments-area {
    margin-top: 2.4em;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.8em 2em;
    box-shadow: var(--shadow);
}
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-list ul.children { list-style: none; padding-left: 1.5em; }
.comment-body {
    border-bottom: 1px dashed var(--line);
    padding: 1em 0;
}
.comment-author { font-weight: 700; }
.comment-meta { font-size: 0.8rem; color: var(--olive-soft); margin-bottom: 0.4em; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.6em 0.8em;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 1rem;
    background: var(--sand);
    margin-top: 0.3em;
}
.comment-form p { margin-bottom: 0.9em; }

/* ============================================================
   14. Форма поиска
   ============================================================ */
.search-form {
    display: flex;
    gap: 0.5em;
    min-width: 0;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 0.6em 0.9em;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 1rem;
    background: var(--card);
}

/* ============================================================
   15. 404
   ============================================================ */
.error-404 {
    text-align: center;
    padding: 2em 0 1em;
}
.error-404 .search-form { max-width: 440px; margin: 1.6em auto 0; }

/* ============================================================
   16. Cookie-баннер
   (правило [hidden] — ДО основного блока, см. A11)
   ============================================================ */
.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--olive);
    color: var(--footer-text);
    padding: 1em 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.18);
}
.cookie-inner {
    display: flex;
    align-items: center;
    gap: 1.2em;
    flex-wrap: wrap;
}
.cookie-banner p { margin: 0; flex: 1; min-width: 0; font-size: 0.92rem; }
.cookie-banner a { color: var(--apricot); }
.cookie-banner .btn {
    background: var(--apricot-soft);
    border-color: var(--apricot);
    color: var(--olive);
}

/* ============================================================
   17. Подвал (тёмный фон → светлый текст виджетов)
   ============================================================ */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    margin-top: 2em;
    padding: 3em 0 1.5em;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    gap: 2em;
}
.footer-col { min-width: 0; }
.footer-col .widget-title,
.footer-col .widgettitle {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: #FFFFFF;
    margin: 0 0 0.8em;
}
.footer-col,
.footer-col p,
.footer-col li,
.footer-col .post-date {
    color: var(--footer-text);
}
.footer-col a { color: var(--apricot); font-weight: 600; }
.footer-col a:hover { color: #FFFFFF; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li {
    padding: 0.4em 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.footer-col li:last-child { border-bottom: none; }
.footer-col .post-date,
.footer-col .rss-date {
    display: block;
    font-size: 0.8rem;
    color: var(--footer-muted);
}

.site-copyright {
    text-align: center;
    margin-top: 2.5em;
    padding-top: 1.4em;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--footer-muted);
    font-size: 0.88rem;
}

/* ============================================================
   18. Адаптив
   ============================================================ */
@media (max-width: 960px) {
    .layout-with-sidebar {
        grid-template-columns: 1fr;
        gap: 2.2em;
    }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .header-inner { gap: 1em; }
    .header-contact { margin-left: 0; width: 100%; }
    .brand-desc { display: none; }

    .nav-toggle { display: inline-block; }
    .nav-menu {
        display: none;
        flex-direction: column;
        gap: 0;
        margin-top: 0.6em;
    }
    .nav-menu.is-open { display: flex; }
    .nav-menu li {
        border-bottom: 1px solid var(--line);
    }
    .nav-menu a { display: block; padding: 0.7em 0; border-bottom: none; }

    .entry { padding: 1.4em 1.3em; }
    .cards-grid { grid-template-columns: 1fr; }
}
