/*
Theme Name: dds_bienetrefinistere.com
Author: Алексей Кравцов
Description: Контентно-коммерческий блог об игровой периферии: обзоры мышей, клавиатур и гарнитур, технические разборы, рейтинги и советы по выбору. Спокойная технологичная эстетика побережья Атлантики и эргономики игровых устройств.
Version: 1.1
Text Domain: bienetre
*/

/* ============================================================
   Переменные и базовая палитра
   серо-голубой · песочный · тёмно-сланцевый · морская волна
   ============================================================ */
:root {
    --slate:        #283038;
    --slate-soft:   #354049;
    --grey-blue:    #6f8492;
    --grey-blue-lt: #aebcc6;
    --sand:         #ece2cd;
    --sand-deep:    #e0d2b4;
    --teal:         #2f8d86;
    --teal-dark:    #246e68;
    --teal-soft:    #e3f0ef;
    --ink:          #283038;
    --muted:        #5d6b75;
    --line:         #dde3e7;
    --paper:        #ffffff;
    --canvas:       #f6f4ef;
    --radius:       10px;
    --radius-sm:    8px;
    --shell:        1180px;
    --font: "Inter", "Roboto", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

/* ============================================================
   Сброс и базовая типографика
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.7;
    color: var(--ink);
    background-color: var(--canvas);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ненавязчивый фоновый паттерн: волны Атлантики + контуры контроллера */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.5;
    background-image:
        radial-gradient(circle at 12% 18%, rgba(111,132,146,0.05) 0 22%, transparent 23%),
        radial-gradient(circle at 88% 72%, rgba(47,141,134,0.04) 0 26%, transparent 27%),
        repeating-linear-gradient(115deg, rgba(111,132,146,0.025) 0 1px, transparent 1px 46px);
}

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

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

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--slate);
    margin: 0 0 0.6em;
}
h1 { font-size: 2.05rem; letter-spacing: -0.01em; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }

/* Глобальный p без фона — фон только на body и конкретных блоках (F) */

blockquote {
    margin: 1.4em 0;
    padding: 0.2em 0 0.2em 1.1em;
    border-left: 4px solid var(--grey-blue);
    color: var(--muted);
    font-style: italic;
}

code, pre {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    background: var(--teal-soft);
    border-radius: 6px;
}
code { padding: 0.1em 0.4em; font-size: 0.92em; }
pre { padding: 1em 1.2em; overflow-x: auto; }
pre code { background: none; padding: 0; }

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

/* ============================================================
   Кнопки — мягкие скругления, подъём при наведении
   ============================================================ */
.btn,
.entry-content .btn {
    display: inline-block;
    padding: 0.7em 1.5em;
    border-radius: var(--radius);
    background: var(--teal);
    color: #fff;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover {
    background: var(--teal-dark);
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(36,110,104,0.22);
}

/* Партнёрские ссылки — отделены пунктирным контуром */
.btn-affiliate {
    background: var(--paper);
    color: var(--teal-dark);
    border: 1px solid var(--teal);
    border-bottom: 2px dashed var(--teal);
}
.btn-affiliate:hover {
    background: var(--teal-soft);
    color: var(--teal-dark);
    box-shadow: 0 6px 16px rgba(47,141,134,0.16);
}

/* Кнопки в рейтингах — плоские, минималистичные */
.btn-flat {
    background: var(--sand-deep);
    color: var(--slate);
    border-radius: var(--radius-sm);
    box-shadow: none;
}
.btn-flat:hover { background: var(--sand); color: var(--slate); transform: none; box-shadow: none; }

/* ============================================================
   Шапка
   ============================================================ */
.site-header {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 18px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.brand-logo,
.brand-glyph {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    display: block;
}
.brand-text { min-width: 0; }
.brand-title {
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--slate);
    line-height: 1.2;
    display: block;
}
.brand-title a { color: inherit; }
.brand-title a:hover { color: var(--teal); text-decoration: none; }
.brand-desc {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.4;
    margin-top: 3px;
    max-width: 60ch;
}

.nav-toggle {
    display: none;
    margin-left: auto;
    padding: 0.5em 0.8em;
    background: var(--slate);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
}

.main-nav { margin-left: auto; }
.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
    padding: 0;
}
.main-nav a {
    display: block;
    padding: 0.5em 0.85em;
    border-radius: var(--radius-sm);
    color: var(--slate);
    font-weight: 500;
    font-size: 0.98rem;
}
.main-nav a:hover {
    background: var(--teal-soft);
    color: var(--teal-dark);
    text-decoration: none;
}
.main-nav .current-menu-item > a {
    background: var(--teal);
    color: #fff;
}

/* ============================================================
   Каркас страницы / раскладки
   ============================================================ */
.site-main { padding: 34px 0 50px; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 40px;
    align-items: start;
}
.layout-single .content-area { width: 85%; max-width: 100%; }
.layout-single { display: block; }

@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 34px; }
    .layout-single .content-area { width: 100%; }
}

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

/* ============================================================
   Хлебные крошки
   ============================================================ */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 20px;
    line-height: 1.5;
}
.breadcrumbs a { color: var(--grey-blue); }
.breadcrumbs a:hover { color: var(--teal); }
.breadcrumbs .sep { margin: 0 6px; color: var(--grey-blue-lt); }

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

.card {
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 26px rgba(40,48,56,0.10);
}

.card-thumb img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-thumb-empty {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--sand) 0%, var(--grey-blue-lt) 100%);
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 18px 20px 22px;
}
.card-title {
    font-size: 1.18rem;
    margin: 0 0 0.4em;
}
.card-title a { color: var(--slate); }
.card-title a:hover { color: var(--teal); text-decoration: none; }

.card-meta {
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 0.7em;
}

.card-excerpt { color: var(--ink); font-size: 0.96rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }

.card-more {
    margin-top: auto;
    padding-top: 14px;
}
.read-more {
    display: inline-block;
    font-weight: 600;
    color: var(--teal);
}
.read-more:hover { color: var(--teal-dark); }

/* ============================================================
   Одиночная запись / страница
   ============================================================ */
.entry {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 34px 36px;
}
.entry-header { margin-bottom: 18px; }
.entry-title { margin: 0 0 0.3em; }
.entry-meta { font-size: 0.85rem; color: var(--muted); }

.entry-thumb {
    margin: 0 0 24px;
    border-radius: var(--radius);
    overflow: hidden;
}
.entry-thumb img { display: block; width: 100%; height: auto; }

.entry-content { font-size: 1.04rem; }
.entry-content img { border-radius: var(--radius); margin: 1em 0; }
.entry-content h2 { margin-top: 1.4em; }
.entry-content h3 { margin-top: 1.2em; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li { margin-bottom: 0.4em; }

@media (max-width: 600px) {
    .entry { padding: 22px 18px 26px; }
}

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

/* Карточка товара в коммерческих блоках (единый визуал) */
.product-card {
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.product-card .product-thumb { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.product-card .product-thumb-empty { aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--teal-soft), var(--sand)); }
.product-card .product-body { flex: 1; display: flex; flex-direction: column; padding: 16px 18px 20px; }
.product-card h3 { margin: 0 0 0.4em; font-size: 1.1rem; }
.product-card .product-note { color: var(--muted); font-size: 0.92rem; margin-bottom: 1em; }
.product-card .btn-affiliate { margin-top: auto; }

/* ============================================================
   Сайдбар + виджеты
   светлый фон сайдбара → тёмный текст
   ============================================================ */
.sidebar { min-width: 0; }
.sidebar .widget {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 24px;
}
.sidebar .widget-title,
.sidebar .widget h2,
.sidebar .widget h3 {
    font-size: 1.05rem;
    color: var(--slate);
    margin: 0 0 0.8em;
    padding-bottom: 0.5em;
    border-bottom: 2px solid var(--teal-soft);
}
.sidebar .widget,
.sidebar .widget p,
.sidebar .widget li { color: var(--ink); }
.sidebar .widget a { color: var(--teal-dark); }
.sidebar .widget a:hover { color: var(--teal); }
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li {
    padding: 0.5em 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.95rem;
}
.sidebar .widget li:last-child { border-bottom: none; }
.sidebar .widget .post-date,
.sidebar .widget .rss-date { color: var(--muted); font-size: 0.8rem; display: block; }

/* ============================================================
   Пагинация
   ============================================================ */
.pagination {
    margin: 36px 0 8px;
}
.pagination ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.pagination li {
    margin: 0;
    list-style: none;
}
.pagination a.page-numbers,
.pagination span.page-numbers {
    display: inline-block;
    padding: 0.5em 0.85em;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--paper);
    color: var(--slate);
    font-weight: 600;
    line-height: 1.2;
}
.pagination a.page-numbers:hover {
    background: var(--teal-soft);
    color: var(--teal-dark);
    text-decoration: none;
}
.pagination span.page-numbers.current {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}
.pagination .page-numbers.dots {
    border: none;
    background: none;
    padding-left: 0.3em;
    padding-right: 0.3em;
}

/* ============================================================
   Форма поиска
   ============================================================ */
.search-form {
    display: flex;
    gap: 8px;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 0.6em 0.85em;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 0.95rem;
}
.search-form .search-field:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--teal-soft);
}
.search-form .search-submit {
    padding: 0.6em 1.2em;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--teal);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}
.search-form .search-submit:hover { background: var(--teal-dark); }

/* ============================================================
   Главная
   ============================================================ */
.front-section { margin-bottom: 52px; }
.home-area { width: 85%; max-width: 100%; margin-inline: auto; }

.hero {
    background: linear-gradient(135deg, var(--slate) 0%, var(--slate-soft) 100%);
    color: #fff;
    border-radius: 16px;
    padding: 52px 46px;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: "";
    position: absolute;
    right: -60px; top: -40px;
    width: 320px; height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(47,141,134,0.35), transparent 68%);
    pointer-events: none;
}
.hero h1 { color: #fff; font-size: 2.3rem; max-width: 22ch; }
.hero p { color: var(--grey-blue-lt); max-width: 60ch; font-size: 1.08rem; }
.hero .btn { margin-top: 0.6em; }

.section-head { margin-bottom: 22px; }
.section-head h2 { margin: 0 0 0.2em; }
.section-head .lead { color: var(--muted); margin: 0; }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 24px;
}
.feature {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 24px 26px;
}
.feature .feature-icon {
    width: 44px; height: 44px;
    margin-bottom: 14px;
    color: var(--teal);
}
.feature h3 { margin: 0 0 0.4em; }
.feature p { color: var(--muted); margin: 0; font-size: 0.96rem; }

.step-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 22px;
    counter-reset: step;
}
.step {
    background: var(--canvas);
    border-radius: var(--radius);
    padding: 22px 22px 24px;
    border: 1px solid var(--line);
}
.step .step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--teal);
    color: #fff;
    font-weight: 700;
    margin-bottom: 12px;
}
.step h3 { margin: 0 0 0.3em; font-size: 1.1rem; }
.step p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.section-divider {
    height: 64px;
    margin: 8px 0 12px;
    background-image:
        repeating-linear-gradient(100deg, rgba(111,132,146,0.10) 0 2px, transparent 2px 30px),
        radial-gradient(ellipse at 30% 60%, rgba(47,141,134,0.10), transparent 60%);
    border-radius: var(--radius);
}

@media (max-width: 600px) {
    .home-area { width: 100%; }
    .hero { padding: 34px 22px; }
    .hero h1 { font-size: 1.8rem; }
}

/* ============================================================
   404
   ============================================================ */
.error-404 {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 40px 34px;
    text-align: center;
}
.error-404 .big { font-size: 4rem; color: var(--grey-blue-lt); margin: 0; line-height: 1; }
.error-404 .search-form { max-width: 460px; margin: 22px auto 0; }

/* ============================================================
   Комментарии
   ============================================================ */
.comments-area { margin-top: 34px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list li { margin-bottom: 18px; }
.comment-body {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 20px;
}
.comment-author { font-weight: 600; color: var(--slate); }
.comment-meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.5em; }
.comment-list .children { list-style: none; margin: 14px 0 0 24px; padding: 0; }

.comment-respond {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-top: 22px;
}
.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: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font: inherit;
    margin-bottom: 0.8em;
}
.comment-form textarea:focus,
.comment-form input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.comment-form .submit {
    padding: 0.7em 1.6em;
    background: var(--teal);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
}
.comment-form .submit:hover { background: var(--teal-dark); }

/* ============================================================
   Подвал — тёмный фон, светлый текст в виджетах
   ============================================================ */
.site-footer {
    background: var(--slate);
    color: var(--grey-blue-lt);
    padding: 46px 0 26px;
    margin-top: 30px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 34px;
    margin-bottom: 30px;
}
.footer-col { min-width: 0; }

.site-footer .widget-title,
.site-footer .widget h2,
.site-footer .widget h3 {
    color: #fff;
    font-size: 1.05rem;
    margin: 0 0 0.8em;
}
.site-footer .widget,
.site-footer .widget p,
.site-footer .widget li,
.site-footer .footer-col p { color: var(--grey-blue-lt); }
.site-footer .widget a,
.site-footer a { color: #fff; }
.site-footer .widget a:hover,
.site-footer a:hover { color: var(--teal); text-decoration: underline; }
.site-footer .widget ul { list-style: none; margin: 0; padding: 0; }
.site-footer .widget li {
    padding: 0.4em 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 0.95rem;
}
.site-footer .widget li:last-child { border-bottom: none; }
.site-footer .widget .post-date { color: var(--grey-blue); font-size: 0.8rem; display: block; }

.footer-contact a { font-weight: 600; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.10);
    padding-top: 20px;
    font-size: 0.85rem;
    color: var(--grey-blue);
    text-align: center;
}

/* ============================================================
   Cookie-баннер (A11, D6)
   ============================================================ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 16px; right: 16px; bottom: 16px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    background: var(--slate);
    color: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 12px 34px rgba(40,48,56,0.32);
}
.cookie-banner p { margin: 0; flex: 1; min-width: 220px; font-size: 0.92rem; color: var(--grey-blue-lt); }
.cookie-banner a { color: #fff; text-decoration: underline; }
.cookie-banner .cookie-accept {
    padding: 0.6em 1.4em;
    background: var(--teal);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.cookie-banner .cookie-accept:hover { background: var(--teal-dark); }

/* ============================================================
   Адаптив навигации
   ============================================================ */
@media (max-width: 760px) {
    .nav-toggle { display: block; }
    .main-nav {
        flex-basis: 100%;
        margin-left: 0;
    }
    .main-nav[hidden] { display: none !important; }
    .main-nav ul { flex-direction: column; gap: 2px; }
    .main-nav a { padding: 0.65em 0.8em; }
}

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