/*
Theme Name: dds_bitbonnies.com
Author: Виктор Зайцев
Description: Информационная тема о цифровых надписях и коллекционных форматах: происхождение объектов, редкость, хранение, терминология и ограничения технологии.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: bitbonnies
*/

/* ============ Базовые сбросы и переменные ============ */
:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --ink: #1b2130;
    --muted: #5a6377;
    --accent: #4b5bd4;
    --accent-ink: #3444b8;
    --accent-2: #12a594;
    --dark: #151a2b;
    --dark-2: #1e2540;
    --border: #e2e6f0;
    --radius: 12px;
    --shell: min(92%, 1180px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

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

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

p { margin: 0 0 1em; }

.shell {
    width: var(--shell);
    margin-inline: auto;
}

.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ============ Шапка ============ */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    padding: 1.05rem 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-width: 0;
}
.brand-logo, .brand-logo svg { display: block; width: 52px; height: 52px; flex: 0 0 auto; }
.brand-text { min-width: 0; }
.brand-title {
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
    line-height: 1.2;
}
.brand-title a { color: inherit; }
.brand-desc {
    font-size: .82rem;
    color: var(--muted);
    margin: .2rem 0 0;
}

.main-nav { margin-left: auto; }
.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1.15rem;
    margin: 0; padding: 0;
}
.main-nav a {
    display: inline-block;
    padding: .35rem .2rem;
    color: var(--ink);
    font-weight: 500;
    font-size: .96rem;
}
.main-nav a:hover { color: var(--accent-ink); text-decoration: none; }
.main-nav .current-menu-item a { color: var(--accent-ink); }

.nav-toggle {
    display: none;
    margin-left: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .5rem .7rem;
    font-size: 1rem;
    color: var(--ink);
    cursor: pointer;
}

/* ============ Раскладки ============ */
.site-main { padding: 2.2rem 0 2.8rem; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 2.4rem;
    align-items: start;
}
.layout-single .content-area,
.narrow {
    width: 85%;
    margin-inline: auto;
}
.content-area { min-width: 0; }

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

/* ============ Сайдбар ============ */
.sidebar {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.3rem 1.4rem;
}
.sidebar .widget { margin-bottom: 1.6rem; }
.sidebar .widget:last-child { margin-bottom: 0; }
.sidebar .widget-title {
    font-size: 1.05rem;
    margin: 0 0 .8rem;
    color: var(--ink);
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--accent);
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin: 0 0 .6rem; padding: 0 0 .6rem; border-bottom: 1px solid var(--border); }
.sidebar li:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.sidebar a { color: var(--ink); }
.sidebar a:hover { color: var(--accent-ink); }
.sidebar .post-date, .sidebar .rss-date { display: block; font-size: .78rem; color: var(--muted); margin-top: .15rem; }

/* ============ Карточки записей ============ */
.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.6rem;
}
.card-thumb-wrap {
    display: block;
    overflow: hidden;
    background: linear-gradient(135deg, #e9ecf7, #dfe3f2);
}
.card-thumb-wrap img {
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 8.5;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.card-thumb-wrap:hover img { transform: scale(1.03); }
.card-body {
    flex: 1;
    padding: 1.25rem 1.4rem 1.4rem;
    min-width: 0;
}
.card-title { font-size: 1.28rem; margin: 0 0 .45rem; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent-ink); text-decoration: none; }
.card-meta { font-size: .82rem; color: var(--muted); margin: 0 0 .7rem; }
.card-excerpt { color: #35404f; }
.card-excerpt p { margin: 0 0 .5em; background: none; }
.card-more {
    display: inline-block;
    margin-top: .5rem;
    font-weight: 600;
    color: var(--accent-ink);
}
.card-more:hover { text-decoration: none; border-bottom: 1px solid currentColor; }

/* Горизонтальные карточки (архивы/поиск) */
.card-row {
    flex-direction: row;
    align-items: stretch;
}
.card-row .card-thumb-wrap {
    flex: 0 0 260px;
    position: relative;
}
.card-row .card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.card-row .card-thumb-wrap img {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
    display: block;
}
@media (max-width: 600px) {
    .card-row { flex-direction: column; }
    .card-row .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
    .card-row .card-thumb-wrap a { position: static; }
    .card-row .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
}

/* ============ Одиночная запись / страница ============ */
.entry {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.8rem 2rem 2.1rem;
}
.entry-header { margin-bottom: 1.2rem; }
.entry-title { margin: 0 0 .4rem; }
.entry-meta { font-size: .85rem; color: var(--muted); }
.entry-thumb { margin: 0 0 1.4rem; border-radius: 10px; overflow: hidden; }
.entry-thumb img { width: 100%; display: block; }
.entry-content { min-width: 0; }
.entry-content img { border-radius: 8px; display: block; margin: 1rem 0; }
.entry-content h2 { margin-top: 1.6rem; }
.entry-content ul, .entry-content ol { padding-left: 1.3rem; }
.entry-content blockquote {
    margin: 1.4rem 0;
    padding: 1rem 1.3rem;
    background: #eef1fb;
    border-left: 4px solid var(--accent);
    border-radius: 6px;
    color: #2a3346;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }

@media (max-width: 600px) {
    .entry { padding: 1.3rem 1.2rem 1.5rem; }
}

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

/* ============ Хлебные крошки ============ */
.breadcrumbs {
    font-size: .85rem;
    color: var(--muted);
    padding: .9rem 0 0;
}
.breadcrumbs a { color: var(--accent-ink); }
.breadcrumbs .sep { margin: 0 .35rem; color: #aab0c0; }

/* ============ Пагинация ============ */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    justify-content: center;
    margin: 2rem 0 .5rem;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 .7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 500;
    text-decoration: none;
}
.pagination a.page-numbers:hover {
    border-color: var(--accent);
    color: var(--accent-ink);
}
.pagination .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.pagination .page-numbers.dots {
    border: 0;
    background: transparent;
}

/* ============ Главная ============ */
.front { width: min(85%, 1180px); margin-inline: auto; padding: 2.4rem 0 3rem; }
@media (max-width: 600px) { .front { width: 92%; } }
.front-section { margin-bottom: 2.8rem; }
.front-section:last-child { margin-bottom: 0; }
.section-head { margin-bottom: 1.4rem; }
.section-head h2 { margin: 0 0 .3rem; }
.section-head .sub { color: var(--muted); margin: 0; }

/* Блок текст + иллюстрация */
.fs-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.2rem;
    align-items: center;
}
.fs-split.reverse .fs-media { order: -1; }
.fs-media img, .fs-media svg {
    width: 100%;
    display: block;
    border-radius: var(--radius);
}
.fs-text h2 { margin-top: 0; }
@media (max-width: 760px) {
    .fs-split { grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }
    .fs-split.reverse .fs-media { order: 0; }
}

/* Сетка карточек-тезисов */
.fs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.3rem;
}
.fs-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1.4rem;
    min-width: 0;
}
.fs-tile .icon {
    width: 46px; height: 46px;
    display: flex; align-items: center; justify-content: center;
    background: #eef1fb;
    border-radius: 10px;
    margin-bottom: .9rem;
}
.fs-tile .icon svg { width: 26px; height: 26px; display: block; }
.fs-tile h3 { margin: 0 0 .4rem; font-size: 1.12rem; }
.fs-tile p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Последние записи на главной */
.fs-latest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.4rem;
}
.fs-latest-grid .card { margin-bottom: 0; }

/* FAQ */
.fs-faq { display: grid; gap: .8rem; }
.faq-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 1.3rem;
}
.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    padding: 1.05rem 0;
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    font-size: 1.3rem;
    color: var(--accent);
    flex: 0 0 auto;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item .faq-body { padding: 0 0 1.1rem; color: #35404f; }
.faq-item .faq-body p { margin: 0; }

/* CTA */
.fs-cta {
    background: var(--dark);
    color: #eef1fb;
    border-radius: 16px;
    padding: 2.6rem 2.4rem;
    text-align: center;
}
.fs-cta h2 { color: #fff; margin: 0 0 .6rem; }
.fs-cta p { color: #c3c9de; max-width: 620px; margin: 0 auto 1.4rem; }
.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: .8rem 1.7rem;
    border-radius: 10px;
    font-weight: 600;
}
.btn:hover { background: var(--accent-ink); text-decoration: none; }
@media (max-width: 600px) {
    .fs-cta { padding: 1.9rem 1.4rem; }
}

/* ============ Поиск (форма) ============ */
.search-form {
    display: flex;
    gap: .5rem;
    max-width: 460px;
}
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: .65rem .9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}
.search-form button {
    padding: .65rem 1.2rem;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}
.search-form button:hover { background: var(--accent-ink); }

/* ============ 404 ============ */
.error-404 { text-align: center; padding: 1rem 0 2rem; }
.error-404 .big { font-size: 4.5rem; font-weight: 800; color: var(--accent); margin: 0; line-height: 1; }
.error-404 .search-form { margin: 1.5rem auto 0; }

/* ============ Комментарии ============ */
.comments-area { margin-top: 2rem; }
.comments-area .comment-list { list-style: none; margin: 0; padding: 0; }
.comments-area .comment-list ul { list-style: none; padding-left: 1.5rem; }
.comments-area .comment-body {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
}
.comments-area .comment-author { font-weight: 600; }
.comments-area .comment-meta { font-size: .8rem; color: var(--muted); }
.comment-respond {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.3rem 1.5rem;
    margin-top: 1.4rem;
}
.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(--border);
    border-radius: 8px;
    font-size: 1rem;
    margin-top: .3rem;
}
.comment-form p { margin-bottom: .9rem; }
.comment-form .submit {
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: .7rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
}

/* ============ Подвал ============ */
.site-footer {
    background: var(--dark);
    color: #c3c9de;
    padding: 2.8rem 0 1.4rem;
    margin-top: 2rem;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 2rem;
}
.footer-col { min-width: 0; }
.site-footer .widget-title {
    color: #fff;
    font-size: 1.05rem;
    margin: 0 0 .9rem;
}
.site-footer .widget { margin: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0 0 .55rem; }
.site-footer a { color: #c3c9de; }
.site-footer a:hover { color: #fff; }
.site-footer p { color: #b6bcd2; }
.site-footer .post-date { display: block; font-size: .78rem; color: #8b93b0; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.12);
    margin-top: 2rem;
    padding-top: 1.2rem;
    font-size: .85rem;
    color: #9aa2bd;
    text-align: center;
}

/* ============ Cookie-баннер ============ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: rgba(21,26,43,.97);
    color: #e6e9f5;
    padding: 1rem 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,.2);
}
.cookie-inner {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    justify-content: space-between;
}
.cookie-banner p { margin: 0; font-size: .9rem; flex: 1; min-width: 240px; }
.cookie-banner a { color: #9db0ff; }
.cookie-accept {
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: .6rem 1.4rem;
    font-weight: 600;
    cursor: pointer;
    flex: 0 0 auto;
}
.cookie-accept:hover { background: var(--accent-ink); }

/* ============ Мобильное меню ============ */
@media (max-width: 860px) {
    .nav-toggle { display: inline-block; }
    .main-nav {
        flex-basis: 100%;
        margin-left: 0;
        display: none;
    }
    .main-nav.open { display: block; }
    .main-nav ul { flex-direction: column; gap: 0; }
    .main-nav li { border-bottom: 1px solid var(--border); }
    .main-nav a { display: block; padding: .7rem .2rem; }
}
