/*
Theme Name: dds_foringstore.com
Author: Алексей Михайлов
Description: Тема для информационного технологического медиа ForingStore — обзоры гаджетов, анализ трендов и практические руководства.
Version: 1.1
Text Domain: foring
*/

/* ============================================================ *
 *  Переменные и сброс
 * ============================================================ */
:root {
    --bg: #f5f6f9;
    --surface: #ffffff;
    --ink: #15181f;
    --muted: #5c6473;
    --accent: #2f55d4;
    --accent-d: #213fa0;
    --line: #e2e6ee;
    --soft: #eef1f7;
    --footer-bg: #11141b;
    --footer-ink: #c4ccdb;
    --footer-head: #ffffff;
    --dark-ink: #ffffff;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(20, 25, 40, .05), 0 8px 24px rgba(20, 25, 40, .06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, "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(--accent); text-decoration: none; }
a:hover { color: var(--accent-d); text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; color: var(--ink); margin: 0 0 .6em; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

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

/* ============================================================ *
 *  Шапка
 * ============================================================ */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 18px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}
.brand-logo { display: block; height: 52px; width: auto; }
.brand-mark { flex: 0 0 auto; }
.brand-text { min-width: 0; }
.brand-name {
    display: block;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--ink);
    line-height: 1.3;
    /* длинное название сайта аккуратно ограничиваем по строкам */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.brand-name:hover { text-decoration: none; }
.brand-desc {
    display: block;
    font-size: .82rem;
    color: var(--muted);
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.main-nav { flex: 0 0 auto; }
.menu-toggle {
    display: none;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 9px 14px;
    font: inherit;
    cursor: pointer;
    color: var(--ink);
}
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.main-nav a {
    display: block;
    padding: 9px 14px;
    border-radius: 9px;
    color: var(--ink);
    font-weight: 500;
}
.main-nav a:hover,
.main-nav .current-menu-item > a {
    background: var(--soft);
    color: var(--accent-d);
    text-decoration: none;
}

/* ============================================================ *
 *  Хлебные крошки
 * ============================================================ */
.crumbs {
    font-size: .88rem;
    color: var(--muted);
    padding: 16px 0 0;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { margin: 0 6px; color: #b6bdca; }
.crumbs span { color: var(--ink); }

/* ============================================================ *
 *  Раскладки
 * ============================================================ */
.site-main { padding: 28px 0 56px; }

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

@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: minmax(0, 1fr); }
}

.entry {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 32px;
    box-shadow: var(--shadow);
}
.entry-thumb { margin: 0 0 22px; border-radius: 10px; overflow: hidden; }
.entry-thumb img { display: block; width: 100%; height: auto; }
.entry-title { font-size: 1.9rem; }
.entry-meta { color: var(--muted); font-size: .9rem; margin-bottom: 18px; }
.entry-meta a { color: var(--muted); }
.entry-content { word-wrap: break-word; }
.entry-content img { border-radius: 8px; }
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}
.entry-content th,
.entry-content td {
    border: 1px solid var(--line);
    padding: 9px 12px;
    text-align: left;
}
.entry-content th { background: var(--soft); }
.entry-footer { margin-top: 20px; font-size: .9rem; color: var(--muted); }
.entry-footer a { color: var(--accent); }

/* ============================================================ *
 *  Карточки записей (A8, A10)
 * ============================================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(20, 25, 40, .1); }
.card-thumb { display: block; }
.card-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-thumb-ph {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #dbe2f5, #eef1f9);
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 22px 22px;
    min-width: 0;
}
.card-title { font-size: 1.18rem; margin: 0 0 8px; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-meta { font-size: .82rem; color: var(--muted); margin-bottom: 10px; }
.card-excerpt { color: var(--muted); font-size: .95rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    padding-top: 14px;
    font-weight: 600;
    font-size: .92rem;
}

/* ============================================================ *
 *  Боковая колонка (светлый фон → тёмный текст)
 * ============================================================ */
.sidebar { min-width: 0; }
.sidebar .widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-bottom: 24px;
    color: var(--ink);
    box-shadow: var(--shadow);
}
.sidebar .widget-title {
    font-size: 1.05rem;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--soft);
    color: var(--ink);
}
.sidebar .widget,
.sidebar .widget p,
.sidebar .widget li { color: var(--ink); }
.sidebar .widget a { color: var(--accent); }
.sidebar .widget a:hover { color: var(--accent-d); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: 8px 0; border-bottom: 1px solid var(--soft); }
.sidebar li:last-child { border-bottom: 0; }
.sidebar .post-date { display: block; font-size: .8rem; color: var(--muted); }

/* ============================================================ *
 *  Пагинация (type => plain, стили на .page-numbers)
 * ============================================================ */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 34px;
    justify-content: center;
}
.pager .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;
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}
.pager a.page-numbers:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.pager .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.pager .page-numbers.dots {
    border-color: transparent;
    background: transparent;
}

/* ============================================================ *
 *  Главная
 * ============================================================ */
.home-section { padding: 54px 0; }
.home-section + .home-section { border-top: 1px solid var(--line); }
.section-head { max-width: 720px; margin: 0 0 32px; }
.section-head.center { margin-inline: auto; text-align: center; }
.eyebrow {
    display: inline-block;
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 10px;
}

/* Блок: текст + иллюстрация */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 48px;
    align-items: center;
}
.split.reverse .split-media { order: -1; }
.split-media img { display: block; width: 100%; border-radius: var(--radius); }
.split-text p { color: var(--muted); }
@media (max-width: 960px) {
    .split { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .split.reverse .split-media { order: 0; }
}

/* Блок: сетка направлений */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 22px;
}
.feature {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 24px;
    box-shadow: var(--shadow);
    min-width: 0;
}
.feature-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--soft);
    color: var(--accent);
    margin-bottom: 14px;
}
.feature h3 { font-size: 1.12rem; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: .94rem; margin: 0; }

/* Блок: шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 26px;
    counter-reset: step;
}
.step { min-width: 0; }
.step-num {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.step h3 { font-size: 1.1rem; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: .94rem; margin: 0; }

/* Блок: акцентная цитата (тёмный фон → светлый текст) */
.quote-block {
    background: linear-gradient(135deg, #1a2233, #21345f);
    color: #fff;
    border-radius: 20px;
    padding: 54px 48px;
    text-align: center;
}
.quote-block p {
    font-size: 1.5rem;
    line-height: 1.5;
    font-weight: 600;
    color: #fff;
    margin: 0 auto 16px;
    max-width: 760px;
}
.quote-block cite {
    color: #aebbe0;
    font-style: normal;
    font-size: .95rem;
}
@media (max-width: 600px) {
    .quote-block { padding: 36px 24px; }
    .quote-block p { font-size: 1.22rem; }
}

/* Лента последних записей на главной */
.home-latest .card-grid { margin-top: 4px; }
.section-cta { margin-top: 30px; text-align: center; }

.btn {
    display: inline-block;
    padding: 13px 26px;
    border-radius: 11px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}
.btn:hover { background: var(--accent-d); color: #fff; text-decoration: none; }

/* ============================================================ *
 *  Подвал (тёмный фон → светлый текст виджетов)
 * ============================================================ */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-ink);
    padding: 52px 0 28px;
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
}
@media (max-width: 760px) {
    .footer-cols { grid-template-columns: minmax(0, 1fr); gap: 30px; }
}
.site-footer .widget { color: var(--footer-ink); margin: 0; }
.site-footer .widget-title {
    color: var(--footer-head);
    font-size: 1.05rem;
    margin: 0 0 14px;
}
.site-footer .widget,
.site-footer .widget p,
.site-footer .widget li,
.site-footer .post-date { color: var(--footer-ink); }
.site-footer .widget a { color: #dde4f1; }
.site-footer .widget a:hover { color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.site-footer li:last-child { border-bottom: 0; }
.site-copy {
    margin-top: 40px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, .12);
    font-size: .86rem;
    color: #8f99ac;
}

/* ============================================================ *
 *  Cookie-баннер (A11 — правило [hidden] до основных стилей)
 * ============================================================ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    background: #11141b;
    color: #e6eaf2;
    border-radius: 14px;
    padding: 16px 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
}
.cookie-banner p { margin: 0; font-size: .9rem; flex: 1; min-width: 220px; }
.cookie-banner a { color: #aebbe0; }
.cookie-accept {
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 11px 22px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.cookie-accept:hover { background: var(--accent-d); }

/* ============================================================ *
 *  Поиск / комментарии / 404
 * ============================================================ */
.search-form { display: flex; gap: 8px; }
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    background: var(--surface);
    color: var(--ink);
}
.search-form .search-submit {
    border: 0;
    background: var(--accent);
    color: #fff;
    border-radius: 10px;
    padding: 11px 18px;
    font: inherit;
    cursor: pointer;
}
.search-form .search-submit:hover { background: var(--accent-d); }

.comments-area { margin-top: 30px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 26px; padding: 0; }
.comment-inner {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 16px;
}
.comment-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.comment-author { font-weight: 600; }
.comment-date { color: var(--muted); font-size: .82rem; }
.comment-await { color: var(--accent); font-size: .85rem; }
.comment-respond {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 22px 24px;
    margin-top: 24px;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    margin-top: 4px;
}
.comment-form .form-submit input {
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 12px 24px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.notfound { text-align: center; padding: 30px 0 10px; }
.notfound h1 { font-size: 4rem; margin-bottom: 6px; color: var(--accent); }
.notfound .search-form { max-width: 460px; margin: 24px auto 0; }

.page-title { margin-bottom: 22px; }

/* ============================================================ *
 *  Адаптив
 * ============================================================ */
@media (max-width: 760px) {
    body { font-size: 16px; }
    h1 { font-size: 1.7rem; }
    .entry { padding: 22px 20px; }
    .menu-toggle { display: inline-block; }
    .main-nav { width: 100%; flex-basis: 100%; }
    .main-nav ul {
        display: none;
        flex-direction: column;
        gap: 2px;
        margin-top: 12px;
    }
    .main-nav.is-open ul { display: flex; }
    .main-nav a { padding: 11px 12px; }
}

@media (max-width: 600px) {
    .home-section { padding: 40px 0; }
    .quote-block p { font-size: 1.18rem; }
}
