/*
Theme Name: dds_2pouremballer.com
Author: Кирилл Лебедев
Description: Информационная тема об упаковочных решениях для бизнеса: материалы, тиражи и защита товара.
Version: 1.1
Text Domain: packmat
*/

/* ---------- Переменные ---------- */
:root {
    --ink: #2b2620;
    --ink-soft: #5c5347;
    --paper: #f6f1e9;
    --paper-2: #ffffff;
    --kraft: #c8955c;
    --kraft-d: #9a6a3a;
    --kraft-dd: #7c5228;
    --accent: #2f6f5e;
    --accent-d: #245648;
    --line: #e3dac9;
    --footer-bg: #241f1a;
    --footer-line: #3a332b;
    --footer-text: #d8ccb8;
    --footer-title: #f2e9d8;
    --radius: 12px;
    --shadow: 0 6px 22px rgba(60, 44, 24, .10);
}

/* ---------- Cookie [hidden] (A11) — до основных стилей баннера ---------- */
.cookie-banner[hidden] { display: none !important; }

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

html { scroll-behavior: smooth; }

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

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

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

h1, h2, h3, h4 { line-height: 1.25; color: var(--ink); margin: 0 0 .6em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }

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

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--ink);
    color: #fff;
    padding: .6rem 1rem;
    z-index: 999;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- Кнопки ---------- */
.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: .7rem 1.4rem;
    border-radius: 8px;
    font-weight: 600;
    border: 2px solid var(--accent);
    transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--accent-d); border-color: var(--accent-d); color: #fff; text-decoration: none; }
.btn-ghost { background: transparent; color: var(--accent-d); }
.btn-ghost:hover { background: var(--accent); color: #fff; }

/* ---------- Шапка ---------- */
.site-header {
    background: var(--paper-2);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 0;
    flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.brand-link { display: inline-flex; }
.brand-logo, .brand-mark svg { display: block; width: 48px; height: 48px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.site-title { font-weight: 700; font-size: 1.02rem; color: var(--ink); line-height: 1.2; }
.site-desc { font-size: .8rem; color: var(--ink-soft); line-height: 1.35; }

.site-nav { min-width: 0; }
.primary-menu {
    display: flex;
    gap: 1.4rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.primary-menu a {
    color: var(--ink);
    font-weight: 600;
    padding: .3rem 0;
    border-bottom: 2px solid transparent;
}
.primary-menu a:hover,
.primary-menu .current-menu-item > a {
    color: var(--kraft-dd);
    border-bottom-color: var(--kraft);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 6px;
}
.nav-toggle-bar { width: 26px; height: 3px; background: var(--ink); border-radius: 2px; }

/* ---------- Главная ---------- */
.front { padding: 2.2rem 0 3rem; }
.fs { margin: 0 0 3rem; }

.fs-intro {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    gap: 2.2rem;
    align-items: center;
}
.fs-intro-text h1 { font-size: 2.2rem; }
.fs-intro-media img {
    display: block;
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.fs-topics h2, .fs-latest h2, .fs-steps h2 { text-align: center; margin-bottom: 1.6rem; }

.topic-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.2rem;
}
.topic {
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem 1.2rem;
}
.topic-ico { display: inline-flex; margin-bottom: .6rem; }
.topic h3 { font-size: 1.08rem; }
.topic p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.4rem;
}
.fs-latest-more, .fs-cta-actions { text-align: center; margin-top: 1.6rem; }
.fs-cta-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

/* Пошаговый блок */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.step {
    display: flex;
    gap: 1rem;
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.3rem 1.4rem;
    min-width: 0;
}
.step-num {
    flex: 0 0 auto;
    width: 40px; height: 40px;
    display: grid; place-items: center;
    background: var(--kraft-d);
    color: #fff;
    font-weight: 700;
    border-radius: 50%;
}
.step-body { min-width: 0; }
.step-body h3 { font-size: 1.08rem; margin-bottom: .3rem; }
.step-body p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* CTA (A14 — отступы со всех сторон) */
.fs-cta { margin-bottom: 1rem; }
.fs-cta-inner {
    background: linear-gradient(135deg, #2e2823, #3c332a);
    color: #f4ece0;
    border-radius: var(--radius);
    padding: 2.6rem 2.2rem;
    text-align: center;
}
.fs-cta-inner h2 { color: #fff; }
.fs-cta-inner p { color: #e4d8c6; max-width: 640px; margin-inline: auto; }

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

/* ---------- Раскладки ---------- */
.page-wrap { padding: 1.4rem 0 3rem; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 2.3fr) minmax(0, 1fr);
    gap: 2.2rem;
    align-items: start;
}
.layout-single { display: block; }
.content-area { min-width: 0; }

.page-head { margin-bottom: 1.6rem; }
.page-lead { color: var(--ink-soft); }

/* ---------- Карточки записей (A8, A10) ---------- */
.card {
    display: flex;
    flex-direction: column;
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    min-width: 0;
}
.card-thumb { display: block; }
.card-thumb img,
.card-thumb svg {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.1rem 1.2rem 1.2rem;
    min-width: 0;
}
.card-meta { font-size: .82rem; color: var(--ink-soft); margin-bottom: .35rem; }
.card-title { font-size: 1.15rem; margin-bottom: .5rem; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--kraft-dd); }
.card-excerpt { color: var(--ink-soft); font-size: .95rem; }
.card-excerpt p { margin: 0 0 .5em; background: none; }
.card-more { margin-top: auto; padding-top: .6rem; font-weight: 600; color: var(--accent-d); }

/* ---------- Одиночная запись / страница ---------- */
.single-post { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem 1.9rem; }
.single-title { font-size: 1.9rem; }
.single-meta { color: var(--ink-soft); font-size: .88rem; margin-bottom: 1.1rem; }
.single-thumb { margin: 0 0 1.4rem; }
.single-thumb img { display: block; width: 100%; border-radius: var(--radius); }
.single-content { min-width: 0; }
.single-content img { border-radius: 8px; }
.single-content h2, .single-content h3 { margin-top: 1.6rem; }
.single-content blockquote {
    margin: 1.4rem 0;
    background: #f0e7d6;
    border-left: 4px solid var(--kraft);
    border-radius: 8px;
    padding: 1rem 1.3rem;
    color: var(--ink);
}
.single-tags { margin-top: 1.6rem; font-size: .9rem; color: var(--ink-soft); }
.tags-label { font-weight: 600; }
.page-links { margin-top: 1.2rem; font-weight: 600; }

/* ---------- Сайдбар и виджеты (контраст — F) ---------- */
.sidebar { min-width: 0; }
.sidebar .widget {
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.2rem 1.3rem;
    margin-bottom: 1.4rem;
    color: var(--ink);
}
.sidebar .widget-title { font-size: 1.05rem; color: var(--ink); margin-bottom: .8rem; }
.sidebar .widget a { color: var(--kraft-dd); }
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li { padding: .4rem 0; border-bottom: 1px dashed var(--line); }
.sidebar .widget li:last-child { border-bottom: 0; }
.sidebar .post-date, .sidebar .rss-date { color: var(--ink-soft); font-size: .82rem; }

/* ---------- Подвал ---------- */
.site-footer { background: var(--footer-bg); color: var(--footer-text); margin-top: 2rem; }
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
    padding: 2.6rem 0 2rem;
}
.footer-col { min-width: 0; }
.footer-col .widget { color: var(--footer-text); }
.footer-col .widget-title { color: var(--footer-title); font-size: 1.05rem; margin-bottom: .8rem; }
.footer-col .widget a { color: var(--footer-text); }
.footer-col .widget a:hover { color: #fff; }
.footer-col .widget ul { list-style: none; margin: 0; padding: 0; }
.footer-col .widget li { padding: .35rem 0; border-bottom: 1px solid var(--footer-line); }
.footer-col .widget li:last-child { border-bottom: 0; }
.footer-col p { color: var(--footer-text); }
.footer-bottom { border-top: 1px solid var(--footer-line); }
.copyright { margin: 0; padding: 1.1rem 0; font-size: .88rem; color: var(--footer-text); text-align: center; }

/* ---------- Хлебные крошки ---------- */
.breadcrumbs { font-size: .86rem; color: var(--ink-soft); margin-bottom: 1.2rem; }
.breadcrumbs a { color: var(--kraft-dd); }
.breadcrumbs .sep { margin: 0 .35rem; color: var(--ink-soft); }

/* ---------- Пагинация (D5, type=plain → .page-numbers) ---------- */
.pager { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 2rem; }
.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: .5rem .7rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper-2);
    color: var(--ink);
    font-weight: 600;
}
.pager a.page-numbers:hover { border-color: var(--kraft); color: var(--kraft-dd); text-decoration: none; }
.pager .page-numbers.current { background: var(--kraft-d); border-color: var(--kraft-d); color: #fff; }
.pager .page-numbers.dots { border: 0; background: none; }

/* ---------- Формы ---------- */
.search-form .search-row { display: flex; gap: .5rem; }
.search-label { display: block; font-weight: 600; margin-bottom: .4rem; font-size: .9rem; }
.search-input, .comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
    width: 100%;
    padding: .6rem .8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper-2);
    color: var(--ink);
    font: inherit;
    min-width: 0;
}
.search-submit, .comment-form .submit {
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: .6rem 1.2rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.search-submit:hover, .comment-form .submit:hover { background: var(--accent-d); }

/* ---------- Комментарии ---------- */
.comments-area { margin-top: 2.2rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem 1.7rem; }
.comment-list { list-style: none; margin: 0 0 1.4rem; padding: 0; }
.comment-list ol.children { list-style: none; margin: .8rem 0 0 1.4rem; padding: 0; }
.comment-item { padding: .3rem 0; }
.comment-inner { border-bottom: 1px solid var(--line); padding-bottom: 1rem; margin-bottom: 1rem; }
.comment-head { display: flex; gap: .8rem; align-items: baseline; margin-bottom: .3rem; }
.comment-author { font-weight: 700; }
.comment-date { font-size: .8rem; color: var(--ink-soft); }
.comment-await { font-size: .85rem; color: var(--kraft-dd); }
.comment-form label { display: block; font-weight: 600; margin: .2rem 0 .3rem; font-size: .9rem; }
.comment-form p { margin-bottom: .9rem; }

/* ---------- Таблицы ---------- */
.single-content table { border-collapse: collapse; width: 100%; margin: 1.2rem 0; }
.single-content table, .single-content th, .single-content td { border: 1px solid var(--kraft-d); }
.single-content th, .single-content td { padding: .6rem .8rem; text-align: left; }
.single-content th { background: #efe4d1; }

/* ---------- 404 ---------- */
.error-404 { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem 2.1rem; }
.error-404 .search-form { margin: 1.2rem 0; max-width: 460px; }
.error-home { margin-top: 1.2rem; }

/* ---------- Cookie-баннер ---------- */
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: rgba(36, 31, 26, .97);
    color: #f2e9d8;
    z-index: 500;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, .2);
}
.cookie-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    padding: 1rem 0;
    flex-wrap: wrap;
}
.cookie-text { margin: 0; font-size: .9rem; color: #e4d8c6; min-width: 0; flex: 1; }
.cookie-accept {
    background: var(--kraft);
    color: #2b2620;
    border: 0;
    border-radius: 8px;
    padding: .6rem 1.4rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.cookie-accept:hover { background: #d9a76c; }

/* ---------- Адаптив ---------- */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: minmax(0, 1fr); }
    .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fs-intro { grid-template-columns: minmax(0, 1fr); }
    .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.6rem; }
    .fs-intro-text h1 { font-size: 1.7rem; }
    .nav-toggle { display: flex; }
    .site-nav {
        flex-basis: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height .25s ease;
    }
    .site-nav.is-open { max-height: 480px; }
    .primary-menu { flex-direction: column; gap: 0; padding: .6rem 0; }
    .primary-menu li { border-bottom: 1px solid var(--line); }
    .primary-menu a { display: block; padding: .7rem 0; border-bottom: 0; }
    .topic-grid { grid-template-columns: minmax(0, 1fr); }
    .card-grid { grid-template-columns: minmax(0, 1fr); }
    .steps { grid-template-columns: minmax(0, 1fr); }
    .footer-cols { grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }
    .single-post { padding: 1.3rem 1.3rem; }
    .fs-cta-inner { padding: 1.9rem 1.4rem; }
    .search-form .search-row { flex-direction: column; }
    .cookie-inner { flex-direction: column; align-items: stretch; text-align: left; }
}
