/*
Theme Name: dds_dearmemories.ru
Theme URI: https://dearmemories.ru/
Author: Елена Белова
Description: Редакционная тема для информационно-практического ресурса о семейной памяти, генеалогии и архивном деле. Аметистовая палитра, золотые акценты, журнальная типографика.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dearmem
*/

/* ---------- Элементы, скрываемые атрибутом hidden ---------- */
.dm-cookie[hidden] { display: none !important; }

/* ---------- Токены ---------- */
:root {
    --dm-bg: #F8F6FB;
    --dm-bg-alt: #EFEAF6;
    --dm-plum: #2E1A47;
    --dm-plum-deep: #241338;
    --dm-side: #F2EEF8;
    --dm-text: #2A1F33;
    --dm-accent: #7B4FA6;
    --dm-accent-dark: #5E3A82;
    --dm-gold: #C9A227;
    --dm-muted: #8A7F96;
    --dm-line: #E0D6EC;
    --dm-rule: #D8CCE8;
    --dm-lav: #C9B8E0;
    --dm-serif: "Lora", "Georgia", "Times New Roman", serif;
    --dm-sans: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
    margin: 0;
    overflow-x: hidden;
    font-family: var(--dm-sans);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--dm-text);
    background-color: var(--dm-bg);
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 440'%3E%3Cg opacity='.04' fill='%237B4FA6' stroke='%237B4FA6' stroke-linecap='round'%3E%3Cpath fill='none' stroke-width='22' d='M196 440C200 380 196 330 200 282'/%3E%3Cpath fill='none' stroke-width='9' d='M200 290C170 250 130 225 90 205M200 290C230 250 270 225 310 205M200 282V140M90 205C72 175 62 145 60 112M90 205C108 170 128 145 140 112M310 205C292 170 272 145 260 112M310 205C328 175 338 145 340 112M200 140C184 112 172 86 160 60M200 140C216 112 228 86 240 60'/%3E%3Ccircle cx='60' cy='104' r='22'/%3E%3Ccircle cx='140' cy='104' r='22'/%3E%3Ccircle cx='260' cy='104' r='22'/%3E%3Ccircle cx='340' cy='104' r='22'/%3E%3Ccircle cx='160' cy='52' r='22'/%3E%3Ccircle cx='240' cy='52' r='22'/%3E%3Ccircle cx='90' cy='205' r='16'/%3E%3Ccircle cx='310' cy='205' r='16'/%3E%3Ccircle cx='200' cy='140' r='18'/%3E%3C/g%3E%3C/svg%3E"),
        repeating-linear-gradient(45deg, rgba(237, 231, 244, 0.4) 0 1px, transparent 1px 22px),
        repeating-linear-gradient(-45deg, rgba(237, 231, 244, 0.4) 0 1px, transparent 1px 22px);
    background-repeat: no-repeat, repeat, repeat;
    background-position: right -140px bottom -90px, 0 0, 0 0;
    background-size: 640px auto, auto, auto;
    background-attachment: fixed, scroll, scroll;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--dm-serif);
    color: var(--dm-plum);
    font-weight: 600;
    line-height: 1.22;
    margin: 0 0 0.6em;
    overflow-wrap: break-word;
    hyphens: auto;
}

h1 { font-size: clamp(2.1rem, 4.2vw + 0.6rem, 3.25rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 2.2vw + 0.8rem, 2.25rem); }
h3 { font-size: 1.32rem; }
h4 { font-size: 1.12rem; }

h1::before,
h2::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-right: 0.5em;
    vertical-align: 0.28em;
    background: var(--dm-gold);
    transform: rotate(45deg);
}

.dm-card__title::before { content: none; }

p { margin: 0 0 1.1em; }

p, li, dd, blockquote, figcaption, td, th {
    overflow-wrap: break-word;
    hyphens: auto;
}

a {
    color: var(--dm-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover { color: var(--dm-accent-dark); }

:focus-visible {
    outline: 2px solid var(--dm-gold);
    outline-offset: 3px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--dm-rule);
    margin: 0 0 1.5em;
}

th, td {
    border: 1px solid var(--dm-rule);
    padding: 0.65rem 0.85rem;
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--dm-bg-alt);
    font-weight: 600;
    color: var(--dm-plum);
}

.dm-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.dm-skip {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 1000;
    padding: 0.6rem 1rem;
    background: var(--dm-gold);
    color: var(--dm-text);
    border-radius: 4px;
    font-weight: 600;
}

.dm-skip:focus { top: 1rem; color: var(--dm-text); }

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

/* ---------- Корешок: полоса сверху и в подвале ---------- */
.dm-spine {
    display: flex;
    height: 4px;
}

.dm-spine span { flex: 1 1 0; }
.dm-spine span:nth-child(1) { background: var(--dm-accent); }
.dm-spine span:nth-child(2) { background: var(--dm-gold); }
.dm-spine span:nth-child(3) { background: var(--dm-plum); }
.dm-spine--rev span:nth-child(1) { background: #4A2D6B; }
.dm-spine--rev span:nth-child(3) { background: var(--dm-accent); }

/* ---------- Кнопки ---------- */
.dm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.78rem 1.45rem;
    border: 1.5px solid var(--dm-accent);
    border-radius: 4px;
    background: var(--dm-accent);
    color: #fff;
    font-family: var(--dm-sans);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.dm-btn:hover,
.dm-btn:focus-visible {
    background: var(--dm-accent-dark);
    border-color: var(--dm-accent-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(123, 79, 166, 0.3);
}

.dm-btn--ghost {
    background: transparent;
    color: var(--dm-accent);
}

.dm-btn--ghost:hover,
.dm-btn--ghost:focus-visible {
    background: #F0E9F8;
    border-color: var(--dm-accent);
    color: var(--dm-accent-dark);
    box-shadow: inset 0 0 0 1px var(--dm-accent);
    transform: none;
}

.dm-btn--gold {
    background: var(--dm-gold);
    border-color: var(--dm-gold);
    color: var(--dm-text);
}

.dm-btn--gold:hover,
.dm-btn--gold:focus-visible {
    background: #B8921C;
    border-color: #B8921C;
    color: var(--dm-text);
    box-shadow: 0 4px 12px rgba(201, 162, 39, 0.35);
}

.dm-btn--light {
    background: transparent;
    border-color: var(--dm-lav);
    color: #fff;
}

.dm-btn--light:hover,
.dm-btn--light:focus-visible {
    background: rgba(240, 233, 248, 0.12);
    border-color: #fff;
    color: #fff;
    box-shadow: inset 0 0 0 1px #fff;
    transform: none;
}

/* ---------- Текстовые ссылки: золотое подчёркивание снизу вверх ---------- */
.dm-link,
.dm-prose a,
.dm-entry__tags a,
.dm-crumbs a {
    background-image: linear-gradient(var(--dm-gold), var(--dm-gold));
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 100% 0;
    padding-bottom: 1px;
    transition: background-size 0.25s ease, color 0.2s ease;
}

.dm-link:hover,
.dm-prose a:hover,
.dm-entry__tags a:hover,
.dm-crumbs a:hover,
.dm-link:focus-visible,
.dm-prose a:focus-visible {
    background-size: 100% 2px;
}

/* ---------- Шапка ---------- */
.dm-header {
    background: var(--dm-plum);
    color: #fff;
}

.dm-header__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.4rem 0;
}

.dm-brand {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    min-width: 0;
    flex: 1 1 auto;
}

.dm-brand__mark {
    flex: 0 0 auto;
    display: block;
    line-height: 0;
}

.dm-brand__logo {
    display: block;
    max-height: 64px;
    width: auto;
}

.dm-brand__svg { display: block; width: 58px; height: 58px; }

.dm-brand__text {
    min-width: 0;
    max-width: 860px;
}

.dm-brand__name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: var(--dm-serif);
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1.35;
    color: #fff;
    overflow-wrap: break-word;
}

.dm-brand__name:hover { color: #F0E9F8; }

.dm-brand__desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--dm-lav);
}

.dm-navtoggle {
    display: none;
    align-items: center;
    gap: 0.55rem;
    flex: 0 0 auto;
    padding: 0.55rem 0.9rem;
    border: 1.5px solid var(--dm-lav);
    border-radius: 4px;
    background: transparent;
    color: #fff;
    font: 600 0.9rem var(--dm-sans);
    cursor: pointer;
}

.dm-navtoggle__bars {
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
}

.dm-navtoggle__bars span {
    display: block;
    width: 16px;
    height: 2px;
    background: var(--dm-gold);
}

.dm-nav {
    border-top: 1px solid rgba(201, 184, 224, 0.18);
}

.dm-nav__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 2.2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dm-nav__list a {
    display: inline-block;
    padding: 0.85rem 0 0.75rem;
    border-bottom: 2px solid transparent;
    color: #E6DCF2;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.dm-nav__list a:hover,
.dm-nav__list a:focus-visible {
    color: #fff;
    border-bottom-color: var(--dm-gold);
}

.dm-nav__list .current-menu-item > a,
.dm-nav__list .current_page_item > a {
    color: var(--dm-gold);
    border-bottom-color: var(--dm-gold);
}

/* ---------- Хлебные крошки ---------- */
.dm-crumbs {
    padding: 1.6rem 0 0;
    font-size: 0.88rem;
    color: var(--dm-muted);
}

.dm-crumbs__sep {
    margin: 0 0.35rem;
    color: var(--dm-gold);
}

.dm-crumbs span:last-child { color: var(--dm-text); }

/* ---------- Раскладки ---------- */
.dm-layout {
    padding: 2rem 0 5rem;
}

.dm-layout--side {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.dm-layout--side .dm-content {
    flex: 0 0 67%;
    min-width: 0;
}

.dm-layout--side .dm-sidebar {
    flex: 0 0 27%;
    min-width: 0;
}

.dm-layout--single { display: block; }

.dm-layout--single .dm-content { min-width: 0; }

/* ---------- Заголовки секций ---------- */
.dm-head {
    margin-bottom: 2.6rem;
    max-width: 760px;
}

.dm-head h2 { margin-bottom: 0.45em; }

.dm-head__rule {
    position: relative;
    display: block;
    width: 8.5rem;
    height: 2px;
    margin-bottom: 1.2rem;
    background: var(--dm-gold);
}

.dm-head__rule::after {
    content: "";
    position: absolute;
    right: -4px;
    top: -3px;
    width: 8px;
    height: 8px;
    background: var(--dm-gold);
    transform: rotate(45deg);
}

.dm-head__lead {
    margin: 0;
    font-size: 1.06rem;
    color: #5D5168;
}

.dm-head--row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    max-width: none;
}

.dm-head--row h2 { margin-bottom: 0; }

/* ---------- Разделители ---------- */
.dm-divider {
    position: relative;
    width: 30%;
    height: 1px;
    margin: 0 0 3.5rem;
    background: var(--dm-rule);
}

.dm-divider::after {
    content: "";
    position: absolute;
    left: 50%;
    top: -3px;
    width: 7px;
    height: 7px;
    margin-left: -3.5px;
    background: var(--dm-gold);
    transform: rotate(45deg);
}

.dm-dots {
    height: 2px;
    background-image: repeating-linear-gradient(90deg, var(--dm-gold) 0 12px, transparent 12px 19px, var(--dm-gold) 19px 21px, transparent 21px 28px);
    opacity: 0.9;
}

/* ---------- Секции главной ---------- */
.dm-section {
    padding: 5.5rem 0;
}

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

.dm-section--accent {
    background-color: var(--dm-bg-alt);
    background-image:
        repeating-linear-gradient(45deg, rgba(237, 231, 244, 0.6) 0 1px, transparent 1px 22px),
        repeating-linear-gradient(-45deg, rgba(237, 231, 244, 0.6) 0 1px, transparent 1px 22px),
        linear-gradient(180deg, #EFEAF6 0%, #E4DBF0 100%);
}

/* Hero */
.dm-hero {
    position: relative;
    overflow: hidden;
    padding: 5.5rem 0 6rem;
    color: #fff;
    background-color: var(--dm-plum);
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 440'%3E%3Cg opacity='.09' fill='%23C9B8E0' stroke='%23C9B8E0' stroke-linecap='round'%3E%3Cpath fill='none' stroke-width='22' d='M196 440C200 380 196 330 200 282'/%3E%3Cpath fill='none' stroke-width='9' d='M200 290C170 250 130 225 90 205M200 290C230 250 270 225 310 205M200 282V140M90 205C72 175 62 145 60 112M90 205C108 170 128 145 140 112M310 205C292 170 272 145 260 112M310 205C328 175 338 145 340 112M200 140C184 112 172 86 160 60M200 140C216 112 228 86 240 60'/%3E%3Ccircle cx='60' cy='104' r='22'/%3E%3Ccircle cx='140' cy='104' r='22'/%3E%3Ccircle cx='260' cy='104' r='22'/%3E%3Ccircle cx='340' cy='104' r='22'/%3E%3Ccircle cx='160' cy='52' r='22'/%3E%3Ccircle cx='240' cy='52' r='22'/%3E%3Ccircle cx='90' cy='205' r='16'/%3E%3Ccircle cx='310' cy='205' r='16'/%3E%3Ccircle cx='200' cy='140' r='18'/%3E%3C/g%3E%3C/svg%3E"),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 22px),
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 22px);
    background-repeat: no-repeat, repeat, repeat;
    background-position: left -120px bottom -160px, 0 0, 0 0;
    background-size: 520px auto, auto, auto;
}

.dm-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    align-items: center;
    gap: 3.5rem;
}

.dm-hero__text { min-width: 0; }

.dm-hero__title {
    color: #fff;
    margin-bottom: 0.55em;
    max-width: 18ch;
}

.dm-hero__lead {
    max-width: 58ch;
    margin-bottom: 2.1rem;
    font-size: 1.12rem;
    line-height: 1.7;
    color: var(--dm-lav);
}

.dm-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
}

.dm-hero__art {
    min-width: 0;
    justify-self: center;
}

.dm-hero__art img {
    display: block;
    width: 100%;
    max-width: 460px;
}

/* Таймлайн */
.dm-timeline {
    position: relative;
    margin: 0;
    padding: 0.5rem 0 0;
    list-style: none;
}

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

.dm-timeline__item {
    position: relative;
    width: 50%;
    min-width: 0;
    padding: 0 3.2rem 3rem 0;
    text-align: right;
}

.dm-timeline__item:nth-child(even) {
    margin-left: 50%;
    padding: 0 0 3rem 3.2rem;
    text-align: left;
}

.dm-timeline__item:last-child { padding-bottom: 0.5rem; }

.dm-timeline__item::before {
    content: "";
    position: absolute;
    top: 0.85rem;
    right: -7px;
    width: 14px;
    height: 14px;
    border: 3px solid var(--dm-bg-alt);
    border-radius: 50%;
    background: var(--dm-gold);
    box-shadow: 0 0 0 1px var(--dm-gold);
}

.dm-timeline__item:nth-child(even)::before {
    right: auto;
    left: -7px;
}

.dm-timeline__num {
    display: inline-block;
    min-width: 2.6rem;
    margin-bottom: 0.7rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--dm-gold);
    font-family: var(--dm-serif);
    font-size: 1.9rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--dm-gold);
    text-align: left;
}

.dm-timeline__title {
    font-size: 1.4rem;
    margin-bottom: 0.45em;
}

.dm-timeline__item p {
    margin: 0;
    max-width: 46ch;
    color: #4A3E55;
}

.dm-timeline__item:nth-child(odd) p { margin-left: auto; }

/* Последние записи */
.dm-latest { padding-top: 4.5rem; }

/* Цитата */
.dm-quote-band {
    padding: 4.5rem 0;
    background: var(--dm-plum);
    color: #fff;
}

.dm-quote {
    position: relative;
    max-width: 920px;
    margin: 3.2rem auto;
    padding: 1.2rem 3.5rem 1.2rem 2.6rem;
    border-left: 6px solid var(--dm-gold);
    text-align: center;
}

.dm-quote::after {
    content: "";
    position: absolute;
    right: 0.9rem;
    top: 50%;
    width: 12px;
    height: 12px;
    margin-top: -6px;
    background: var(--dm-lav);
    transform: rotate(45deg);
}

.dm-quote__text {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
}

.dm-quote__text p {
    margin: 0;
    font-family: var(--dm-serif);
    font-size: clamp(1.6rem, 2.4vw + 0.8rem, 2.5rem);
    font-weight: 500;
    line-height: 1.32;
    color: #fff;
}

.dm-quote__cite {
    margin-top: 1.4rem;
    font-size: 0.98rem;
    color: var(--dm-lav);
}

/* ---------- Сетки и карточки ---------- */
.dm-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.9rem;
}

.dm-grid--three,
.dm-layout--single .dm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.dm-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: var(--dm-bg);
    border: 1px solid var(--dm-line);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(46, 26, 71, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.dm-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(46, 26, 71, 0.1);
    border-color: var(--dm-accent);
}

.dm-card__thumb {
    position: relative;
    border-left: 2px solid var(--dm-gold);
    background: #E9E1F3;
}

.dm-card__thumb a { display: block; }

.dm-card__thumb img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.dm-card__thumb .dm-card__plate {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 10;
    background:
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.35) 0 1px, transparent 1px 16px),
        linear-gradient(160deg, #EFEAF6, #E1D6EF);
}

.dm-card__plate svg { display: block; width: 42%; height: auto; }

.dm-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 1.35rem 1.4rem 1.5rem;
}

.dm-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.9rem;
    margin-bottom: 0.65rem;
    font-size: 0.82rem;
    color: var(--dm-muted);
}

.dm-card__cat { color: var(--dm-accent); font-weight: 500; }

.dm-card__pin {
    padding: 0.1rem 0.5rem;
    border: 1px solid var(--dm-gold);
    border-radius: 3px;
    color: #8A6D12;
    font-size: 0.75rem;
}

.dm-card__title {
    font-size: 1.24rem;
    line-height: 1.3;
    margin-bottom: 0.55rem;
}

.dm-card__title a { color: var(--dm-plum); }
.dm-card__title a:hover { color: var(--dm-accent); }

.dm-card__excerpt,
.dm-card__text {
    flex: 1;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.62;
    color: #4A3E55;
}

.dm-card__excerpt p {
    margin: 0 0 0.5em;
    background: none;
}

.dm-card__more {
    align-self: flex-start;
    font-weight: 600;
    font-size: 0.92rem;
}

.dm-empty {
    padding: 2rem 2.2rem;
    border: 1px dashed var(--dm-rule);
    border-radius: 6px;
    background: var(--dm-side);
    color: #4A3E55;
}

.dm-empty p:last-child { margin-bottom: 0; }
.dm-empty .dm-search { margin-top: 1.2rem; }

/* ---------- Внутренние страницы ---------- */
.dm-page-head { margin-bottom: 2.2rem; }

.dm-page-head .dm-divider { margin: 1.6rem 0 0; }

.dm-page-title { margin-bottom: 0.4em; }

.dm-page-lead {
    max-width: 62ch;
    font-size: 1.08rem;
    color: #5D5168;
    margin: 0;
}

.dm-entry__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.2rem;
    font-size: 0.9rem;
    color: var(--dm-muted);
}

.dm-entry__cats { display: inline-flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; }

.dm-entry__cover {
    margin: 0 0 2.2rem;
    border-left: 2px solid var(--dm-gold);
    border-radius: 6px;
    overflow: hidden;
}

.dm-entry__cover img { display: block; width: 100%; height: auto; }

.dm-prose {
    font-size: 1.06rem;
    line-height: 1.78;
}

.dm-prose > *:first-child { margin-top: 0; }

.dm-prose p { margin: 0 0 1.25em; }

.dm-prose h2 {
    margin: 2.2em 0 0.8em;
    padding-left: 0.85rem;
    border-left: 3px solid var(--dm-accent);
    font-size: 1.75rem;
}

.dm-prose h3 { margin: 1.9em 0 0.7em; }

.dm-prose ul,
.dm-prose ol {
    margin: 0 0 1.4em;
    padding-left: 1.4em;
}

.dm-prose li { margin-bottom: 0.45em; }
.dm-prose ul li::marker { color: var(--dm-gold); }
.dm-prose ol li::marker { color: var(--dm-accent); font-weight: 600; }

.dm-prose blockquote {
    position: relative;
    margin: 2em 0;
    padding: 1.4rem 2.4rem 1.4rem 1.8rem;
    border-left: 4px solid var(--dm-gold);
    border-radius: 0 6px 6px 0;
    background: var(--dm-side);
    font-family: var(--dm-serif);
    font-style: italic;
    font-size: 1.15rem;
    color: var(--dm-plum);
}

.dm-prose blockquote::after {
    content: "";
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--dm-lav);
}

.dm-prose blockquote p:last-child { margin-bottom: 0; }

.dm-prose table {
    display: block;
    overflow-x: auto;
}

.dm-prose pre {
    overflow-x: auto;
    padding: 1rem 1.2rem;
    border-radius: 6px;
    background: var(--dm-plum);
    color: #F0E9F8;
    font-size: 0.9rem;
}

.dm-prose figure { margin: 2em 0; }
.dm-prose figcaption { font-size: 0.88rem; color: var(--dm-muted); margin-top: 0.5rem; }
.dm-prose hr { border: 0; height: 1px; width: 30%; background: var(--dm-rule); margin: 2.5em 0; }

.dm-entry__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    margin: 2rem 0 0;
    font-size: 0.92rem;
}

.dm-postnav {
    display: flex;
    justify-content: space-between;
    gap: 1.2rem;
    margin: 2.8rem 0 0;
}

.dm-postnav__link {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1 1 0;
    min-width: 0;
    padding: 1.1rem 1.3rem;
    border: 1px solid var(--dm-line);
    border-radius: 6px;
    background: var(--dm-bg);
    transition: border-color 0.2s ease;
}

.dm-postnav__link:hover { border-color: var(--dm-accent); }
.dm-postnav__link--next { text-align: right; }
.dm-postnav__label { font-size: 0.82rem; color: var(--dm-muted); }
.dm-postnav__title { font-family: var(--dm-serif); color: var(--dm-plum); font-weight: 600; }

/* 404 */
.dm-notfound { max-width: 720px; }

.dm-notfound__code {
    display: block;
    font-family: var(--dm-serif);
    font-size: 5rem;
    line-height: 1;
    color: var(--dm-gold);
    margin-bottom: 0.6rem;
}

.dm-notfound .dm-search { margin: 2rem 0; }
.dm-notfound__back { margin: 0; }

/* ---------- Поиск ---------- */
.dm-search {
    display: flex;
    gap: 0.6rem;
    max-width: 560px;
}

.dm-search__field {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--dm-line);
    border-radius: 4px;
    background: #fff;
    font: 1rem var(--dm-sans);
    color: var(--dm-text);
}

.dm-search__field:focus {
    outline: none;
    border-color: var(--dm-accent);
    box-shadow: 0 0 0 3px rgba(123, 79, 166, 0.15);
}

/* ---------- Пагинация (type => plain) ---------- */
.dm-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin: 3rem 0 0;
}

.dm-pager .page-numbers,
.dm-pager .post-page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.6rem;
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--dm-line);
    border-radius: 4px;
    background: var(--dm-bg);
    color: var(--dm-text);
    font-size: 0.93rem;
    line-height: 1.3;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.dm-pager a.page-numbers:hover,
.dm-pager a.post-page-numbers:hover {
    border-color: var(--dm-accent);
    color: var(--dm-accent);
    background: #F0E9F8;
}

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

.dm-pager .page-numbers.dots {
    border-color: transparent;
    background: none;
    min-width: auto;
    padding-inline: 0.3rem;
}

/* ---------- Сайдбар ---------- */
.dm-sidebar .dm-widget {
    margin-bottom: 1.8rem;
    padding: 1.5rem 1.5rem 1.4rem;
    border: 1px solid var(--dm-line);
    border-radius: 6px;
    background: var(--dm-side);
    color: var(--dm-text);
}

.dm-sidebar .dm-widget__title {
    position: relative;
    margin-bottom: 1rem;
    padding-bottom: 0.7rem;
    font-size: 1.18rem;
    color: var(--dm-plum);
}

.dm-sidebar .dm-widget__title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 3rem;
    height: 2px;
    background: var(--dm-gold);
}

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

.dm-sidebar li {
    padding: 0.6rem 0;
    border-bottom: 1px dashed var(--dm-rule);
    line-height: 1.45;
}

.dm-sidebar li:last-child { border-bottom: 0; padding-bottom: 0; }
.dm-sidebar a { color: var(--dm-text); }
.dm-sidebar a:hover { color: var(--dm-accent); }
.dm-sidebar .post-date { display: block; font-size: 0.8rem; color: var(--dm-muted); }
.dm-sidebar p,
.dm-sidebar .textwidget { color: #4A3E55; }

/* ---------- Подвал ---------- */
.dm-footer {
    background: var(--dm-plum-deep);
    color: #D9CEE8;
}

.dm-footer__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3rem;
    padding: 4rem 0 3rem;
}

.dm-footer__col { min-width: 0; }

.dm-footer .dm-widget { margin-bottom: 1.5rem; color: #D9CEE8; }

.dm-footer .dm-widget__title {
    margin-bottom: 1rem;
    font-size: 1.15rem;
    color: #fff;
}

.dm-footer .dm-widget__title::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-right: 0.55em;
    vertical-align: 0.25em;
    background: var(--dm-gold);
    transform: rotate(45deg);
}

.dm-footer p,
.dm-footer .textwidget {
    font-size: 0.94rem;
    line-height: 1.7;
    color: #CFC3E0;
}

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

.dm-footer li { padding: 0.32rem 0; }

.dm-footer a { color: #EDE4F7; }

.dm-footer a:hover,
.dm-footer a:focus-visible { color: var(--dm-gold); }

.dm-footer .post-date { color: #A796BD; font-size: 0.8rem; }

.dm-footer__bottom {
    border-top: 1px solid rgba(201, 184, 224, 0.15);
}

.dm-footer__copy {
    margin: 0;
    padding: 1.3rem 0;
    font-size: 0.85rem;
    color: #A796BD;
}

/* ---------- Комментарии ---------- */
.dm-comments { margin-top: 3.5rem; }
.dm-comments .dm-divider { margin-bottom: 2.5rem; }
.dm-comments__title { font-size: 1.6rem; }

.dm-comments__list,
.dm-comments__list .children {
    margin: 0 0 2rem;
    padding: 0;
    list-style: none;
}

.dm-comments__list .children { margin: 1rem 0 0 2rem; }

.dm-comment { margin-bottom: 1rem; }

.dm-comment__box {
    padding: 1.2rem 1.4rem;
    border: 1px solid var(--dm-line);
    border-radius: 6px;
    background: var(--dm-bg);
}

.dm-comment__head {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.7rem;
}

.dm-comment__avatar { border-radius: 50%; display: block; }
.dm-comment__author { display: block; font-weight: 600; color: var(--dm-plum); }
.dm-comment__date { font-size: 0.8rem; color: var(--dm-muted); }
.dm-comment__moderation { font-size: 0.88rem; color: #8A6D12; }
.dm-comment__text p:last-child { margin-bottom: 0.4rem; }
.dm-comment__reply a { font-size: 0.88rem; font-weight: 600; }

.comment-respond {
    margin-top: 2rem;
    padding: 1.8rem 1.8rem 1.6rem;
    border: 1px solid var(--dm-line);
    border-radius: 6px;
    background: var(--dm-side);
}

.comment-reply-title { font-size: 1.45rem; }
.comment-reply-title small { display: block; margin-top: 0.4rem; font-size: 0.85rem; font-family: var(--dm-sans); }
.dm-form-note, .logged-in-as, .must-log-in { font-size: 0.88rem; color: var(--dm-muted); }

.comment-form label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dm-plum);
}

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

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--dm-accent);
    box-shadow: 0 0 0 3px rgba(123, 79, 166, 0.15);
}

.comment-form-cookies-consent { display: flex; align-items: flex-start; gap: 0.5rem; }
.comment-form-cookies-consent label { display: inline; font-weight: 400; color: var(--dm-text); }

/* ---------- Cookie-баннер ---------- */
.dm-cookie {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 999;
    display: flex;
    justify-content: center;
}

.dm-cookie__inner {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    max-width: 920px;
    padding: 1.1rem 1.5rem;
    border-top: 3px solid var(--dm-gold);
    border-radius: 6px;
    background: var(--dm-plum);
    color: #EDE4F7;
    box-shadow: 0 10px 30px rgba(36, 19, 56, 0.35);
}

.dm-cookie__text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
}

.dm-cookie .dm-btn { flex: 0 0 auto; }

/* ---------- Классы WordPress ---------- */
.alignleft { float: left; margin: 0.3em 1.5em 1em 0; }
.alignright { float: right; margin: 0.3em 0 1em 1.5em; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 0.88rem; color: var(--dm-muted); }
.bypostauthor > .dm-comment__box { border-color: var(--dm-lav); }

/* ---------- Адаптив ---------- */
@media (max-width: 960px) {
    .dm-navtoggle { display: inline-flex; }

    .dm-nav { display: none; }
    .dm-nav.is-open { display: block; }

    .dm-nav__list {
        flex-direction: column;
        gap: 0;
        padding: 0.4rem 0 0.9rem;
    }

    .dm-nav__list a { padding: 0.65rem 0; }

    .dm-layout--side { display: block; }
    .dm-layout--side .dm-sidebar { margin-top: 3rem; }

    .dm-hero__grid { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
    .dm-hero__title { max-width: none; }
    .dm-hero__art img { max-width: 340px; }

    .dm-grid--three,
    .dm-layout--single .dm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .dm-timeline::before { left: 7px; margin-left: 0; }

    .dm-timeline__item,
    .dm-timeline__item:nth-child(even) {
        width: 100%;
        margin-left: 0;
        padding: 0 0 2.6rem 2.6rem;
        text-align: left;
    }

    .dm-timeline__item::before,
    .dm-timeline__item:nth-child(even)::before { left: 0; right: auto; }

    .dm-timeline__item:nth-child(odd) p { margin-left: 0; }

    .dm-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.2rem; }

    body {
        background-attachment: scroll, scroll, scroll;
        background-size: 420px auto, auto, auto;
    }
}

@media (max-width: 600px) {
    .shell { width: 92%; }

    .dm-header__row { padding: 1rem 0; gap: 0.9rem; }
    .dm-brand { gap: 0.75rem; }
    .dm-brand__svg { width: 46px; height: 46px; }
    .dm-brand__name { font-size: 0.95rem; -webkit-line-clamp: 3; }
    .dm-brand__desc { display: none; }
    .dm-navtoggle__label { display: none; }

    .dm-section { padding: 3.8rem 0; }
    .dm-hero { padding: 3.8rem 0 4.2rem; }
    .dm-hero__actions .dm-btn { flex: 1 1 100%; }

    .dm-head--row { flex-direction: column; align-items: flex-start; }

    .dm-grid,
    .dm-grid--three,
    .dm-layout--single .dm-grid { grid-template-columns: minmax(0, 1fr); }

    .dm-quote-band { padding: 3rem 0; }
    .dm-quote { margin: 2.2rem auto; padding: 0.8rem 2rem 0.8rem 1.3rem; border-left-width: 4px; }
    .dm-quote::after { right: 0.4rem; width: 9px; height: 9px; margin-top: -4.5px; }

    .dm-divider { width: 45%; }

    .dm-card__body { padding: 1.2rem 1.2rem 1.35rem; }
    .dm-empty { padding: 1.5rem 1.3rem; }
    .comment-respond { padding: 1.4rem 1.2rem; }
    .dm-sidebar .dm-widget { padding: 1.3rem 1.2rem; }
    .dm-comment__box { padding: 1rem 1.1rem; }

    .dm-postnav { flex-direction: column; }
    .dm-postnav__link--next { text-align: left; }

    .dm-footer__grid { grid-template-columns: minmax(0, 1fr); padding: 3rem 0 2rem; }

    .dm-search { flex-direction: column; }

    .dm-cookie { left: 0.6rem; right: 0.6rem; bottom: 0.6rem; }
    .dm-cookie__inner { flex-direction: column; align-items: stretch; padding: 1rem 1.2rem; gap: 0.9rem; }

    .dm-prose blockquote { padding: 1.2rem 1.6rem 1.2rem 1.2rem; }
    .dm-comments__list .children { margin-left: 1rem; }
    .alignleft, .alignright { float: none; margin: 1em 0; }
}
