/*
Theme Name: dds_polzaverd.ru
Theme URI: https://polzaverd.ru/
Author: Алексей Кравцов
Description: Тема для образовательного портала по обществознанию и мировой истории с разделом аналитики. Японский минимализм с лавандовым техно-акцентом.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: pvctx
*/

/* ==================================================================
   1. Переменные и база
   ================================================================== */

:root {
    --bg: #F3F0F5;
    --bg-alt: #E9E4ED;
    --dark: #1E1A2E;
    --side: #F9F7FA;
    --ink: #1A1625;
    --accent: #6C4B9E;
    --accent-deep: #563C7E;
    --accent-2: #B8A1D4;
    --muted: #7A6F87;
    --line: #D6CDDF;
    --paper: #FDFCFE;
    --head-font: "Montserrat", "Futura", "Segoe UI", Arial, sans-serif;
    --body-font: "Literata", "Spectral", Georgia, "Times New Roman", serif;
    --shadow-card: 3px 5px 16px rgba(26, 22, 37, 0.06);
    --shadow-card-hover: 5px 9px 22px rgba(26, 22, 37, 0.10);
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    color: var(--ink);
    font-family: var(--body-font);
    font-size: 17px;
    line-height: 1.78;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* декоративный блоб в левом верхнем углу */
body::before {
    content: "";
    position: fixed;
    top: -12%;
    left: -10%;
    width: 40%;
    height: 46%;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, #6C4B9E 0%, #B8A1D4 62%, rgba(184, 161, 212, 0) 74%);
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
}

.site-header,
.site-main,
.site-footer,
.cookie-banner {
    position: relative;
    z-index: 1;
}

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

a {
    color: var(--accent);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--head-font);
    color: var(--ink);
    letter-spacing: 0.045em;
    line-height: 1.24;
    font-weight: 600;
    margin: 0 0 0.7em;
}

h1 {
    font-size: 3.4rem;
    letter-spacing: 0.03em;
    margin-bottom: 0.55em;
}

h2 {
    font-size: 1.95rem;
}

h3 {
    font-size: 1.35rem;
}

p {
    margin: 0 0 1.15em;
}

.shell {
    width: min(92%, 1180px);
    margin-inline: auto;
}

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

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ==================================================================
   2. Кнопки и ссылки
   ================================================================== */

.btn {
    display: inline-block;
    font-family: var(--head-font);
    font-size: 0.86rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 600;
    padding: 0.9rem 1.9rem;
    border-radius: 4px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 3px 0 rgba(26, 22, 37, 0.14);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    cursor: pointer;
}

.btn:hover,
.btn:focus {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(26, 22, 37, 0.3);
    background: var(--accent-deep);
    color: #fff;
}

.btn-secondary {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent-2);
    box-shadow: 0 3px 0 rgba(184, 161, 212, 0.35);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background: rgba(184, 161, 212, 0.18);
    color: var(--accent-deep);
}

/* текстовые ссылки: пунктирное подчёркивание «от руки» */
.entry-content a,
.tx-link,
.comment-text a,
.widget .textwidget a {
    color: var(--accent);
    text-decoration: none;
    background-image: linear-gradient(to right, var(--accent) 0 4px, rgba(0, 0, 0, 0) 4px 8px);
    background-repeat: repeat-x;
    background-position: 0 100%;
    background-size: 0 1px;
    padding-bottom: 2px;
    transition: background-size 0.28s ease;
}

.entry-content a:hover,
.tx-link:hover,
.comment-text a:hover,
.widget .textwidget a:hover {
    background-size: 100% 1px;
}

/* ==================================================================
   3. Шапка
   ================================================================== */

.site-header {
    background: var(--dark);
    color: #fff;
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(184, 161, 212, 0.2);
}

.header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.4rem;
}

.brand {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    min-width: 0;
    max-width: 640px;
    text-decoration: none;
}

.brand-logo,
.brand svg.brand-logo {
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
}

.brand-text {
    min-width: 0;
}

.site-title {
    font-family: var(--head-font);
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    line-height: 1.4;
    margin: 0;
}

.site-title a {
    color: #fff;
    text-decoration: none;
}

.site-title a:hover {
    color: var(--accent-2);
}

.site-desc {
    margin: 0.5rem 0 0;
    font-size: 0.8rem;
    line-height: 1.55;
    color: #C9BEDA;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--accent-2);
    border-radius: 4px;
    color: #fff;
    font-family: var(--head-font);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.55rem 1rem;
    cursor: pointer;
}

.main-nav[hidden] {
    display: none !important;
}

.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1.6rem;
    margin: 0;
    padding: 0;
}

.main-nav a {
    color: #fff;
    text-decoration: none;
    font-family: var(--head-font);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding-bottom: 5px;
    border-bottom: 1px dashed transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.main-nav a:hover,
.main-nav .current-menu-item > a {
    color: var(--accent-2);
    border-bottom-color: var(--accent-2);
}

/* ==================================================================
   4. Каркас страниц
   ================================================================== */

.site-main {
    padding: 2.6rem 0 4rem;
}

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67%) minmax(0, 27%);
    justify-content: space-between;
    gap: 2rem;
    align-items: start;
}

.layout-single {
    display: block;
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}

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

.breadcrumbs {
    font-family: var(--head-font);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 1.6rem;
}

.breadcrumbs a {
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px dashed var(--line);
}

.breadcrumbs a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.breadcrumbs .sep {
    margin: 0 0.45rem;
    color: var(--accent-2);
}

.page-heading {
    position: relative;
    margin: 0 0 2rem;
    padding-left: 1.1rem;
}

.page-heading::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.24em;
    width: 2px;
    height: 1.5em;
    background: var(--accent);
}

.page-heading h1,
.page-heading h2 {
    margin: 0;
    font-size: 2.4rem;
}

.page-heading .sub {
    display: block;
    margin-top: 0.5em;
    font-family: var(--body-font);
    font-size: 1rem;
    font-weight: 400;
    color: var(--muted);
    letter-spacing: 0;
}

/* ==================================================================
   5. Карточки записей
   ================================================================== */

.card-list {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
    margin-bottom: 2.6rem;
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border-radius: 6px;
    border-left: 2px solid var(--accent-2);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-top: 12px solid var(--accent);
    border-right: 12px solid transparent;
    pointer-events: none;
    z-index: 2;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

.card-row {
    display: flex;
    flex: 1;
    gap: 1.4rem;
}

.card-thumb-wrap {
    flex: 0 0 32%;
    position: relative;
    overflow: hidden;
    min-height: 190px;
}

.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-body {
    flex: 1;
    min-width: 0;
    padding: 1.5rem 1.7rem 1.5rem 0;
    display: flex;
    flex-direction: column;
}

.card.no-thumb .card-body {
    padding-left: 1.7rem;
}

.card-title {
    font-size: 1.28rem;
    margin: 0.5rem 0 0.5rem;
}

.card-title a {
    color: var(--ink);
    text-decoration: none;
}

.card-title a:hover {
    color: var(--accent);
}

.card-meta {
    font-family: var(--head-font);
    font-size: 0.74rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.6rem;
}

.card-excerpt {
    color: #3D3550;
    font-size: 0.97rem;
    line-height: 1.7;
}

.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}

.card-more {
    margin-top: auto;
    padding-top: 1rem;
    font-family: var(--head-font);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    text-decoration: none;
    align-self: flex-start;
    border-bottom: 1px dashed var(--accent-2);
    padding-bottom: 3px;
}

.card-more:hover {
    border-bottom-style: solid;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    border: 1px solid var(--accent);
    border-radius: 3px;
    padding: 0.1rem 0.6rem;
    font-family: var(--head-font);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    text-decoration: none;
    background: none;
}

.cat-chip::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    background: radial-gradient(circle, var(--accent) 0 2px, rgba(0, 0, 0, 0) 2px);
}

.cat-chip:hover {
    background: rgba(184, 161, 212, 0.2);
}

/* ==================================================================
   6. Пагинация
   ================================================================== */

.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 2.4rem 0 0;
}

.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 0.75rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--head-font);
    font-size: 0.84rem;
    letter-spacing: 0.06em;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.pager .page-numbers:hover {
    background: rgba(184, 161, 212, 0.25);
    color: var(--accent-deep);
    transform: translateY(2px);
}

.pager .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.pager .page-numbers.dots {
    border: none;
    background: none;
    min-width: 24px;
}

/* ==================================================================
   7. Контент записи и страницы
   ================================================================== */

.entry {
    background: var(--paper);
    border-radius: 6px;
    border-left: 2px solid var(--accent-2);
    box-shadow: var(--shadow-card);
    padding: 2.2rem 2.4rem;
}

.entry-meta {
    font-family: var(--head-font);
    font-size: 0.76rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1.2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.entry-thumb {
    margin: 0 0 1.8rem;
    border-radius: 4px;
    overflow: hidden;
}

.entry-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

.entry-content {
    font-size: 1.04rem;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    margin-top: 1.9em;
}

.entry-content p + p {
    border-top: 1px dashed var(--line);
    padding-top: 1.15em;
    margin-top: 1.15em;
}

.entry-content ul,
.entry-content ol {
    padding-left: 1.3rem;
    margin: 0 0 1.3em;
}

.entry-content li {
    margin-bottom: 0.5em;
}

.entry-content blockquote {
    margin: 1.8em 0;
    padding: 1.5rem 1.8rem;
    background: rgba(184, 161, 212, 0.2);
    border-left: 3px solid var(--accent);
    border-radius: 4px;
    font-size: 1.1rem;
}

.entry-content blockquote p:last-child {
    margin-bottom: 0;
}

.entry-content blockquote p + p {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.entry-content img {
    border-radius: 4px;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.6em 0;
    border: 1px solid var(--line);
    font-size: 0.95rem;
}

.entry-content th,
.entry-content td {
    border: 1px solid var(--line);
    padding: 0.7rem 0.9rem;
    text-align: left;
}

.entry-content th {
    background: var(--bg-alt);
    font-family: var(--head-font);
    font-size: 0.86rem;
    letter-spacing: 0.05em;
}

.entry-footer .chips a {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--accent-2);
    border-radius: 3px;
    padding: 0.1rem 0.6rem;
    font-family: var(--head-font);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    text-decoration: none;
    margin: 0 0.4rem 0.4rem 0;
}

.entry-footer .chips a:hover {
    background: rgba(184, 161, 212, 0.2);
}

.entry-footer {
    margin-top: 2rem;
    padding-top: 1.4rem;
    border-top: 1px dashed var(--line);
}

.post-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.8rem;
    font-family: var(--head-font);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
}

.post-nav a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent-2);
}

.post-nav a:hover {
    border-bottom-style: solid;
}

/* ==================================================================
   8. Сайдбар и виджеты
   ================================================================== */

.sidebar {
    min-width: 0;
}

.sidebar .widget {
    background: var(--side);
    border-radius: 6px;
    border-left: 2px solid var(--accent-2);
    box-shadow: var(--shadow-card);
    padding: 1.5rem 1.6rem;
    margin-bottom: 1.6rem;
    color: var(--ink);
}

.sidebar .widget-title {
    position: relative;
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 1rem;
    padding-left: 0.85rem;
    color: var(--ink);
}

.sidebar .widget-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.16em;
    width: 2px;
    height: 1.4em;
    background: var(--accent);
}

.sidebar .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar .widget li {
    padding: 0.55rem 0;
    border-bottom: 1px dashed var(--line);
    font-size: 0.95rem;
    color: var(--ink);
}

.sidebar .widget li:last-child {
    border-bottom: none;
}

.sidebar .widget a {
    color: var(--accent);
    text-decoration: none;
}

.sidebar .widget a:hover {
    color: var(--accent-deep);
    text-decoration: underline;
    text-decoration-style: dashed;
}

.sidebar .widget .post-date {
    display: block;
    font-family: var(--head-font);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-top: 0.2rem;
}

.sidebar .textwidget {
    font-size: 0.95rem;
    color: #3D3550;
}

/* ==================================================================
   9. Подвал
   ================================================================== */

.site-footer {
    background: var(--dark);
    color: #DAD2E6;
    padding: 3rem 0 1.6rem;
    margin-top: 3rem;
}

.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.4rem;
}

.site-footer .widget {
    color: #DAD2E6;
    font-size: 0.94rem;
}

.site-footer .widget-title {
    position: relative;
    color: #FFFFFF;
    font-size: 1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 0 0 1rem;
    padding-left: 0.85rem;
}

.site-footer .widget-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.16em;
    width: 2px;
    height: 1.4em;
    background: var(--accent-2);
}

.site-footer .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer .widget li {
    padding: 0.42rem 0;
    border-bottom: 1px dashed rgba(184, 161, 212, 0.22);
}

.site-footer .widget li:last-child {
    border-bottom: none;
}

.site-footer .widget a,
.site-footer .widget .textwidget a {
    color: var(--accent-2);
    text-decoration: none;
}

.site-footer .widget a:hover {
    color: #FFFFFF;
}

.site-footer .textwidget {
    color: #C6BCD6;
}

.site-copy {
    margin-top: 2.6rem;
    padding-top: 1.3rem;
    border-top: 1px solid rgba(184, 161, 212, 0.2);
    font-family: var(--head-font);
    font-size: 0.76rem;
    letter-spacing: 0.06em;
    color: #A79BBB;
    line-height: 1.6;
}

/* ==================================================================
   10. Главная страница
   ================================================================== */

.front-section {
    position: relative;
    padding: 60px 1.4rem;
}

.front-section.alt {
    background: var(--bg-alt);
}

/* асимметричная точка «энсо» */
.front-section::after {
    content: "";
    position: absolute;
    right: 4%;
    bottom: 26px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.15;
    pointer-events: none;
}

.section-head {
    position: relative;
    margin: 0 0 2rem;
    padding-left: 1.1rem;
    margin-left: -1.1rem;
}

.section-head::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.26em;
    width: 2px;
    height: 1.5em;
    background: var(--accent);
}

.section-head::after {
    content: "";
    position: absolute;
    left: 0;
    top: -14px;
    width: 0;
    height: 0;
    border-top: 11px solid var(--accent);
    border-right: 11px solid transparent;
}

.section-head h2 {
    margin: 0;
}

.section-head .sub {
    display: block;
    margin-top: 0.5em;
    font-family: var(--body-font);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0;
    color: var(--muted);
}

/* --- Блок 1: hero --- */

.hero {
    padding-top: 78px;
    padding-bottom: 40px;
    text-align: center;
    overflow: hidden;
}

.hero::after {
    display: none;
}

.hero-inner {
    position: relative;
    width: 88%;
    margin-left: auto;
    margin-right: auto;
}

.hero-eyebrow {
    font-family: var(--head-font);
    font-size: 0.78rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.6rem;
}

.hero h1 {
    margin-bottom: 0.5em;
}

.hero-sub {
    font-size: 1.12rem;
    color: var(--muted);
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2.2rem;
}

.hero-rule {
    width: min(92%, 1180px);
    height: 1px;
    background: var(--line);
    margin: 74px auto 0;
}

/* --- Блок 2: таймлайн --- */

.timeline {
    position: relative;
    margin: 2.4rem auto 0;
    padding: 0.6rem 0;
    width: min(100%, 920px);
}

.timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    margin-left: -1px;
    background: var(--accent);
}

.tl-item {
    position: relative;
    width: 50%;
    padding: 0 2.4rem 2.4rem 0;
    min-width: 0;
}

.tl-item:nth-child(even) {
    margin-left: 50%;
    padding: 0 0 2.4rem 2.4rem;
    text-align: left;
}

.tl-item:nth-child(odd) {
    text-align: right;
}

.tl-item::before {
    content: "";
    position: absolute;
    top: 0.55rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
}

.tl-item:nth-child(odd)::before {
    right: -7px;
}

.tl-item:nth-child(even)::before {
    left: -7px;
}

.tl-era {
    font-family: var(--head-font);
    font-size: 0.74rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    display: block;
    margin-bottom: 0.35rem;
}

.tl-title {
    font-size: 1.22rem;
    margin: 0 0 0.4rem;
}

.tl-text {
    font-size: 0.95rem;
    color: var(--muted);
    margin: 0;
}

/* --- Блок 3: статистика --- */

.stats-shift {
    width: 88%;
    margin-left: auto;
    margin-right: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2rem;
    background: rgba(184, 161, 212, 0.2);
    border-radius: 6px;
    padding: 2.4rem 2.2rem;
}

.stat-item {
    min-width: 0;
    text-align: left;
}

.stat-num {
    font-family: var(--head-font);
    font-size: 3.2rem;
    line-height: 1.05;
    letter-spacing: 0.02em;
    color: var(--ink);
    display: block;
}

.stat-label {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.5;
}

/* --- Блок 4: рубрикатор --- */

.topic-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.4rem;
}

.topic-tile {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: var(--bg-alt);
    border-left: 2px solid var(--accent);
    border-radius: 6px;
    padding: 1.5rem 1.6rem;
    text-decoration: none;
    color: var(--ink);
    min-width: 0;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.front-section.alt .topic-tile {
    background: var(--bg);
}

.topic-tile:hover {
    transform: translateY(-2px);
    border-left-color: var(--accent-2);
    background: var(--paper);
}

.topic-tile svg {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 1.4;
}

.topic-name {
    font-family: var(--head-font);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.3rem;
}

.topic-note {
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.55;
    display: block;
}

/* --- Последние записи на главной --- */

.latest-grid {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}

.front-more {
    margin-top: 2.2rem;
}

/* ==================================================================
   11. Комментарии, формы, 404
   ================================================================== */

.comments-area {
    margin-top: 2.4rem;
    background: var(--paper);
    border-radius: 6px;
    border-left: 2px solid var(--accent-2);
    box-shadow: var(--shadow-card);
    padding: 2rem 2.2rem;
}

.comments-area .comments-title,
.comments-area .comment-reply-title {
    font-size: 1.35rem;
    letter-spacing: 0.06em;
}

.comment-list {
    list-style: none;
    margin: 0 0 2rem;
    padding: 0;
}

.comment-list .children {
    list-style: none;
    margin: 0 0 0 1.6rem;
    padding: 0;
}

.comment-item {
    border-bottom: 1px dashed var(--line);
    padding: 1.1rem 0;
}

.comment-head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-family: var(--head-font);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.comment-date {
    font-family: var(--head-font);
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.comment-actions {
    font-family: var(--head-font);
    font-size: 0.76rem;
    letter-spacing: 0.08em;
}

.comment-actions a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent-2);
}

.comment-form label {
    display: block;
    font-family: var(--head-font);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea,
.search-form input[type="search"] {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    font-family: var(--body-font);
    font-size: 0.97rem;
    color: var(--ink);
}

.comment-form textarea {
    min-height: 150px;
}

.comment-form .submit,
.search-form button {
    display: inline-block;
    font-family: var(--head-font);
    font-size: 0.82rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.8rem 1.6rem;
    border-radius: 4px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    box-shadow: 0 3px 0 rgba(26, 22, 37, 0.14);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.comment-form .submit:hover,
.search-form button:hover {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(26, 22, 37, 0.3);
}

.search-form {
    display: flex;
    gap: 0.6rem;
    align-items: stretch;
    flex-wrap: wrap;
}

.search-form .search-field-wrap {
    flex: 1;
    min-width: 200px;
}

.sidebar .search-form {
    flex-direction: column;
}

.error-box {
    background: var(--paper);
    border-left: 2px solid var(--accent-2);
    border-radius: 6px;
    box-shadow: var(--shadow-card);
    padding: 2.2rem 2.4rem;
}

.error-code {
    font-family: var(--head-font);
    font-size: 4.2rem;
    line-height: 1;
    color: var(--accent);
    margin-bottom: 0.4rem;
}

.error-actions {
    margin-top: 1.8rem;
}

.nothing-found {
    background: var(--paper);
    border-left: 2px solid var(--accent-2);
    border-radius: 6px;
    box-shadow: var(--shadow-card);
    padding: 1.8rem 2rem;
}

/* ==================================================================
   12. Cookie-баннер
   ================================================================== */

.cookie-banner[hidden] {
    display: none !important;
}

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: var(--dark);
    color: #DAD2E6;
    border-top: 2px solid var(--accent);
    padding: 1.1rem 1.4rem;
}

.cookie-inner {
    width: min(92%, 1180px);
    margin-inline: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
}

.cookie-text {
    margin: 0;
    font-size: 0.9rem;
    min-width: 0;
    flex: 1;
}

.cookie-text a {
    color: var(--accent-2);
}

/* ==================================================================
   13. Адаптив
   ================================================================== */

@media (max-width: 960px) {
    h1 {
        font-size: 2.5rem;
    }

    .nav-toggle {
        display: inline-block;
    }

    .header-inner {
        align-items: center;
    }

    .main-nav {
        width: 100%;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0.9rem;
        padding-top: 0.8rem;
        border-top: 1px dashed rgba(184, 161, 212, 0.3);
    }

    .layout-with-sidebar {
        grid-template-columns: minmax(0, 1fr);
        gap: 2.4rem;
    }

    .layout-single {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-shift {
        width: 100%;
    }

    .topic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-cols {
        grid-template-columns: minmax(0, 1fr);
        gap: 2rem;
    }

    .hero-inner {
        width: 100%;
    }
}

@media (max-width: 600px) {
    body {
        font-size: 16px;
    }

    h1 {
        font-size: 2.05rem;
    }

    h2 {
        font-size: 1.55rem;
    }

    .site-main {
        padding: 1.8rem 0 2.6rem;
    }

    .front-section {
        padding: 40px 1.1rem;
    }

    .hero {
        padding-top: 48px;
    }

    .hero-rule {
        margin-top: 46px;
    }

    .card-row {
        flex-direction: column;
        gap: 0;
    }

    .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,
    .card.no-thumb .card-body {
        padding: 1.3rem 1.3rem;
    }

    .entry,
    .comments-area,
    .error-box {
        padding: 1.5rem 1.3rem;
    }

    .stats-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.4rem;
        padding: 1.8rem 1.4rem;
    }

    .stat-num {
        font-size: 2.6rem;
    }

    .topic-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .topic-tile {
        padding: 1.3rem 1.3rem;
    }

    .timeline::before {
        left: 5px;
    }

    .tl-item,
    .tl-item:nth-child(even),
    .tl-item:nth-child(odd) {
        width: 100%;
        margin-left: 0;
        padding: 0 0 2rem 1.8rem;
        text-align: left;
    }

    .tl-item:nth-child(odd)::before,
    .tl-item:nth-child(even)::before {
        left: 0;
        right: auto;
    }

    .entry-content blockquote {
        padding: 1.2rem 1.2rem;
    }

    .front-section::after {
        width: 40px;
        height: 40px;
        right: 6%;
    }

    .sidebar .widget {
        padding: 1.3rem 1.3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        transition: none !important;
    }
}
