/*
Theme Name: dds_khadzhalmakhi.rf
Theme URI: https://хаджалмахи.рф/
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: hdzhm
*/

/* ===== Скрытые элементы (до основных стилей) ===== */
.cookie-banner[hidden] { display: none !important; }
[hidden] { display: none !important; }

/* ===== Переменные ===== */
:root {
    --forest: #1E3A2F;
    --forest-deep: #16302A;
    --contour: #6E8B74;
    --paper: #F2EFE4;
    --paper-2: #E8E2D2;
    --ink: #23281F;
    --ink-soft: #4A5046;
    --muted: #8A9086;
    --light: #F2EFE4;
    --brick: #B4462B;
    --brick-dark: #8F3520;
    --seal: #5E8CA3;
    --shadow: 0 4px 0 rgba(10, 20, 15, .35);
    --font-head: "IBM Plex Mono", "PT Mono", "Courier New", Courier, monospace;
    --font-body: "PT Mono", "IBM Plex Mono", "Courier New", Courier, monospace;
}

/* ===== База ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    overflow-x: hidden;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    color: var(--light);
    background-color: var(--forest);
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1400 420'%3E%3Cpath d='M0 380 L120 300 L190 330 L300 210 L380 260 L470 150 L560 230 L640 120 L720 190 L820 60 L930 200 L1010 150 L1120 260 L1210 200 L1300 290 L1400 240' fill='none' stroke='%236E8B74' stroke-width='2' opacity='.35'/%3E%3Cpath d='M0 405 L140 340 L230 360 L330 270 L420 300 L520 220 L610 280 L700 200 L800 250 L880 150 L990 250 L1090 220 L1190 300 L1290 260 L1400 300' fill='none' stroke='%236E8B74' stroke-width='1.2' opacity='.25'/%3E%3C/svg%3E"),
        url("images/topo.jpg");
    background-repeat: no-repeat, repeat;
    background-position: center 120px, 0 0;
    background-size: min(1400px, 140%) auto, 256px 512px;
    overflow-wrap: break-word;
    hyphens: auto;
}
img { max-width: 100%; height: auto; display: block; }
p { margin: 0 0 1em; }
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 .6em;
    letter-spacing: -.01em;
}
a { color: inherit; text-decoration: underline wavy; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: var(--brick); transition: color .15s, text-decoration-color .15s; }
a:hover { color: var(--brick); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px dashed var(--brick); outline-offset: 3px; }
table { border-collapse: collapse; width: 100%; border: 1px solid var(--ink); }
th, td { border: 1px solid rgba(35, 40, 31, .45); padding: .55em .7em; text-align: left; vertical-align: top; }
th { font-family: var(--font-head); font-weight: 600; background: var(--paper-2); }

.skip { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--paper); color: var(--ink); padding: .6rem 1rem; }
.skip:focus { left: 1rem; top: 1rem; }

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

/* ===== Бумажный лист ===== */
.sheet {
    position: relative;
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--ink);
    box-shadow: var(--shadow);
    padding: 1.6rem 1.3rem;
}
.sheet a { text-decoration-color: var(--brick); }

/* ===== Кнопки-штампы ===== */
.btn-stamp {
    display: inline-block;
    font-family: var(--font-head);
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--light);
    background: var(--brick);
    border: 0;
    border-radius: 0;
    padding: .7em 1.2em;
    box-shadow: inset 0 0 0 2px var(--brick), inset 0 0 0 3px var(--light);
    cursor: pointer;
    transition: background .15s, transform .15s, box-shadow .15s;
    line-height: 1.3;
}
.btn-stamp:hover { background: var(--ink); color: var(--light); box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 3px var(--light); transform: translate(-1px, -1px); }
.btn-stamp:active { transform: translate(1px, 1px); }
.btn-stamp--sm { font-size: .72rem; padding: .55em .95em; }

.stamp {
    display: inline-block;
    font-family: var(--font-head);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    padding: .25em .7em;
    border: 3px double currentColor;
    transform: rotate(-7deg);
    opacity: .85;
    pointer-events: none;
}
.stamp--red { color: var(--brick); }

/* ===== Заголовок секции ===== */
.sec-title {
    font-size: clamp(1.45rem, 3.2vw, 2.1rem);
    font-weight: 600;
    padding-bottom: .45em;
    border-bottom: 2px solid var(--ink);
    position: relative;
}
.sec-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 72px;
    height: 4px;
    background: var(--brick);
}

/* ===== Шапка ===== */
.masthead {
    background: var(--forest-deep);
    border-bottom: 3px solid var(--brick);
    padding: 1.2rem 0 1.4rem;
}
.masthead-top {
    display: flex;
    flex-direction: column;
    gap: .8rem;
    margin-bottom: 1rem;
}
.brand {
    display: flex;
    align-items: center;
    gap: .9rem;
    text-decoration: none;
    color: var(--light);
    min-width: 0;
}
.brand:hover { color: var(--light); }
.brand-logo { flex: 0 0 auto; width: 58px; height: 58px; object-fit: contain; }
.brand-text { min-width: 0; }
.brand-name {
    display: block;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 1.02rem;
    line-height: 1.35;
    max-width: 52ch;
}
.brand-desc {
    margin: 0;
    font-size: .8rem;
    line-height: 1.5;
    color: #C9CDC2;
    max-width: 62ch;
}

.mainnav {
    position: relative;
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--ink);
    box-shadow: var(--shadow);
    padding: .4rem 1rem;
}
.mainnav-toggle {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: .95rem;
    background: none;
    border: 0;
    color: var(--ink);
    padding: .5rem 0;
    cursor: pointer;
}
.mainnav-bars, .mainnav-bars::before, .mainnav-bars::after {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
    position: relative;
}
.mainnav-bars::before, .mainnav-bars::after { content: ""; position: absolute; left: 0; }
.mainnav-bars::before { top: -7px; }
.mainnav-bars::after { top: 7px; }
.mainnav-list { list-style: none; margin: 0; padding: 0; display: none; }
.mainnav.is-open .mainnav-list { display: block; }
.mainnav-list li { border-top: 1px dashed rgba(35, 40, 31, .35); }
.mainnav-list a {
    display: block;
    padding: .7rem 0;
    font-family: var(--font-head);
    font-size: 1rem;
    text-decoration: none;
    color: var(--ink);
    position: relative;
}
.mainnav-list a:hover { color: var(--brick); }
.mainnav-list .current-menu-item > a,
.mainnav-list .current_page_item > a { color: var(--brick); }
.mainnav-stamp {
    position: absolute;
    right: 1rem;
    top: -18px;
    width: 76px;
    height: 76px;
    transform: rotate(-14deg);
    opacity: .75;
    pointer-events: none;
}

/* ===== Главная ===== */
.front { padding: 2rem 0 3rem; }
.fs { margin-bottom: 2.4rem; }

/* Вступление */
.intro {
    background: linear-gradient(175deg, #EFE6CF 0%, var(--paper-2) 100%);
    padding: 2rem 1.4rem 2.2rem;
    margin-bottom: 2.4rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    clip-path: polygon(0 3px, 6% 0, 14% 4px, 27% 1px, 41% 5px, 55% 0, 68% 4px, 82% 1px, 93% 5px, 100% 2px, 100% calc(100% - 4px), 90% 100%, 77% calc(100% - 5px), 63% calc(100% - 1px), 48% calc(100% - 5px), 33% 100%, 19% calc(100% - 4px), 8% 100%, 0 calc(100% - 3px));
    border: 0;
}
.intro-text { min-width: 0; }
.intro-title {
    font-size: clamp(2rem, 6vw, 3.8rem);
    font-weight: 700;
    line-height: 1.05;
    margin-bottom: .35em;
    letter-spacing: -.02em;
}
.intro-sub { font-size: clamp(1rem, 2.2vw, 1.3rem); margin: 0; color: var(--ink-soft); }
.intro-marks {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem 1.4rem;
}
.seal { width: 96px; height: 96px; color: var(--seal); transform: rotate(-12deg); opacity: .85; flex: 0 0 auto; }
.intro-num { font-family: var(--font-body); font-size: 1rem; color: var(--ink-soft); transform: rotate(3deg); }
.intro-box {
    font-family: var(--font-head);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: .9rem;
    border: 2px solid var(--ink);
    padding: .3em .7em;
    transform: rotate(-6deg);
}

/* Блок 1 — расписание */
.fs-schedule { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
.sched-sheet { display: flex; flex-direction: column; padding: 0; }
.sched-tab {
    background: var(--brick);
    color: var(--light);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .6rem 1.3rem;
}
.sched-tab-num { font-family: var(--font-head); font-weight: 700; font-size: 2.2rem; line-height: 1; }
.sched-tab-label { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .14em; font-size: .85rem; }
.sched-main { position: relative; padding: 1.6rem 1.3rem 1.4rem; min-width: 0; }
.sched-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }
.table-wrap { overflow-x: auto; min-width: 0; }
.sched-table { border: 0; border-top: 2px solid var(--ink); font-size: .92rem; min-width: 420px; }
.sched-table th { background: none; border: 0; border-bottom: 1px solid var(--ink); font-weight: 500; }
.sched-table td { border: 0; border-bottom: 1px dashed rgba(35, 40, 31, .55); }
.sched-table td:nth-child(2) { color: var(--brick); font-weight: 700; }
.sched-table td:nth-child(3), .sched-table td:nth-child(4) { white-space: nowrap; }
.sched-memo {
    font-size: .86rem;
    line-height: 1.6;
    background: repeating-linear-gradient(transparent 0 calc(1.6em - 1px), rgba(35, 40, 31, .18) calc(1.6em - 1px) 1.6em);
    border-left: 3px solid var(--brick);
    padding: .2rem 0 .2rem 1rem;
}
.memo-title { font-size: .95rem; text-transform: uppercase; letter-spacing: .08em; color: var(--brick); margin-bottom: .5em; }
.sched-memo p { margin: 0 0 .8em; }
.memo-note { color: var(--ink-soft); font-style: italic; }
.sched-stamp { position: absolute; right: 2.2rem; bottom: 4.2rem; font-size: .72rem; display: none; background: rgba(242, 239, 228, .6); }
.sched-ridge { width: 100%; margin-top: 1.4rem; border-bottom: 1px solid var(--ink); }
.sched-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; align-content: start; }
.plate {
    position: relative;
    margin: 0;
    background: var(--paper);
    border: 1px solid var(--ink);
    box-shadow: var(--shadow);
    padding: 2.4rem 1rem 1rem;
}
.plate--stars::before {
    content: "★ ★";
    position: absolute;
    top: .5rem;
    right: .9rem;
    font-size: 1.5rem;
    letter-spacing: .25em;
    color: var(--seal);
    line-height: 1;
}
.plate img { width: 100%; aspect-ratio: 9 / 10; object-fit: contain; }

/* Блок 2 — диспансеризация */
.fs-checkup { padding: 1.8rem 1.3rem 1.6rem; }
.ribbon {
    list-style: none;
    margin: 1.8rem 0 1.4rem;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .9rem;
}
.ribbon-step { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.ribbon-num {
    flex: 0 0 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 54px;
    background: var(--brick);
    color: var(--light);
    font-family: var(--font-head);
    font-size: 1.8rem;
    font-weight: 600;
    clip-path: polygon(0 0, 82% 0, 100% 50%, 82% 100%, 0 100%, 14% 50%);
}
.ribbon-step p { margin: 0; font-size: .9rem; line-height: 1.45; min-width: 0; }
.checkup-foot { margin: 0; padding-top: .9rem; border-top: 1px dashed rgba(35, 40, 31, .5); font-size: .85rem; color: var(--ink-soft); }

/* Последние записи */
.fs-latest { padding: 1.8rem 1.3rem 2rem; background: var(--paper); }
.latest-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.6rem; margin-top: 1.8rem; align-items: start; }
.latest-more { margin: 2rem 0 0; }
.empty-note { color: var(--ink-soft); }

/* Карточка записи */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--paper-2);
    color: var(--ink);
    border: 1px solid var(--ink);
    box-shadow: 3px 4px 0 rgba(35, 40, 31, .35);
    overflow: hidden;
    min-width: 0;
    transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translate(-2px, -3px); box-shadow: 6px 8px 0 rgba(35, 40, 31, .3); }
.card::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--paper-2) 0 49%, #CFC6AE 50% 100%);
    box-shadow: -2px -2px 3px rgba(0, 0, 0, .12);
    pointer-events: none;
}
.card-thumb { position: relative; border-bottom: 1px solid var(--ink); }
.card-thumb a { display: block; }
.card-thumb img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; filter: sepia(.25) saturate(.85); }
.card-thumb-blank {
    display: block;
    aspect-ratio: 16 / 10;
    background:
        repeating-radial-gradient(circle at 70% 120%, transparent 0 14px, rgba(110, 139, 116, .45) 14px 15px),
        var(--forest);
}
.card-body { flex: 1; display: flex; flex-direction: column; padding: 1.1rem 1.2rem 1.3rem; min-width: 0; }
.card-body::before {
    content: "★";
    position: absolute;
    top: .7rem;
    right: .7rem;
    width: 52px;
    height: 52px;
    border: 2px solid var(--seal);
    outline: 1px solid var(--seal);
    outline-offset: 3px;
    border-radius: 50%;
    color: var(--seal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    opacity: .7;
    transform: rotate(-10deg);
    pointer-events: none;
}
.card-pin { align-self: flex-start; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--light); background: var(--seal); padding: .15em .6em; margin-bottom: .6rem; }
.card-title { font-size: 1.08rem; line-height: 1.3; margin: 0 0 .6rem; }
.card-title a { text-decoration: none; color: var(--ink); }
.card-title a:hover { color: var(--brick); }
.card-excerpt { font-size: .86rem; line-height: 1.55; color: var(--ink-soft); flex: 1; }
.card-excerpt p { margin: 0 0 .5em; background: none; }
.card-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .7rem; margin-top: .9rem; padding-right: 26px; }
.card-date { font-size: .78rem; color: #6B7167; }

/* Блок 3 — профилактика */
.mosaic {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.1rem;
}
.mosaic-lead { padding: 1.6rem 1.3rem; }
.mosaic-lead p { font-size: .92rem; }
.ticks { list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.ticks li {
    position: relative;
    padding: .4rem 0 .4rem 1.9rem;
    border-bottom: 1px dashed rgba(35, 40, 31, .35);
}
.ticks li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: .38rem;
    width: 1.25rem;
    height: 1.25rem;
    line-height: 1.15rem;
    text-align: center;
    border: 1px solid var(--brick);
    color: var(--brick);
    font-size: .8rem;
}
.mosaic-tile {
    margin: 0;
    background: var(--paper);
    border: 1px solid var(--ink);
    box-shadow: var(--shadow);
    padding: .7rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.mosaic-tile img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border: 1px solid var(--brick);
    outline: 1px solid var(--brick);
    outline-offset: -8px;
}
.mosaic-tile--tea img { aspect-ratio: 10 / 9; }
.mosaic-tile figcaption { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); padding-top: .55rem; }
.prevent-foot { margin: 1rem 0 0; font-size: .85rem; color: #D5D9CE; }

/* Блок 4 — справка */
.fs-ref { padding: 1.8rem 1.3rem 1.4rem; }
.ref-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.6rem; margin-top: 1.6rem; }
.ref-history { font-size: .9rem; line-height: 1.7; min-width: 0; }
.ref-history p:first-child::first-letter {
    float: left;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 3.1em;
    line-height: .9;
    padding: .05em .12em 0 0;
    color: var(--brick);
}
.ref-profile { margin: 0; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 1rem; align-items: center; border-top: 1px dashed rgba(35, 40, 31, .5); padding-top: 1.2rem; }
.ref-profile svg { width: 100%; height: auto; }
.ref-heights { list-style: none; margin: 0; padding: 0; font-size: .82rem; }
.ref-heights li { padding: .35rem 0; border-bottom: 1px dashed rgba(35, 40, 31, .35); }
.ref-heights b { display: block; font-family: var(--font-head); color: var(--brick); }
.ref-profile figcaption { grid-column: 1 / -1; font-size: .72rem; color: #6B7167; font-style: italic; }
.ref-address { margin: 1.6rem 0 0; padding-top: .9rem; border-top: 1px solid var(--ink); font-size: .85rem; }

/* ===== Внутренние страницы ===== */
.inner { padding: 1.6rem 0 3rem; }
.crumbs { font-size: .82rem; color: #D5D9CE; margin-bottom: 1.4rem; }
.crumbs a { color: var(--light); }
.crumbs a:hover { color: #F0B8A6; }
.crumbs-sep { color: var(--brick); margin: 0 .2em; }
.crumbs span:last-child { color: #C9CDC2; }

.layout-single { display: block; }
.layout-single .content-area { margin-left: auto; margin-right: auto; }
.layout-with-sidebar { display: block; }
.content-area { min-width: 0; }

.page-head { margin-bottom: 1.6rem; padding: 1.5rem 1.3rem; }
.page-title { font-size: clamp(1.6rem, 4vw, 2.5rem); margin-bottom: .3em; }
.page-lead { margin: 0; color: var(--ink-soft); font-size: .92rem; }

.post-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }

.entry { padding: 1.6rem 1.3rem 2rem; }
.entry-head { border-bottom: 2px solid var(--ink); margin-bottom: 1.4rem; padding-bottom: .8rem; }
.entry-title { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.entry-meta { margin: 0; font-size: .82rem; color: #6B7167; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.entry-cat a { color: var(--brick); }
.entry-cover { margin: 0 0 1.6rem; border: 1px solid var(--ink); }
.entry-cover img { width: 100%; }
.entry-content { font-size: .98rem; line-height: 1.75; }
.entry-content h2 { font-size: 1.5rem; margin-top: 1.6em; padding-bottom: .3em; border-bottom: 1px dashed rgba(35, 40, 31, .5); }
.entry-content h3 { font-size: 1.22rem; margin-top: 1.4em; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.entry-content li { margin-bottom: .35em; }
.entry-content ul li::marker { color: var(--brick); }
.entry-content blockquote {
    margin: 1.4em 0;
    padding: 1.1rem 1.3rem;
    background: var(--paper-2);
    border-left: 5px solid var(--brick);
    font-family: var(--font-head);
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content table { margin: 1.2em 0; font-size: .9rem; display: block; overflow-x: auto; }
.entry-content img { margin: 1em 0; border: 1px solid var(--ink); }
.entry-content figure { margin: 1.4em 0; }
.entry-content figcaption { font-size: .8rem; color: #6B7167; }
.entry-content pre { background: var(--paper-2); padding: 1rem; overflow-x: auto; border: 1px solid rgba(35, 40, 31, .4); }
.entry-content hr { border: 0; border-top: 1px dashed var(--ink); margin: 2em 0; }
.entry-tags { margin: 1.6rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.entry-tags a { font-size: .8rem; text-decoration: none; border: 1px solid var(--ink); padding: .15em .6em; }
.entry-tags a:hover { background: var(--ink); color: var(--light); }

.entry-nav { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin: 1.6rem 0; }
.entry-nav a { display: block; background: var(--paper-2); color: var(--ink); border: 1px solid var(--ink); padding: 1rem 1.2rem; text-decoration: none; font-family: var(--font-head); font-size: .92rem; }
.entry-nav a span { display: block; font-family: var(--font-body); font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--brick); margin-bottom: .3rem; }
.entry-nav a:hover { background: var(--paper); }
.entry-nav-next { text-align: right; }

/* ===== Сайдбар ===== */
.sidebar { margin-top: 2rem; min-width: 0; }
.sidebar .wdg {
    background: var(--paper-2);
    color: var(--ink);
    border: 1px solid var(--ink);
    box-shadow: var(--shadow);
    padding: 1.3rem 1.3rem 1.1rem;
    margin-bottom: 1.5rem;
}
.sidebar .wdg-title { font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); padding-bottom: .5rem; border-bottom: 2px solid var(--brick); }
.sidebar .wdg a { color: var(--ink); }
.sidebar .wdg a:hover { color: var(--brick); }
.sidebar .wdg ul { list-style: none; margin: 0; padding: 0; }
.sidebar .wdg li { padding: .55rem 0; border-bottom: 1px dashed rgba(35, 40, 31, .4); font-size: .88rem; line-height: 1.45; }
.sidebar .wdg li:last-child { border-bottom: 0; }
.sidebar .wdg .post-date { display: block; font-size: .74rem; color: #6B7167; }
.sidebar .wdg p { color: var(--ink); font-size: .88rem; }

/* ===== Пагинация ===== */
.pager { display: flex; flex-wrap: wrap; gap: .45rem; margin: 2rem 0 0; align-items: center; }
.pager .page-numbers {
    display: inline-block;
    min-width: 2.5rem;
    text-align: center;
    padding: .45rem .7rem;
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--ink);
    text-decoration: none;
    font-family: var(--font-head);
    font-size: .9rem;
}
.pager a.page-numbers:hover { background: var(--ink); color: var(--light); }
.pager .page-numbers.current { background: var(--brick); color: var(--light); border-color: var(--brick); box-shadow: inset 0 0 0 2px var(--brick), inset 0 0 0 3px var(--light); }
.pager .page-numbers.dots { background: none; border: 0; color: var(--light); min-width: 0; }

/* ===== Поиск ===== */
.seek { margin: 1.2rem 0; }
.seek-label { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .4rem; }
.seek-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.seek-field {
    flex: 1 1 200px;
    min-width: 0;
    font-family: var(--font-body);
    font-size: .95rem;
    padding: .6rem .8rem;
    border: 1px solid var(--ink);
    border-radius: 0;
    background: #FBF9F2;
    color: var(--ink);
}

/* ===== 404 ===== */
.notfound { padding: 2.4rem 1.4rem; text-align: left; position: relative; }
.notfound-code { font-family: var(--font-head); font-weight: 700; font-size: clamp(4rem, 14vw, 8rem); line-height: 1; color: var(--brick); margin: 0 0 .2em; }
.notfound-stamp { position: absolute; top: 1.4rem; right: 1.2rem; font-size: .8rem; }

/* ===== Комментарии ===== */
.talk { margin-top: 1.6rem; padding: 1.6rem 1.3rem; }
.talk-title, .comment-reply-title { font-size: 1.3rem; }
.talk-list, .talk-list .children { list-style: none; margin: 0; padding: 0; }
.talk-list .children { padding-left: 1.4rem; border-left: 2px dashed rgba(35, 40, 31, .3); }
.note-body { padding: 1rem 0; border-bottom: 1px dashed rgba(35, 40, 31, .4); }
.note-head { display: flex; gap: .8rem; align-items: center; margin-bottom: .5rem; }
.note-avatar { border-radius: 50%; border: 1px solid var(--ink); }
.note-author { display: block; font-family: var(--font-head); font-weight: 600; }
.note-date { font-size: .76rem; color: #6B7167; }
.note-wait { font-size: .82rem; color: var(--brick); }
.note-text { font-size: .92rem; }
.note-reply a { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--brick); }
.talk-closed { color: var(--ink-soft); }
.comment-respond { margin-top: 1.6rem; }
.form-hint { font-size: .82rem; color: var(--ink-soft); }
.form-row { margin: 0 0 1rem; }
.form-row label { display: block; font-size: .82rem; margin-bottom: .3rem; }
.form-row input, .form-row textarea {
    width: 100%;
    font-family: var(--font-body);
    font-size: .95rem;
    padding: .6rem .8rem;
    border: 1px solid var(--ink);
    border-radius: 0;
    background: #FBF9F2;
    color: var(--ink);
}
.form-check { display: flex; gap: .5rem; align-items: flex-start; font-size: .82rem; }
.form-submit { margin: 1rem 0 0; }
.comments-navigation .nav-links, .comment-navigation .nav-links { display: flex; justify-content: space-between; gap: 1rem; margin: 1rem 0; font-size: .85rem; }

/* ===== Подвал ===== */
.sitefoot {
    position: relative;
    background: var(--forest-deep);
    color: var(--light);
    padding: 3rem 0 1.6rem;
    margin-top: 2rem;
}
.sitefoot::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -10px;
    height: 12px;
    background: var(--paper-2);
    clip-path: polygon(0 40%, 9% 10%, 21% 55%, 34% 20%, 47% 60%, 61% 15%, 74% 50%, 86% 10%, 100% 45%, 100% 100%, 0 100%);
    opacity: .9;
}
.sitefoot-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
.sitefoot-col { min-width: 0; }
.sitefoot .wdg { margin-bottom: 1rem; }
.sitefoot .wdg-title { font-size: 1.05rem; color: var(--light); padding-bottom: .5rem; border-bottom: 1px dashed var(--contour); }
.sitefoot .wdg, .sitefoot .wdg p, .sitefoot .textwidget { color: #D5D9CE; font-size: .86rem; line-height: 1.65; }
.sitefoot .wdg a { color: var(--light); text-decoration-color: var(--brick); }
.sitefoot .wdg a:hover { color: #F0B8A6; }
.sitefoot .wdg ul { list-style: none; margin: 0; padding: 0; }
.sitefoot .wdg li { padding: .3rem 0; }
.sitefoot .wdg li::before { content: "— "; color: var(--brick); }
.sitefoot .wdg .post-date { color: var(--muted); }
.sitefoot-copy { margin: 2.2rem 0 0; padding-top: 1rem; border-top: 1px solid rgba(110, 139, 116, .5); font-size: .8rem; color: #A6ACA1; }

/* ===== Cookie ===== */
.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 50;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--ink);
    box-shadow: 0 6px 0 rgba(10, 20, 15, .45);
    padding: 1.1rem 1.2rem;
    display: flex;
    flex-wrap: wrap;
    gap: .9rem 1.2rem;
    align-items: center;
}
.cookie-text { margin: 0; flex: 1 1 280px; font-size: .84rem; line-height: 1.5; min-width: 0; }

/* ===== Планшет ===== */
@media (min-width: 600px) {
    .sheet { padding: 2rem 2rem; }
    .masthead-top { flex-direction: row; justify-content: space-between; align-items: center; gap: 2rem; }
    .brand-desc { text-align: right; max-width: 38ch; }
    .intro { padding: 2.6rem 2.4rem 2.8rem; }
    .sched-stamp { display: inline-block; }
    .sched-main { padding: 2rem 2rem 1.6rem; }
    .fs-checkup, .fs-latest, .fs-ref { padding: 2.2rem 2rem 2rem; }
    .ribbon { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
    .ribbon-step { flex-direction: column; align-items: stretch; gap: .9rem; }
    .ribbon-num { flex: none; height: 58px; margin-right: -6px; }
    .ribbon-step p { padding: 0 .9rem 0 1.1rem; }
    .latest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mosaic-lead { grid-column: 1 / -1; }
    .post-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ref-profile { grid-template-columns: 150px minmax(0, 1fr); }
    .entry, .talk, .page-head { padding: 2rem 2.2rem; }
    .layout-single .content-area { width: 85%; }
    .entry-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .entry-nav-next { grid-column: 2; }
    .sitefoot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===== Десктоп ===== */
@media (min-width: 960px) {
    body { font-size: 17px; }
    .brand-name { font-size: 1.12rem; }
    .mainnav { display: flex; align-items: center; padding: 0 1.4rem; }
    .mainnav-toggle { display: none; }
    .mainnav-list { display: flex; flex-wrap: wrap; gap: 0 2.2rem; padding-right: 110px; }
    .mainnav-list li { border: 0; }
    .mainnav-list a { padding: 1rem 0 .85rem; font-size: 1.04rem; }
    .mainnav-list a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--brick); transform: scaleX(0); transform-origin: left; transition: transform .2s; }
    .mainnav-list a:hover::after, .mainnav-list .current-menu-item > a::after, .mainnav-list .current_page_item > a::after { transform: scaleX(1); }
    .mainnav-stamp { width: 118px; height: 118px; top: -26px; right: 1.6rem; }

    .front { width: min(85%, 1180px); }
    .fs { margin-bottom: 3rem; }
    .intro { flex-direction: row; align-items: center; justify-content: space-between; padding: 3rem 3rem 3.2rem; }
    .intro-marks { flex-direction: column; align-items: flex-end; flex: 0 0 auto; }
    .seal { width: 130px; height: 130px; }

    .fs-schedule { grid-template-columns: minmax(0, 1fr) 200px; gap: 2.4rem; }
    .sched-sheet { flex-direction: row; }
    .sched-tab { flex: 0 0 78px; flex-direction: column; justify-content: flex-start; padding: 1.6rem 0; gap: 1.4rem; }
    .sched-tab-num { font-size: 3.2rem; }
    .sched-tab-label { writing-mode: vertical-rl; transform: rotate(180deg); }
    .sched-main { flex: 1 1 auto; padding: 2.2rem 2.4rem 1.8rem; }
    .sched-body { grid-template-columns: minmax(0, 1fr) 220px; gap: 2rem; }
    .sched-side { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }

    .ribbon-num { height: 64px; font-size: 2.2rem; }

    .latest-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 1.8rem; }
    .latest-grid .card:first-child { margin-top: -.6rem; }
    .latest-grid .card:nth-child(2) { margin-top: 2.6rem; }
    .latest-grid .card:nth-child(3) { margin-top: 1.2rem; }
    .latest-grid .card:first-child .card-title { font-size: 1.3rem; }

    .mosaic {
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr);
        grid-template-rows: auto auto;
        gap: 1.4rem;
        align-items: start;
    }
    .mosaic-lead { grid-column: 1; grid-row: 1; }
    .mosaic-tile--tall { grid-column: 2; grid-row: 1 / span 2; align-self: stretch; }
    .mosaic-tile--tall img { flex: 1 1 auto; height: 0; min-height: 420px; aspect-ratio: auto; }
    .mosaic-tile--hike { grid-column: 3; grid-row: 1; }
    .mosaic-tile--tea { grid-column: 1; grid-row: 2; justify-self: end; width: 78%; transform: rotate(-1.2deg); }
    .mosaic-tile--dent { grid-column: 3; grid-row: 2; }

    .ref-grid { grid-template-columns: minmax(0, 1fr) 340px; gap: 0; }
    .ref-history { column-count: 2; column-gap: 2.2rem; column-rule: 1px dashed rgba(35, 40, 31, .4); padding-right: 2rem; }
    .ref-history p { break-inside: avoid; }
    .ref-profile { grid-template-columns: 150px minmax(0, 1fr); border-top: 0; border-left: 1px solid var(--ink); padding: 0 0 0 1.6rem; }

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

    .sitefoot-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; }
}

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