/*
Theme Name: dds_zakaz-apple.ru
Theme URI: https://zakaz-apple.ru/
Author: Алексей Ковалёв
Author URI: https://zakaz-apple.ru/
Description: Мультибрендовый блог обзоров гаджетов с сохранением экспертизы по технике Apple. Тема в стиле умного минимализма с акцентами на материалах.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: dds_zakaz_apple
Tags: blog, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ===== Базовая палитра ===== */
:root {
    --bg: #FFFFFF;
    --bg-soft: #F7F7F9;
    --bg-card: #FFFFFF;
    --ink: #1E1E24;
    --ink-soft: #3A3A44;
    --muted: #86868B;
    --line: #E5E5EA;
    --accent: #2B5F8A;
    --accent-bright: #007AFF;
    --brass: #D4A373;
    --mint: #6BBF7B;
    --shadow: 0 2px 6px rgba(0,0,0,0.05);
    --shadow-hover: 0 6px 18px rgba(0,0,0,0.08);
    --radius: 14px;
    --radius-sm: 8px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121212;
        --bg-soft: #1A1A1D;
        --bg-card: #1D1D1F;
        --ink: #F2F2F4;
        --ink-soft: #C7C7CC;
        --muted: #98989D;
        --line: #2A2A2E;
        --accent: #4A90D0;
        --accent-bright: #4DA3FF;
        --brass: #C9A57A;
        --mint: #79CC8A;
        --shadow: 0 2px 6px rgba(0,0,0,0.4);
        --shadow-hover: 0 6px 18px rgba(0,0,0,0.55);
    }
}

/* ===== Доступность ===== */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ===== Сброс ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink-soft);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, 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; transition: color .18s ease; }
a:hover { color: var(--accent-bright); }

h1, h2, h3, h4, h5, h6 {
    color: var(--ink);
    font-weight: 600;
    line-height: 1.25;
    margin: 1.4em 0 0.6em;
}
h1 { font-size: 2.1rem; }
h2 { font-size: 1.6rem; letter-spacing: -0.2px; }
h3 { font-size: 1.25rem; letter-spacing: -0.2px; }
p { margin: 0 0 1em; }

/* ===== Контейнер ===== */
.shell {
    width: min(92%, 1180px);
    margin-inline: auto;
}

/* ===== Шапка ===== */
.site-head {
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    padding: 22px 0;
}
.head-row {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--ink);
    min-width: 0;
}
.brand-logo,
.brand svg.brand-logo { width: 46px; height: 46px; flex: none; display: block; }
.brand-text { min-width: 0; }
.brand-title { font-size: 1.05rem; font-weight: 600; color: var(--ink); line-height: 1.2; }
.brand-tagline { font-size: 0.82rem; color: var(--muted); margin-top: 3px; line-height: 1.35; }

.site-nav { margin-left: auto; }
.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    cursor: pointer;
    color: var(--ink);
}
.menu-main {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
}
.menu-main a {
    color: var(--ink-soft);
    font-weight: 500;
    padding: 6px 0;
    position: relative;
}
.menu-main a:hover,
.menu-main .current-menu-item > a {
    color: var(--accent);
}
.menu-main .current-menu-item > a::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: var(--brass);
    border-radius: 2px;
}

/* ===== Хлебные крошки ===== */
.breadcrumbs {
    font-size: 0.86rem;
    color: var(--muted);
    padding: 16px 0 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { color: var(--line); }

/* ===== Основной layout ===== */
.site-main { padding: 24px 0 60px; }
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 48px;
    align-items: start;
}
.layout-single .content-area {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}
.content-area { min-width: 0; }
.sidebar { min-width: 0; }

/* ===== Карточки записей ===== */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: row;
    transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover {
    transform: scale(1.005);
    box-shadow: var(--shadow-hover);
}
.card-thumb-wrap {
    flex: 0 0 40%;
    position: relative;
    overflow: hidden;
    background: var(--bg-soft);
    min-height: 200px;
}
.card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.card-thumb-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.9rem;
    background: linear-gradient(135deg, var(--bg-soft), var(--line));
}
.card-cat-icon {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    color: var(--ink);
}
.card-body {
    flex: 1;
    min-width: 0;
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
}
.card-cats {
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 8px;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}
.card-cats a { color: var(--muted); }
.card-cats a:hover { color: var(--accent); }
.card-title {
    margin: 0 0 10px;
    font-size: 1.2rem;
    line-height: 1.3;
}
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent); }
.card-excerpt {
    color: var(--ink-soft);
    font-size: 0.95rem;
    margin-bottom: 14px;
    flex: 1;
}
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 14px;
}
.read-more {
    align-self: flex-start;
    color: var(--accent);
    font-weight: 500;
    font-size: 0.95rem;
}
.read-more::after { content: ' →'; }
.read-more:hover { color: var(--accent-bright); text-decoration: underline; }

@media (max-width: 600px) {
    .card { flex-direction: column; }
    .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
        min-height: 0;
    }
    .card-thumb-wrap a { position: static; }
    .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    .card-body { padding: 18px 18px 22px; }
}

/* ===== Кнопки ===== */
.btn {
    display: inline-block;
    padding: 11px 22px;
    border-radius: var(--radius);
    background: var(--accent);
    color: #FFFFFF;
    border: 1px solid var(--accent);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
    text-decoration: none;
}
.btn:hover {
    color: #FFFFFF;
    transform: translateY(-0.5px);
    box-shadow: 0 6px 14px rgba(43,95,138,0.25);
    border-color: var(--accent);
}
.btn-soft {
    background: rgba(43,95,138,0.08);
    color: var(--accent);
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.btn-soft:hover { color: var(--accent); background: rgba(43,95,138,0.14); }

/* ===== Запись (single) ===== */
.entry { margin-bottom: 40px; }
.entry-title { font-size: 2.1rem; margin-top: 12px; }
.entry-meta { color: var(--muted); font-size: 0.88rem; margin-bottom: 18px; }
.entry-meta a { color: var(--muted); }
.entry-meta a:hover { color: var(--accent); }
.entry-thumb {
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 26px;
    background: var(--bg-soft);
}
.entry-thumb img { display: block; width: 100%; height: auto; }

.entry-content { font-size: 1.05rem; line-height: 1.75; }
.entry-content h2,
.entry-content h3 { color: var(--ink); }
.entry-content img { border-radius: var(--radius-sm); margin: 16px 0; }
.entry-content blockquote {
    margin: 22px 0;
    padding: 14px 22px;
    border-left: 3px solid var(--brass);
    background: var(--bg-soft);
    color: var(--ink);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li { margin: 0.3em 0; }
.entry-content code {
    background: var(--bg-soft);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.92em;
}
.entry-content pre {
    background: var(--bg-soft);
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
}

.expert-note {
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin: 0 0 26px;
    color: var(--ink);
    font-size: 0.98rem;
    border-left: 3px solid var(--brass);
}
.expert-note-label {
    font-weight: 600;
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 6px;
    display: block;
}

.expert-trace {
    margin-top: 30px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 0.86rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.expert-trace-bar {
    display: inline-block;
    height: 6px;
    width: 64px;
    background: var(--brass);
    border-radius: 3px;
    opacity: 0.75;
}

.ecosystem-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    background: rgba(107,191,123,0.12);
    color: var(--mint);
    margin: 18px 0;
}
.ecosystem-chip::before {
    content: '●';
    color: var(--mint);
}

/* ===== Таблицы ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95rem;
}
th, td {
    border: 1px solid var(--line);
    padding: 9px 12px;
    text-align: left;
}
th { background: var(--bg-soft); color: var(--ink); font-weight: 600; }

/* ===== Сайдбар и виджеты ===== */
.sidebar {
    background: var(--bg-soft);
    border-radius: var(--radius);
    padding: 22px 22px 8px;
}
.widget { margin-bottom: 22px; }
.widget:last-child { margin-bottom: 14px; }
.widget-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--ink);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
}
.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.widget li {
    padding: 8px 0;
    border-bottom: 1px dashed var(--line);
}
.widget li:last-child { border-bottom: none; }
.widget a { color: var(--ink); }
.widget a:hover { color: var(--accent); }
.widget .post-date,
.widget .rss-date {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 3px;
}
.widget p { color: var(--ink-soft); font-size: 0.94rem; margin: 0 0 0.6em; }

/* ===== Подвал ===== */
.site-foot {
    margin-top: 30px;
    background: #14141A;
    color: #D5D5DA;
    padding: 46px 0 22px;
}
.foot-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px;
    margin-bottom: 32px;
}
.foot-col { min-width: 0; }
.foot-col .widget-title {
    color: #F2F2F4;
    border-bottom-color: rgba(255,255,255,0.12);
}
.foot-col .widget { color: #B8B8BD; }
.foot-col .widget p,
.foot-col .widget li,
.foot-col .widget { color: #B8B8BD; }
.foot-col .widget a { color: #E4E4E8; }
.foot-col .widget a:hover { color: var(--accent-bright); }
.foot-col .widget li { border-bottom-color: rgba(255,255,255,0.08); }
.foot-col .widget .post-date,
.foot-col .widget .rss-date { color: #8B8B92; }

.foot-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    font-size: 0.86rem;
    color: #8B8B92;
    text-align: center;
}

/* ===== Пагинация ===== */
.pagination {
    margin-top: 36px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}
.pagination .page-numbers {
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    color: var(--ink);
    background: var(--bg-soft);
    font-size: 0.92rem;
    min-width: 38px;
    text-align: center;
    transition: background .18s ease, color .18s ease;
}
.pagination .page-numbers.current {
    background: var(--accent);
    color: #FFFFFF;
}
.pagination a.page-numbers:hover {
    background: var(--accent);
    color: #FFFFFF;
}

/* ===== Поиск ===== */
.search-form {
    display: flex;
    gap: 8px;
    margin: 14px 0 22px;
}
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--ink);
    font-size: 0.95rem;
}
.search-form button {
    padding: 10px 18px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #FFFFFF;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.92rem;
}
.search-form button:hover { background: var(--accent-bright); border-color: var(--accent-bright); }

/* ===== Комментарии ===== */
.comments-area { margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--line); }
.comments-title { font-size: 1.3rem; margin-bottom: 18px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; padding-left: 28px; margin-top: 14px; }
.comment-body {
    background: var(--bg-soft);
    padding: 16px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
}
.comment-meta { font-size: 0.86rem; color: var(--muted); margin-bottom: 6px; }
.comment-meta a { color: var(--muted); }
.comment-form textarea,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--ink);
    font: inherit;
    margin-top: 4px;
}
.comment-form textarea { min-height: 110px; resize: vertical; }
.comment-form .form-submit input[type="submit"] {
    padding: 11px 22px;
    border-radius: var(--radius);
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #FFFFFF;
    cursor: pointer;
    font: inherit;
}
.comment-form .form-submit input[type="submit"]:hover { background: var(--accent-bright); border-color: var(--accent-bright); }

/* ===== Главная — тематические блоки ===== */
.front-block {
    background: var(--bg-soft);
    border-radius: var(--radius);
    padding: 36px 32px;
    margin-bottom: 30px;
}
.front-block-eyebrow {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--brass);
    margin-bottom: 10px;
    font-weight: 600;
}
.front-block h2 { margin-top: 0; }
.front-block-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-top: 22px;
}
.front-block-item {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 18px 18px 20px;
    box-shadow: var(--shadow);
}
.front-block-item h3 { margin: 0 0 6px; font-size: 1.05rem; }
.front-block-item p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

.front-section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin: 22px 0 18px;
}
.front-section-title h2 { margin: 0; }

/* ===== Cookie-баннер ===== */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 999;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    padding: 16px 20px;
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}
.cookie-banner p { margin: 0; flex: 1; min-width: 220px; font-size: 0.92rem; color: var(--ink-soft); }
.cookie-banner button {
    padding: 9px 18px;
    border-radius: var(--radius);
    background: var(--accent);
    color: #FFFFFF;
    border: 1px solid var(--accent);
    cursor: pointer;
    font-size: 0.92rem;
}
.cookie-banner button:hover { background: var(--accent-bright); border-color: var(--accent-bright); }

/* ===== 404 ===== */
.error-404 {
    text-align: center;
    padding: 40px 0;
}
.error-404 .big {
    font-size: 4.5rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 10px;
}

/* ===== Адаптив ===== */
@media (max-width: 960px) {
    .layout-with-sidebar {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .foot-cols { grid-template-columns: 1fr 1fr; gap: 26px; }
}
@media (max-width: 720px) {
    .nav-toggle { display: inline-block; }
    .site-nav .menu-main {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0;
        margin-top: 12px;
    }
    .site-nav.is-open .menu-main {
        display: flex;
    }
    .menu-main li {
        border-bottom: 1px solid var(--line);
    }
    .menu-main a { padding: 12px 0; display: block; }
    .site-nav { margin-left: auto; width: auto; }
    .site-nav.is-open { width: 100%; }
    .foot-cols { grid-template-columns: 1fr; }
    .layout-single .content-area { width: 100%; }
    h1, .entry-title { font-size: 1.55rem; }
    h2 { font-size: 1.3rem; }
    .front-block { padding: 26px 22px; }
}
