/*
Theme Name: dds_getbookstore.ru
Author: Мария Шелест
Description: Информационная тема для медиаплатформы о непрерывном развитии GetBookStore — книги, образовательные платформы и продуктивность.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: gbs
*/

/* ============================================================
   Переменные и сброс
   ============================================================ */
:root {
    --c-bg: #f7f4ee;
    --c-surface: #ffffff;
    --c-ink: #28241f;
    --c-muted: #6b6358;
    --c-primary: #1f3a5f;
    --c-primary-dark: #15293f;
    --c-accent: #d2873a;
    --c-accent-soft: #f3e3cf;
    --c-line: #e4ddd0;
    --c-footer: #15293f;
    --c-footer-ink: #d8e0ea;
    --c-footer-muted: #8ea2bb;
    --radius: 12px;
    --shell: min(92%, 1180px);
    --serif: Georgia, "Times New Roman", serif;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.7;
    color: var(--c-ink);
    background: var(--c-bg);
    overflow-x: hidden;
}

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

a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
    font-family: var(--serif);
    line-height: 1.25;
    color: var(--c-primary-dark);
    margin: 0 0 0.6em;
}
h1 { font-size: 2.05rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }

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

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--c-primary);
    color: #fff;
    padding: 10px 16px;
    z-index: 999;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ============================================================
   Шапка
   ============================================================ */
.site-header {
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-line);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.4rem;
    padding: 1rem 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}
.brand-logo { display: block; flex: 0 0 auto; }
.brand-logo img { display: block; width: auto; height: 46px; }
.brand-text { min-width: 0; }
.brand-name {
    font-family: var(--serif);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--c-primary-dark);
    line-height: 1.25;
    display: block;
    max-width: 30ch;
}
.brand-desc {
    font-size: 0.82rem;
    color: var(--c-muted);
    line-height: 1.4;
    display: block;
    max-width: 46ch;
}

/* Навигация */
.nav-toggle {
    display: none;
    background: var(--c-primary);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 0.95rem;
    cursor: pointer;
}
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.main-nav a {
    display: block;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    color: var(--c-primary-dark);
    font-weight: 600;
    font-size: 0.97rem;
}
.main-nav a:hover { background: var(--c-accent-soft); text-decoration: none; }
.main-nav .current-menu-item > a { background: var(--c-primary); color: #fff; }

/* ============================================================
   Каркас контента
   ============================================================ */
.site-main { padding: 2.2rem 0 3rem; }

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

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

/* Хлебные крошки */
.breadcrumbs {
    font-size: 0.86rem;
    color: var(--c-muted);
    margin-bottom: 1.4rem;
}
.breadcrumbs a { color: var(--c-primary); }
.breadcrumbs .sep { margin: 0 0.35rem; color: var(--c-accent); }

/* ============================================================
   Сайдбар
   ============================================================ */
.sidebar { min-width: 0; }
.sidebar .widget {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 1.3rem 1.4rem;
    margin-bottom: 1.4rem;
    color: var(--c-ink);
}
.sidebar .widget-title {
    font-size: 1.1rem;
    color: var(--c-primary-dark);
    margin-bottom: 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--c-accent-soft);
}
.sidebar .widget a { color: var(--c-primary); }
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li { padding: 0.45rem 0; border-bottom: 1px solid var(--c-line); }
.sidebar .widget li:last-child { border-bottom: 0; }
.sidebar .widget .post-date { display: block; font-size: 0.8rem; color: var(--c-muted); }

/* ============================================================
   Карточки записей (A8, A10)
   ============================================================ */
.card-list { display: grid; gap: 1.6rem; }

.card {
    display: flex;
    flex-direction: column;
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    overflow: hidden;
}
.card-thumb-wrap {
    flex: 0 0 auto;
    overflow: hidden;
}
.card-thumb-wrap a { display: block; }
.card-thumb-wrap img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}
.card-body {
    flex: 1;
    padding: 1.3rem 1.4rem 1.5rem;
    display: flex;
    flex-direction: column;
}
.card-title { font-size: 1.3rem; margin-bottom: 0.5rem; }
.card-title a { color: var(--c-primary-dark); }
.card-meta {
    font-size: 0.82rem;
    color: var(--c-muted);
    margin-bottom: 0.7rem;
}
.card-excerpt { color: var(--c-ink); }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    align-self: flex-start;
    margin-top: auto;
    padding-top: 0.6rem;
    font-weight: 600;
    color: var(--c-accent);
}

/* Горизонтальные карточки на широких экранах */
@media (min-width: 760px) {
    .card-list.list-rows .card { flex-direction: row; }
    .card-list.list-rows .card-thumb-wrap {
        flex: 0 0 300px;
        position: relative;
    }
    .card-list.list-rows .card-thumb-wrap a {
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
    }
    .card-list.list-rows .card-thumb-wrap img {
        width: 100%;
        height: 100%;
        aspect-ratio: auto;
        object-fit: cover;
        display: block;
    }
}

/* ============================================================
   Одиночная запись / страница
   ============================================================ */
.entry {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 1.8rem 2rem 2.2rem;
}
.entry-header { margin-bottom: 1.2rem; }
.entry-title { font-size: 2rem; }
.entry-meta { font-size: 0.85rem; color: var(--c-muted); }
.entry-thumb { margin: 0 0 1.4rem; border-radius: var(--radius); overflow: hidden; }
.entry-thumb img { display: block; width: 100%; height: auto; }
.entry-content { min-width: 0; }
.entry-content img { border-radius: 8px; }
.entry-content h2 { margin-top: 1.6rem; }
.entry-content blockquote {
    margin: 1.4rem 0;
    padding: 1rem 1.4rem;
    background: var(--c-accent-soft);
    border-left: 4px solid var(--c-accent);
    border-radius: 8px;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-tags { margin-top: 1.6rem; font-size: 0.88rem; color: var(--c-muted); }
.entry-tags a { color: var(--c-primary); }

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2rem 0;
}
table th, table td {
    border: 1px solid var(--c-line);
    padding: 0.6rem 0.8rem;
    text-align: left;
}
table th { background: var(--c-accent-soft); }

/* ============================================================
   Пагинация (D5)
   ============================================================ */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 2rem 0 0.5rem;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--c-line);
    border-radius: 8px;
    background: var(--c-surface);
    color: var(--c-primary-dark);
    font-weight: 600;
    text-decoration: none;
}
.pagination a.page-numbers:hover { background: var(--c-accent-soft); }
.pagination .page-numbers.current {
    background: var(--c-primary);
    border-color: var(--c-primary);
    color: #fff;
}
.pagination .page-numbers.dots {
    border: 0;
    background: none;
    min-width: auto;
}

/* ============================================================
   Главная — секции
   ============================================================ */
.front-section { padding: 2.8rem 0; }
.front-section + .front-section { border-top: 1px solid var(--c-line); }
.section-head { max-width: 56ch; margin-bottom: 1.6rem; }
.section-head .eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-accent);
    font-weight: 700;
    margin-bottom: 0.4rem;
}
.section-head p { color: var(--c-muted); margin-bottom: 0; }

/* Блок 1: текст + иллюстрация */
.fs-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.4rem;
    align-items: center;
}
.fs-split .fs-illu img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
}
.fs-split .fs-copy h2 { font-size: 1.9rem; }
.fs-split .fs-copy .lead { font-size: 1.08rem; color: var(--c-ink); }

/* Блок 2: сетка направлений */
.fs-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.4rem;
}
.fs-card {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 1.6rem 1.5rem;
}
.fs-card .fs-ico {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--c-accent-soft);
    margin-bottom: 1rem;
}
.fs-card h3 { margin-bottom: 0.4rem; }
.fs-card p { color: var(--c-muted); margin-bottom: 0; font-size: 0.96rem; }

/* Последние записи на главной */
.fs-latest .card-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Блок 3: галерея */
.fs-gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}
.fs-gallery figure { margin: 0; border-radius: var(--radius); overflow: hidden; }
.fs-gallery img {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

/* Блок 4: CTA */
.fs-cta {
    background: var(--c-primary);
    color: #fff;
    border-radius: 16px;
    padding: 2.6rem 2.4rem;
    text-align: center;
}
.fs-cta h2 { color: #fff; }
.fs-cta p { color: #dbe4f0; max-width: 56ch; margin-inline: auto; }
.btn {
    display: inline-block;
    background: var(--c-accent);
    color: #fff;
    font-weight: 700;
    padding: 0.8rem 1.7rem;
    border-radius: 10px;
    margin-top: 0.6rem;
}
.btn:hover { background: #c1782f; text-decoration: none; }

/* ============================================================
   Комментарии
   ============================================================ */
.comments-area {
    margin-top: 2rem;
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 1.6rem 1.8rem;
}
.comments-title { font-size: 1.4rem; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 1.4rem; padding: 0; }
.comment-item { margin: 1rem 0; }
.comment-inner {
    border: 1px solid var(--c-line);
    border-radius: 10px;
    padding: 1rem 1.2rem;
}
.comment-head { display: flex; gap: 0.8rem; align-items: baseline; margin-bottom: 0.4rem; }
.comment-author { font-weight: 700; color: var(--c-primary-dark); }
.comment-date { font-size: 0.8rem; color: var(--c-muted); }
.comment-await { font-size: 0.85rem; color: var(--c-accent); }
.comment-form-cookies-consent { font-size: 0.85rem; }
.comments-area input[type="text"],
.comments-area input[type="email"],
.comments-area input[type="url"],
.comments-area textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--c-line);
    border-radius: 8px;
    font: inherit;
    background: var(--c-bg);
}
.comments-area .submit,
.search-form button {
    background: var(--c-primary);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 0.6rem 1.4rem;
    font-weight: 600;
    cursor: pointer;
}

/* ============================================================
   Форма поиска
   ============================================================ */
.search-form {
    display: flex;
    gap: 0.5rem;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--c-line);
    border-radius: 8px;
    font: inherit;
    background: var(--c-surface);
}

/* ============================================================
   404
   ============================================================ */
.error-404 {
    text-align: center;
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 2.6rem 2rem;
}
.error-404 .code { font-size: 4rem; color: var(--c-accent); font-family: var(--serif); margin: 0; }
.error-404 .search-form { max-width: 420px; margin: 1.4rem auto 0; }

/* ============================================================
   Подвал
   ============================================================ */
.site-footer {
    background: var(--c-footer);
    color: var(--c-footer-ink);
    padding: 2.6rem 0 1.4rem;
    margin-top: 2rem;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
}
.site-footer .widget { margin-bottom: 1rem; color: var(--c-footer-ink); }
.site-footer .widget-title {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
}
.site-footer .widget p { color: var(--c-footer-ink); }
.site-footer .widget a { color: #fff; }
.site-footer .widget a:hover { color: var(--c-accent); }
.site-footer .widget ul { list-style: none; margin: 0; padding: 0; }
.site-footer .widget li { padding: 0.35rem 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.site-footer .widget li:last-child { border-bottom: 0; }
.site-footer .widget .post-date { color: var(--c-footer-muted); font-size: 0.8rem; }
.site-copy {
    margin-top: 1.8rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(255,255,255,0.12);
    font-size: 0.85rem;
    color: var(--c-footer-muted);
}

/* ============================================================
   Cookie-баннер (D6, A11)
   ============================================================ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 900;
    background: var(--c-primary-dark);
    color: #fff;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}
.cookie-banner p { margin: 0; font-size: 0.9rem; max-width: 70ch; }
.cookie-banner a { color: var(--c-accent); }
.cookie-accept {
    background: var(--c-accent);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 0.6rem 1.4rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

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

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.7rem; }
    .entry-title { font-size: 1.55rem; }
    .nav-toggle { display: inline-block; }
    .main-nav {
        flex-basis: 100%;
        display: none;
    }
    .main-nav.is-open { display: block; }
    .main-nav ul { flex-direction: column; gap: 0.2rem; }
    .layout-single .content-area { width: 100%; }
    .fs-split { grid-template-columns: 1fr; }
    .fs-grid { grid-template-columns: 1fr; }
    .fs-latest .card-list { grid-template-columns: 1fr; }
    .fs-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fs-cta { padding: 1.9rem 1.4rem; }
    .entry { padding: 1.3rem 1.2rem 1.6rem; }
    .footer-cols { grid-template-columns: 1fr; }

    .card-list.list-rows .card { flex-direction: column; }
    .card-list.list-rows .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
    .card-list.list-rows .card-thumb-wrap a { position: static; }
    .card-list.list-rows .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
}
