/*
Theme Name: dds_tinymegaphone.com
Author: Виктория Ларина
Description: Информационная тема о контент-маркетинге: заголовки, структура текста, аргументация и тон общения с аудиторией. Русскоязычный текстовый сайт без каталога товаров.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: tmega
*/

/* =========================================================
   Переменные и база
   ========================================================= */
:root {
    --ink: #20242e;
    --ink-soft: #4a5162;
    --muted: #7b8296;
    --line: #e7e1d7;
    --paper: #fbf9f5;
    --paper-2: #f3efe7;
    --white: #ffffff;
    --accent: #e2563c;
    --accent-dark: #c0432c;
    --accent-tint: #fbe7e1;
    --deep: #232838;
    --deep-2: #2c3346;
    --shell: 1180px;
    --radius: 12px;
    --shadow: 0 6px 24px rgba(32, 36, 46, 0.07);
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.7;
    color: var(--ink);
    background: var(--paper);
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.25;
    color: var(--ink);
    margin: 0 0 0.5em;
    font-weight: 700;
}

h1 { font-size: 2.1rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }

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

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

/* Единственный контейнер ширины (A12.7) */
.shell {
    width: min(92%, var(--shell));
    margin-inline: auto;
}

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

/* =========================================================
   Шапка
   ========================================================= */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    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: 0.85rem;
    min-width: 0;
}

.brand-logo { display: block; }

.brand-mark { display: block; flex: 0 0 auto; }

.brand-text { min-width: 0; }

.brand-title {
    font-family: Georgia, serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
    display: block;
}
.brand-title a { color: inherit; }
.brand-title a:hover { text-decoration: none; color: var(--accent-dark); }

.brand-desc {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.4;
    margin-top: 0.2rem;
    max-width: 42ch;
}

/* Навигация */
.nav-toggle {
    display: none;
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
    font-size: 0.95rem;
    color: var(--ink);
    cursor: pointer;
    align-items: center;
    gap: 0.5rem;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.4rem;
}

.main-nav a {
    color: var(--ink-soft);
    font-size: 0.98rem;
    font-weight: 600;
    padding: 0.35rem 0;
    display: inline-block;
    border-bottom: 2px solid transparent;
}
.main-nav a:hover { color: var(--accent-dark); text-decoration: none; border-bottom-color: var(--accent); }
.main-nav .current-menu-item > a { color: var(--accent-dark); border-bottom-color: var(--accent); }

/* =========================================================
   Хлебные крошки
   ========================================================= */
.crumbs {
    font-size: 0.85rem;
    color: var(--muted);
    padding: 1rem 0 0;
}
.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--accent-dark); }
.crumbs .sep { color: var(--line); margin: 0 0.15rem; }

/* =========================================================
   Раскладки контента
   ========================================================= */
.site-main { padding: 1.5rem 0 3rem; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
    gap: 2.5rem;
    align-items: start;
}

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

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

.sidebar { min-width: 0; }

/* Страницы 85% ширины без сайдбара */
.layout-single.width-wide {
    width: min(85%, var(--shell));
    margin-inline: auto;
}
@media (max-width: 640px) {
    .layout-single.width-wide { width: 92%; }
}

/* =========================================================
   Одиночная запись / страница
   ========================================================= */
.entry {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2rem 2.2rem;
    box-shadow: var(--shadow);
}

.entry-header { margin-bottom: 1.2rem; }
.entry-title { font-size: 2rem; margin-bottom: 0.4rem; }

.entry-meta {
    font-size: 0.85rem;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.9rem;
    align-items: center;
}
.entry-meta a { color: var(--accent-dark); }
.entry-cat a { font-weight: 600; }

.entry-thumb {
    margin: 0 0 1.5rem;
    border-radius: 10px;
    overflow: hidden;
}
.entry-thumb img { display: block; width: 100%; height: auto; }

.entry-content { font-size: 1.03rem; }
.entry-content h2 { margin-top: 1.6em; }
.entry-content h3 { margin-top: 1.4em; }
.entry-content img { border-radius: 8px; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li { margin-bottom: 0.4em; }
.entry-content blockquote {
    margin: 1.5em 0;
    padding: 1.1rem 1.4rem;
    background: var(--paper-2);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    font-style: italic;
    color: var(--ink-soft);
}
.entry-content blockquote p:last-child { margin-bottom: 0; }

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.95rem;
}
.entry-content table,
.entry-content th,
.entry-content td {
    border: 1px solid var(--line);
}
.entry-content th, .entry-content td { padding: 0.6rem 0.8rem; text-align: left; }
.entry-content th { background: var(--paper-2); font-family: Georgia, serif; }

.entry-tags { margin-top: 1.8rem; font-size: 0.88rem; color: var(--muted); }
.entry-tags a {
    display: inline-block;
    background: var(--paper-2);
    color: var(--ink-soft);
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    margin: 0.2rem 0.3rem 0.2rem 0;
    font-size: 0.82rem;
}
.entry-tags a:hover { background: var(--accent-tint); color: var(--accent-dark); text-decoration: none; }

/* =========================================================
   Карточки записей (A8, A10 — вертикальные, aspect-ratio)
   ========================================================= */
.cards-grid {
    display: grid;
    gap: 1.6rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.cards-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    min-width: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(32,36,46,0.1); }

.card-thumb {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--paper-2);
}
.card-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-thumb--empty {
    background: linear-gradient(135deg, var(--deep) 0%, var(--accent-dark) 130%);
    position: relative;
}
.card-thumb--empty::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 78% 30%, rgba(255,255,255,0.18), transparent 55%);
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.2rem 1.3rem 1.3rem;
    min-width: 0;
}

.card-meta {
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.7rem;
}
.card-meta a { color: var(--accent-dark); font-weight: 600; }

.card-title {
    font-size: 1.16rem;
    margin: 0 0 0.6rem;
    line-height: 1.3;
}
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent-dark); text-decoration: none; }

.card-excerpt {
    color: var(--ink-soft);
    font-size: 0.94rem;
    margin-bottom: 1rem;
}
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-excerpt p:last-child { margin-bottom: 0; }

.card-more {
    margin-top: auto;
    align-self: flex-start;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--accent-dark);
    border-bottom: 1px solid transparent;
}
.card-more:hover { text-decoration: none; border-bottom-color: var(--accent); }

/* Лента статей — список карточек в 2 колонки */
.blog-list {
    display: grid;
    gap: 1.6rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 2rem;
}
@media (max-width: 720px) {
    .blog-list { grid-template-columns: 1fr; }
}

/* =========================================================
   Пагинация (D5 — type=plain, стили на .page-numbers)
   ========================================================= */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 2rem;
}
.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 0.7rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--ink-soft);
    font-size: 0.92rem;
    font-weight: 600;
}
.pager a.page-numbers:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
    text-decoration: none;
}
.pager .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.pager .page-numbers.dots {
    border: none;
    background: none;
}

/* =========================================================
   Главная страница
   ========================================================= */
.front { padding-top: 1rem; }

.front-section { padding: 2.6rem 0; }
.section-head { margin-bottom: 1.6rem; }
.section-kicker {
    display: inline-block;
    font-size: 0.78rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--accent-dark);
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.section-title { font-size: 1.8rem; }
.section-lead { color: var(--ink-soft); max-width: 60ch; }

/* Блок 1: текст + иллюстрация */
.fs-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.4rem;
    align-items: center;
}
.fs-split .fs-figure { min-width: 0; }
.fs-split .fs-figure img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.fs-split .fs-copy { min-width: 0; }
.fs-split.reverse .fs-figure { order: 2; }

.fs-list {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
}
.fs-list li {
    position: relative;
    padding-left: 1.6rem;
    margin-bottom: 0.6rem;
    color: var(--ink-soft);
}
.fs-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

/* Блок 2: сетка карточек-рубрик */
.fs-features {
    background: var(--paper-2);
}
.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.3rem;
}
.feature-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem 1.4rem;
    min-width: 0;
}
.feature-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--accent-tint);
    color: var(--accent-dark);
    margin-bottom: 0.9rem;
}
.feature-icon svg { display: block; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.feature-card p { font-size: 0.9rem; color: var(--ink-soft); margin: 0; }

/* Блок «последние записи» */
.fs-latest { padding-top: 2.6rem; }
.latest-more { text-align: center; margin-top: 2rem; }

/* Блок 3: шаги */
.fs-steps { background: var(--deep); color: #eef0f6; }
.fs-steps .section-title { color: #fff; }
.fs-steps .section-kicker { color: #f0a999; }
.fs-steps .section-lead { color: #b9c0d4; }
.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.3rem;
    counter-reset: step;
}
.step {
    background: var(--deep-2);
    border-radius: var(--radius);
    padding: 1.6rem 1.4rem;
    min-width: 0;
}
.step-num {
    font-family: Georgia, serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
    display: block;
    margin-bottom: 0.4rem;
}
.step h3 { color: #fff; font-size: 1.08rem; margin-bottom: 0.3rem; }
.step p { color: #b9c0d4; font-size: 0.9rem; margin: 0; }

/* Блок 4: CTA */
.fs-cta-wrap { padding: 2.6rem 0 3rem; }
.fs-cta {
    background: linear-gradient(120deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #fff;
    border-radius: 16px;
    padding: 2.6rem 2.4rem;
    text-align: center;
    box-shadow: var(--shadow);
}
.fs-cta h2 { color: #fff; font-size: 1.7rem; }
.fs-cta p { color: #ffe7e0; max-width: 56ch; margin-left: auto; margin-right: auto; }
.btn {
    display: inline-block;
    background: #fff;
    color: var(--accent-dark);
    font-weight: 700;
    padding: 0.8rem 1.8rem;
    border-radius: 30px;
    margin-top: 0.6rem;
    font-size: 0.98rem;
}
.btn:hover { text-decoration: none; background: var(--ink); color: #fff; }
.btn-ghost {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent-dark);
}
.btn-ghost:hover { background: var(--accent); color: #fff; }

/* =========================================================
   Сайдбар и виджеты
   ========================================================= */
.widget {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.3rem 1.4rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.widget-title {
    font-size: 1.05rem;
    margin: 0 0 0.9rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--accent-tint);
    color: var(--ink);
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.widget li:last-child { border-bottom: none; }
.widget a { color: var(--ink-soft); }
.widget a:hover { color: var(--accent-dark); }
.widget .post-date { display: block; font-size: 0.78rem; color: var(--muted); }

/* =========================================================
   Подвал
   ========================================================= */
.site-footer {
    background: var(--deep);
    color: #c3c9d8;
    padding: 2.6rem 0 1.4rem;
    margin-top: 2rem;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
}
.footer-cols .widget {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
}
.footer-cols .widget-title {
    color: #fff;
    border-bottom-color: rgba(255,255,255,0.15);
}
.footer-cols .widget,
.footer-cols .widget p { color: #c3c9d8; }
.footer-cols .widget a { color: #e4e7ef; }
.footer-cols .widget a:hover { color: var(--accent); }
.footer-cols .widget li { border-bottom-color: rgba(255,255,255,0.1); }
.footer-cols .widget .post-date { color: #9aa2b5; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    margin-top: 2rem;
    padding-top: 1.2rem;
    font-size: 0.85rem;
    color: #9aa2b5;
    text-align: center;
}

/* =========================================================
   Поиск и формы
   ========================================================= */
.search-form {
    display: flex;
    gap: 0.5rem;
    min-width: 0;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--white);
    color: var(--ink);
}
.search-form .search-submit {
    border: none;
    background: var(--accent);
    color: #fff;
    padding: 0 1.1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}
.search-form .search-submit:hover { background: var(--accent-dark); }

/* Комментарии */
.comments-area { margin-top: 2.2rem; }
.comments-title, .comment-reply-title { font-size: 1.3rem; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list ul.children { list-style: none; margin: 0 0 0 1.4rem; padding: 0; }
.comment-item { margin-bottom: 1.1rem; }
.comment-inner {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1rem 1.2rem;
}
.comment-head {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}
.comment-author { font-weight: 700; }
.comment-date { font-size: 0.8rem; color: var(--muted); }
.comment-tools { font-size: 0.85rem; margin-top: 0.4rem; }

.comment-respond {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    margin-top: 1.5rem;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    min-width: 0;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    margin-top: 0.3rem;
    background: var(--white);
    color: var(--ink);
}
.comment-form label { font-size: 0.9rem; font-weight: 600; }
.comment-form p { margin-bottom: 0.9rem; }
.comment-form .submit {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.7rem 1.6rem;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
}
.comment-form .submit:hover { background: var(--accent-dark); }

/* =========================================================
   404
   ========================================================= */
.error-404 {
    text-align: center;
    padding: 2.5rem 1.5rem 3rem;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.error-404 .code {
    font-family: Georgia, serif;
    font-size: 5rem;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.5rem;
}
.error-404 .search-form { max-width: 420px; margin: 1.5rem auto 0; }

/* =========================================================
   Cookie-баннер (A11, D6)
   ========================================================= */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 999;
    background: var(--deep);
    color: #e4e7ef;
    border-radius: var(--radius);
    padding: 1rem 1.3rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 720px;
    margin-inline: auto;
}
.cookie-banner p { margin: 0; font-size: 0.9rem; flex: 1; min-width: 220px; }
.cookie-banner a { color: var(--accent); }
.cookie-accept {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.6rem 1.4rem;
    border-radius: 24px;
    font-weight: 700;
    cursor: pointer;
    flex: 0 0 auto;
}
.cookie-accept:hover { background: var(--accent-dark); }

/* =========================================================
   FAQ (details)
   ========================================================= */
.page-content-block { margin-top: 1rem; }

/* =========================================================
   Адаптив
   ========================================================= */
@media (max-width: 960px) {
    .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .steps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .layout-with-sidebar {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.45rem; }
}

@media (max-width: 640px) {
    body { font-size: 16px; }

    .nav-toggle { display: inline-flex; }
    .main-nav {
        flex-basis: 100%;
        display: none;
    }
    .main-nav.open { display: block; }
    .main-nav ul { flex-direction: column; gap: 0; }
    .main-nav li { border-bottom: 1px solid var(--line); }
    .main-nav a { display: block; padding: 0.7rem 0; border-bottom: none; }

    .fs-split { grid-template-columns: 1fr; gap: 1.4rem; }
    .fs-split.reverse .fs-figure { order: 0; }
    .feature-grid { grid-template-columns: 1fr; }
    .steps-grid { grid-template-columns: 1fr; }
    .footer-cols { grid-template-columns: 1fr; gap: 1.6rem; }
    .cards-grid { grid-template-columns: 1fr; }

    .entry { padding: 1.4rem 1.3rem; }
    .entry-title { font-size: 1.55rem; }

    .fs-cta { padding: 1.9rem 1.4rem; }
    .fs-cta h2 { font-size: 1.4rem; }

    .cookie-banner { flex-direction: column; text-align: center; padding: 1rem; }
}
