/*
Theme Name: dds_links-guide.ru
Theme URI: https://links-guide.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: zkldk
*/

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

/* ---------- Шрифты ---------- */
@font-face {
    font-family: "Oswald";
    src: url("fonts/oswald-var.woff2") format("woff2");
    font-weight: 200 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "PT Serif";
    src: url("fonts/ptserif-regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "PT Serif";
    src: url("fonts/ptserif-bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "PT Serif";
    src: url("fonts/ptserif-italic.woff2") format("woff2");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

/* ---------- Палитра ---------- */
:root {
    --felt: #1E3B2F;
    --felt-deep: #14271F;
    --paper: #F2EAD9;
    --ink: #23201A;
    --muted: #7A6E5C;
    --brick: #B8452E;
    --brick-dark: #96361F;
    --copper: #A97E4B;
    --copper-light: #D9B98A;
    --dust: #3E6B8C;
    --dust-dark: #2D5270;
    --sheet: #E6DFCF;
    --paper-line: #CDBF9F;
    --paper-under: #E8DEC6;
    --paper-under-edge: #B9AB8C;
    --on-felt: #EFE6D2;
    --on-felt-muted: #CFC4AC;
    --head: "Oswald", "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
    --text: "PT Serif", Georgia, "Times New Roman", serif;
    --stack: 4px 5px 0 -1px var(--paper-under), 4px 5px 0 0 var(--paper-under-edge), 8px 10px 0 -1px var(--paper-under), 8px 10px 0 0 var(--paper-under-edge);
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    overflow-x: hidden;
    font-family: var(--text);
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--on-felt);
    background: var(--felt) url("images/felt.jpg") repeat;
    background-size: 512px auto;
    -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; }
img { display: block; }
p { margin: 0 0 1em; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 .6em; line-height: 1.2; font-weight: 600; }
p, li, h1, h2, h3, h4, td, th, blockquote, figcaption, .card-title, .rubric-note, .callout {
    overflow-wrap: break-word;
    hyphens: auto;
}
a { color: var(--copper-light); text-decoration-color: var(--copper); text-underline-offset: 3px; }
a:hover { color: #F2D7A8; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 2px dashed var(--brick);
    outline-offset: 3px;
}
button { font: inherit; }

.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    white-space: nowrap;
}
.skip {
    position: absolute;
    left: 1rem; top: -4rem;
    z-index: 100;
    padding: .6rem 1rem;
    background: var(--paper);
    color: var(--ink);
    border: 2px solid var(--copper);
}
.skip:focus { top: 1rem; }

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

/* ---------- Кнопка-ярлычок ---------- */
.tag-btn {
    display: inline-block;
    padding: .42em 1em .45em;
    border: 1px solid var(--brick-dark);
    border-radius: 0;
    background: var(--brick);
    color: #FFF8EE;
    font-family: var(--text);
    font-size: .9rem;
    line-height: 1.25;
    text-decoration: none;
    cursor: pointer;
    box-shadow: inset 0 0 0 2px rgba(255, 248, 238, .14);
    transition: background-color .15s ease, transform .1s ease;
}
.tag-btn:hover, .tag-btn:focus-visible {
    background: var(--brick-dark);
    color: #FFF8EE;
    transform: translate(1px, 1px);
}

/* ---------- Ярлык заголовка секции ---------- */
.label-title {
    display: table;
    margin: 0 auto 2.6rem;
    padding: 0;
    font-family: var(--head);
    font-size: clamp(1.35rem, 2.5vw, 2rem);
    font-weight: 600;
    letter-spacing: .03em;
    line-height: 1.15;
    text-transform: uppercase;
    color: var(--ink);
}
.label-title span {
    display: block;
    padding: .38em 1.05em .42em;
    background: var(--paper);
    border: 2px solid var(--copper);
    outline: 1px solid var(--copper);
    outline-offset: -6px;
}
.label-title--small { margin: 0 0 1.6rem; font-size: clamp(1.05rem, 1.6vw, 1.3rem); }
.label-title--page { margin: 0 0 1.8rem; text-align: left; font-size: clamp(1.4rem, 2.8vw, 2.2rem); }

/* ---------- Шапка ---------- */
.masthead {
    position: relative;
    background: var(--felt) url("images/felt.jpg") repeat;
    background-size: 512px auto;
    border-bottom: 2px solid var(--copper);
    box-shadow: 0 4px 0 -2px var(--felt), 0 5px 0 -2px rgba(169, 126, 75, .6);
}
.masthead-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.4rem 0 1.3rem;
}
.brand {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    min-width: 0;
    color: var(--on-felt);
    text-decoration: none;
}
.brand:hover { color: var(--on-felt); }
.brand-mark { flex: 0 0 auto; display: block; width: 46px; }
.brand-svg { display: block; width: 46px; height: 61px; }
.brand-logo { width: 56px; height: auto; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
    font-family: var(--head);
    font-size: clamp(2rem, 4.2vw, 3.3rem);
    font-weight: 600;
    line-height: 1;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #F2E4C6;
}
.brand-name--long { font-size: clamp(1.3rem, 2.4vw, 1.9rem); letter-spacing: .02em; }
.brand-sub { margin-top: .35rem; font-size: 1rem; color: #E1D6BE; }
.brand-desc { margin-top: .2rem; max-width: 56ch; font-size: .8rem; line-height: 1.4; color: #B8AD95; }

.site-nav .nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem 1.6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.site-nav a {
    display: inline-block;
    padding: .2rem 0;
    color: var(--on-felt);
    font-size: 1.02rem;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color .15s ease, border-color .15s ease;
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--copper-light); border-bottom-color: var(--copper); }
.site-nav .current-menu-item > a, .site-nav .current_page_item > a { border-bottom: 2px solid var(--copper); }

.nav-toggle {
    display: none;
    align-items: center;
    gap: .55rem;
    padding: .5rem .8rem;
    background: transparent;
    border: 1px solid var(--copper);
    color: var(--on-felt);
    cursor: pointer;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block;
    width: 20px; height: 2px;
    background: var(--copper-light);
    position: relative;
}
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle-label { font-family: var(--head); text-transform: uppercase; letter-spacing: .08em; font-size: .9rem; }

/* ---------- Главная: общие зоны ---------- */
.zone { position: relative; padding: 3.6rem 0; }

/* Разделы каталога */
.rubrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    padding: 1rem 0 1.6rem;
    list-style: none;
}
.rubric { position: relative; min-width: 0; margin-inline: -.35rem; }
.rubric:nth-child(odd) { transform: rotate(-1deg); z-index: 2; }
.rubric:nth-child(even) { transform: rotate(.8deg) translateY(.4rem); z-index: 1; }
.rubric-link {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    padding: 2.6rem 1.3rem 1.8rem;
    background: var(--paper);
    border: 1px solid var(--paper-line);
    box-shadow: var(--stack);
    color: var(--ink);
    text-align: center;
    text-decoration: none;
    transition: transform .15s ease;
}
.rubric-link:hover, .rubric-link:focus-visible { transform: translateY(-5px); color: var(--ink); }
.rubric-tab {
    position: absolute;
    top: -.95rem;
    left: 50%;
    transform: translateX(-50%);
    padding: .22em .95em .26em;
    background: var(--dust);
    border: 1px solid var(--dust-dark);
    color: var(--paper);
    font-family: var(--head);
    font-size: .88rem;
    font-weight: 500;
    letter-spacing: .07em;
    text-transform: uppercase;
    white-space: nowrap;
}
.rubric-name {
    margin-bottom: .55rem;
    font-family: var(--head);
    font-size: clamp(1.35rem, 2.1vw, 2rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: .02em;
    text-transform: uppercase;
}
.rubric-note { max-width: 24ch; font-size: .92rem; line-height: 1.45; color: #3A342A; }
.rubric-ribbon {
    position: absolute;
    bottom: -1.6rem;
    width: 18px;
    height: 40px;
    background: #E3D7BD;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
    z-index: -1;
}
.rubric--1 .rubric-ribbon { right: 18%; }
.rubric--2 .rubric-ribbon { left: 54%; background: #D9CBAA; }
.rubric--3 .rubric-ribbon { left: 50%; }
.rubric--4 .rubric-ribbon { right: -6px; bottom: 30%; width: 40px; height: 16px; clip-path: polygon(0 0, 100% 0, 80% 50%, 100% 100%, 0 100%); }

/* Как устроена карточка */
.zone-anatomy { overflow: hidden; padding-bottom: 4.4rem; }
.anatomy-art {
    position: absolute;
    top: 50%;
    transform: translateY(-46%);
    width: clamp(110px, 12vw, 200px);
    height: auto;
    pointer-events: none;
}
.anatomy-art--left { left: 0; }
.anatomy-art--right { right: 0; width: clamp(104px, 11vw, 186px); }
.anatomy {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr);
    column-gap: 3rem;
    align-items: center;
    max-width: 920px;
    margin: 0 auto;
}
.callouts { display: flex; flex-direction: column; gap: 3.2rem; min-width: 0; }
.callouts--left { text-align: right; padding-top: .4rem; }
.callouts--right { text-align: left; padding-top: 1.4rem; }
.callout { position: relative; color: var(--on-felt-muted); }
.callout-name {
    margin: 0 0 .25rem;
    font-family: var(--text);
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--paper);
}
.callout p { margin: 0; font-size: .88rem; line-height: 1.45; }
.callout::before, .callout::after { content: ""; position: absolute; top: .78rem; }
.callout::before { height: 1px; width: 4.6rem; background: var(--copper); }
.callout::after { width: 7px; height: 7px; margin-top: -3px; border-radius: 50%; background: var(--copper); }
.callouts--left .callout::before { right: -4.8rem; }
.callouts--left .callout::after { right: -5.05rem; }
.callouts--right .callout::before { left: -4.8rem; }
.callouts--right .callout::after { left: -5.05rem; }

.specimen { position: relative; z-index: 1; min-width: 0; }
.specimen-sheet {
    position: relative;
    padding: 1.9rem 2rem 2.6rem;
    background: var(--paper);
    border: 1px solid var(--paper-line);
    box-shadow: var(--stack);
    color: var(--ink);
    transform: rotate(-.6deg);
}
.specimen-sheet::before {
    content: "";
    position: absolute;
    inset: .55rem;
    border: 1px solid rgba(169, 126, 75, .45);
    pointer-events: none;
}
.specimen-row { display: flex; flex-wrap: wrap; gap: .1rem .7rem; margin: 0 0 .55rem; font-size: .95rem; }
.specimen-key { position: relative; padding-left: .9rem; font-weight: 700; }
.specimen-key::before {
    content: "";
    position: absolute;
    left: 0; top: .55em;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--copper);
}
.specimen-val { color: var(--muted); font-style: italic; }
.specimen-row--d { margin-top: 1rem; flex-direction: column; }
.specimen-lines { display: flex; flex-direction: column; gap: .55rem; padding: .5rem 0 0 .9rem; }
.specimen-lines i { display: block; height: 1px; background: repeating-linear-gradient(90deg, var(--muted) 0 6px, transparent 6px 10px); }
.specimen-lines i:nth-child(2) { width: 88%; }
.specimen-lines i:nth-child(3) { width: 62%; }
.stamp {
    display: inline-block;
    padding: .12em .55em .16em;
    border: 3px double var(--brick);
    color: var(--brick);
    font-family: var(--head);
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .12em;
    line-height: 1.2;
    text-transform: uppercase;
    transform: rotate(-9deg);
    opacity: .9;
}
.specimen .stamp { position: absolute; right: 1.4rem; bottom: 1.1rem; }

/* Последние записи */
.zone-latest {
    background-color: var(--sheet);
    background-image:
        repeating-linear-gradient(0deg, rgba(122, 110, 92, .17) 0 1px, transparent 1px 24px),
        repeating-linear-gradient(90deg, rgba(122, 110, 92, .17) 0 1px, transparent 1px 24px);
    border-top: 3px solid #C9BB9B;
    border-bottom: 3px solid #C9BB9B;
    color: var(--ink);
}
.zone-latest .empty-note { color: var(--ink); text-align: center; }

.cards { display: grid; gap: 2.2rem 1.8rem; }
.cards--front { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards--list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 1.15rem 1.15rem 1rem;
    background: var(--paper);
    border: 1px solid var(--paper-line);
    border-top: 2px solid #D8C9A8;
    box-shadow: var(--stack);
    color: var(--ink);
    transition: transform .15s ease;
}
.cards--front .card:nth-child(1) { transform: rotate(-.6deg); }
.cards--front .card:nth-child(2) { transform: rotate(.4deg); }
.cards--front .card:nth-child(3) { transform: rotate(-.3deg); }
.cards .card:hover { transform: rotate(0) translateY(-3px); }
.card-clip {
    position: absolute;
    top: -16px;
    right: 22px;
    width: 16px;
    height: 42px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 42'%3E%3Cpath d='M5 30V8a3.5 3.5 0 0 1 7 0v26a5.5 5.5 0 0 1-11 0V12' fill='none' stroke='%23A97E4B' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / contain;
}
.card-body { flex: 1; display: flex; align-items: flex-start; gap: 1rem; min-width: 0; }
.card-thumb {
    flex: 0 0 96px;
    display: block;
    border: 1px solid #8C7F68;
    background: var(--sheet);
}
.card-thumb img {
    display: block;
    width: 96px;
    height: 96px;
    object-fit: cover;
    filter: sepia(.25) saturate(.85);
}
.cards--list .card-thumb { flex-basis: 112px; }
.cards--list .card-thumb img { width: 112px; height: 112px; }
.card-text { flex: 1; min-width: 0; }
.card-title {
    margin: 0 0 .45rem;
    font-family: var(--text);
    font-size: 1.12rem;
    font-weight: 400;
    line-height: 1.25;
}
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover, .card-title a:focus-visible { color: var(--brick); text-decoration: underline; text-decoration-color: var(--copper); }
.card-excerpt { font-size: .9rem; line-height: 1.45; color: #4A4236; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-excerpt a { color: var(--brick); }
.card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .6rem;
    margin-top: .9rem;
}
.card-date { font-size: .85rem; color: var(--muted); }

/* Пара блоков: дневник и указатель */
.pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 3rem;
    align-items: start;
}
.diary, .ledger { min-width: 0; }
.diary .label-title { margin-left: 0; }
.diary-list { margin: 0; padding: 0; list-style: none; counter-reset: none; }
.diary-entry {
    display: flex;
    align-items: stretch;
    margin: 0 0 .9rem;
    background: var(--paper);
    border: 1px solid var(--paper-line);
    box-shadow: 3px 4px 0 -1px var(--paper-under), 3px 4px 0 0 var(--paper-under-edge);
    color: var(--ink);
}
.diary-entry:nth-child(even) { margin-left: .9rem; margin-right: -.4rem; }
.diary-num {
    flex: 0 0 2.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--copper);
    font-family: var(--head);
    font-size: 1.15rem;
    font-weight: 500;
}
.diary-entry p { margin: 0; padding: .7rem .95rem; font-size: .9rem; line-height: 1.4; min-width: 0; }

.ledger { padding-top: 1.6rem; }
.ledger-sheet {
    position: relative;
    padding: 0 2.1rem 1.8rem;
    background: var(--paper);
    border: 1px solid var(--paper-line);
    box-shadow: var(--stack);
    color: var(--ink);
}
.ledger-sheet .label-title { position: relative; top: -1.6rem; margin-bottom: .4rem; }
.ledger-table {
    width: 100%;
    border-collapse: collapse;
    border-top: 2px solid var(--copper);
    border-bottom: 2px solid var(--copper);
    font-size: .98rem;
}
.ledger-table caption {
    caption-side: bottom;
    padding-top: .7rem;
    font-size: .82rem;
    font-style: italic;
    text-align: left;
    color: var(--muted);
}
.ledger-table th, .ledger-table td {
    padding: .62rem .6rem;
    border-bottom: 1px solid var(--copper);
    text-align: left;
    vertical-align: top;
}
.ledger-table thead th {
    font-family: var(--head);
    font-size: .82rem;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 2px solid var(--copper);
}
.ledger-table tbody th { font-weight: 400; color: var(--ink); white-space: nowrap; }
.ledger-table td { color: #4A4236; font-size: .9rem; }
.ledger-table .num { text-align: right; font-size: 1.05rem; color: var(--muted); white-space: nowrap; }
.ledger-table tbody tr:hover { background: rgba(169, 126, 75, .1); }
.ledger-more { margin: 1.4rem 0 0; text-align: right; }

/* ---------- Внутренние страницы ---------- */
.inner { padding: 2rem 0 4rem; }
.crumbs { margin: 0 0 1.8rem; font-size: .9rem; color: var(--on-felt-muted); }
.crumbs a { color: var(--copper-light); }
.crumbs-sep { margin: 0 .35rem; color: var(--copper); }
.crumbs-current { color: var(--paper); }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    column-gap: 6%;
    align-items: start;
}
.layout-single { display: block; }
.content-area { min-width: 0; }
.page-head { margin-bottom: 2rem; }
.page-head .label-title--page { margin: 0 0 1rem; }
.page-intro { max-width: 70ch; color: var(--on-felt-muted); }
.empty-note { color: var(--on-felt); }
.empty-sheet { padding: 1.8rem 2rem; background: var(--paper); border: 1px solid var(--paper-line); color: var(--ink); }
.empty-sheet .empty-note { color: var(--ink); }

.sheet {
    position: relative;
    padding: clamp(1.4rem, 4vw, 3rem);
    background: var(--paper);
    border: 1px solid var(--paper-line);
    box-shadow: var(--stack);
    color: var(--ink);
}
.entry-head { margin-bottom: 1.6rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--copper); }
.entry-tab {
    display: inline-block;
    margin-bottom: .9rem;
    padding: .2em .85em .24em;
    background: var(--dust);
    border: 1px solid var(--dust-dark);
    color: var(--paper);
    font-family: var(--head);
    font-size: .82rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none;
}
.entry-tab:hover { background: var(--dust-dark); color: var(--paper); }
.entry-title {
    margin: 0 0 .5rem;
    font-family: var(--head);
    font-size: clamp(1.7rem, 3.4vw, 2.6rem);
    font-weight: 500;
    line-height: 1.15;
    color: var(--ink);
}
.entry-meta { margin: 0; font-size: .9rem; color: var(--muted); }
.entry-figure { margin: 0 0 1.8rem; border: 1px solid #8C7F68; }
.entry-figure img { width: 100%; height: auto; }

.entry-content { font-size: 1.05rem; line-height: 1.7; }
.entry-content > *:last-child { margin-bottom: 0; }
.entry-content p { margin: 0 0 1.1em; }
.entry-content a { color: var(--brick); text-decoration-color: var(--copper); }
.entry-content a:hover { color: var(--brick-dark); }
.entry-content h2, .entry-content h3, .entry-content h4 { font-family: var(--head); color: var(--ink); margin: 1.8em 0 .6em; }
.entry-content h2 {
    padding-bottom: .3rem;
    font-size: 1.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .02em;
    border-bottom: 1px solid var(--copper);
}
.entry-content h3 { font-size: 1.3rem; font-weight: 500; }
.entry-content h4 { font-size: 1.1rem; font-weight: 500; }
.entry-content ul, .entry-content ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.entry-content li { margin-bottom: .35em; }
.entry-content ul { list-style: none; padding-left: 1.3em; }
.entry-content ul > li { position: relative; }
.entry-content ul > li::before {
    content: "";
    position: absolute;
    left: -1.1em; top: .62em;
    width: 7px; height: 7px;
    background: var(--copper);
}
.entry-content ol > li::marker { color: var(--brick); font-family: var(--head); }
.entry-content blockquote {
    margin: 1.6em 0;
    padding: 1.1rem 1.5rem;
    background: #E9DFCA;
    border-left: 4px solid var(--brick);
    font-style: italic;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content blockquote cite { display: block; margin-top: .5rem; font-size: .9rem; color: var(--muted); }
.entry-content table { width: 100%; margin: 0 0 1.4em; border-collapse: collapse; border: 1px solid var(--paper-under-edge); font-size: .95rem; }
.entry-content th, .entry-content td { padding: .55rem .75rem; border: 1px solid var(--paper-under-edge); text-align: left; vertical-align: top; }
.entry-content th { background: var(--sheet); font-weight: 700; }
.entry-content img { height: auto; }
.entry-content figure { margin: 0 0 1.4em; }
.entry-content figcaption { margin-top: .4rem; font-size: .85rem; color: var(--muted); }
.entry-content pre { overflow-x: auto; padding: 1rem; background: #E9DFCA; border: 1px solid var(--paper-line); font-size: .9rem; }
.entry-content code { font-size: .92em; background: #E9DFCA; padding: .05em .3em; }
.entry-content hr { border: 0; border-top: 1px solid var(--copper); margin: 2em 0; }
.alignleft { float: left; margin: .3em 1.4em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.4em; }
.aligncenter { margin-inline: auto; }
.wp-caption-text, .gallery-caption { font-size: .85rem; color: var(--muted); }
.page-links { margin-top: 1.4rem; font-family: var(--head); }

.entry-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.8rem 0 0; }
.entry-tags a {
    padding: .2em .7em;
    border: 1px solid var(--copper);
    color: var(--ink);
    font-size: .85rem;
    text-decoration: none;
}
.entry-tags a:hover { background: var(--dust); border-color: var(--dust-dark); color: var(--paper); }

.entry-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.2rem;
    margin: 2.4rem 0 0;
}
.entry-nav-link {
    display: block;
    padding: 1rem 1.2rem;
    background: var(--paper);
    border: 1px solid var(--paper-line);
    color: var(--ink);
    text-decoration: none;
    transition: transform .1s ease;
}
.entry-nav-link span { display: block; margin-bottom: .25rem; font-family: var(--head); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brick); }
.entry-nav-link:hover { color: var(--ink); transform: translate(2px, 2px); }
.entry-nav-link--next { grid-column: 2; text-align: right; }

/* ---------- Сайдбар ---------- */
.sidebar { min-width: 0; padding-top: 1rem; }
.sidebar .widget {
    margin: 0 0 2.4rem;
    padding: 1.6rem 1.4rem 1.3rem;
    background: var(--paper);
    border: 1px solid var(--paper-line);
    box-shadow: 3px 4px 0 -1px var(--paper-under), 3px 4px 0 0 var(--paper-under-edge);
    color: var(--ink);
    font-size: .95rem;
}
.sidebar .widget-title {
    display: inline-block;
    margin: -2.5rem 0 1rem;
    padding: .25em .85em .28em;
    background: var(--dust);
    border: 1px solid var(--dust-dark);
    color: var(--paper);
    font-family: var(--head);
    font-size: .92rem;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.sidebar .widget a { color: var(--ink); text-decoration-color: var(--copper); }
.sidebar .widget a:hover { color: var(--brick); }
.sidebar .widget ul { margin: 0; padding: 0; list-style: none; }
.sidebar .widget li { padding: .55rem 0; border-bottom: 1px dashed var(--paper-line); line-height: 1.4; }
.sidebar .widget li:last-child { border-bottom: 0; }
.sidebar .widget .post-date, .sidebar .widget .wp-block-latest-posts__post-date { display: block; font-size: .82rem; color: var(--muted); }
.sidebar .widget p { color: var(--ink); }
.sidebar .widget select { width: 100%; padding: .45rem; background: #FBF6EA; border: 1px solid var(--muted); color: var(--ink); }

/* ---------- Подвал ---------- */
.colophon {
    background: var(--felt-deep) url("images/felt-dark.jpg") repeat;
    background-size: 512px auto;
    border-top: 2px solid var(--copper);
    box-shadow: inset 0 4px 0 -2px var(--felt-deep), inset 0 5px 0 -2px rgba(169, 126, 75, .55);
    color: #D8CDB5;
    padding: 3rem 0 1.5rem;
}
.colophon-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
}
.colophon-col { min-width: 0; }
.colophon .widget { margin-bottom: 1.4rem; font-size: .95rem; color: #D8CDB5; }
.colophon .widget-title {
    margin: 0 0 .8rem;
    font-family: var(--text);
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--paper);
}
.colophon .widget p, .colophon .widget .textwidget { color: #D8CDB5; }
.colophon .widget a { color: #E6DCC6; text-decoration: underline; text-decoration-color: var(--copper); }
.colophon .widget a:hover { color: var(--copper-light); }
.colophon .widget ul { margin: 0; padding: 0; list-style: none; }
.colophon .widget li { margin-bottom: .45rem; }
.colophon .widget .post-date { display: block; font-size: .8rem; color: #B8AD95; }
.colophon-copy {
    margin: 2rem 0 0;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(169, 126, 75, .45);
    font-size: .85rem;
    text-align: center;
    color: #B8AD95;
}

/* ---------- Пагинация ---------- */
.pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
    margin: 2.8rem 0 0;
}
.pager .page-numbers {
    display: inline-block;
    min-width: 2.6rem;
    padding: .42em .8em;
    background: var(--paper);
    border: 1px solid var(--copper);
    color: var(--ink);
    font-family: var(--head);
    font-size: .98rem;
    text-align: center;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}
.pager a.page-numbers:hover, .pager a.page-numbers:focus-visible { background: var(--dust); border-color: var(--dust-dark); color: var(--paper); }
.pager .page-numbers.current { background: var(--brick); border-color: var(--brick-dark); color: #FFF8EE; }
.pager .page-numbers.dots { min-width: 0; background: transparent; border: 0; color: var(--on-felt); }

/* ---------- Поиск ---------- */
.find { display: flex; gap: .5rem; max-width: 520px; margin: 0 0 1rem; }
.find-field {
    flex: 1;
    min-width: 0;
    padding: .55em .8em;
    background: #FBF6EA;
    border: 1px solid var(--muted);
    border-radius: 0;
    color: var(--ink);
    font-family: var(--text);
    font-size: 1rem;
}
.find-btn { font-size: 1rem; }

/* ---------- Комментарии ---------- */
.comments { margin-top: 2.6rem; }
.comments-title, .comment-reply-title {
    margin: 0 0 1.2rem;
    font-family: var(--head);
    font-size: 1.4rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--ink);
}
.comment-reply-title small { margin-left: .8rem; font-family: var(--text); font-size: .85rem; text-transform: none; letter-spacing: 0; }
.comment-reply-title small a { color: var(--brick); }
.notes, .notes .children { margin: 0 0 2rem; padding: 0; list-style: none; }
.notes .children { margin: 1rem 0 0 1.8rem; padding-left: 1rem; border-left: 1px solid var(--copper); }
.note { margin-bottom: 1rem; }
.note-body { padding: 1rem 1.2rem; background: #FBF6EA; border: 1px solid var(--paper-line); }
.note-head { display: flex; align-items: center; gap: .8rem; margin-bottom: .6rem; }
.note-head img { width: 44px; height: 44px; border: 1px solid var(--paper-line); }
.note-author { display: block; font-weight: 700; }
.note-date { font-size: .82rem; color: var(--muted); }
.note-wait { font-style: italic; color: var(--brick); }
.note-text p { margin-bottom: .6em; }
.note-reply a { font-size: .85rem; color: var(--brick); }
.comment-respond label { display: block; margin-bottom: .3rem; font-size: .92rem; }
.comment-respond input[type="text"], .comment-respond input[type="email"], .comment-respond input[type="url"], .comment-respond textarea {
    width: 100%;
    padding: .55em .75em;
    background: #FBF6EA;
    border: 1px solid var(--muted);
    border-radius: 0;
    color: var(--ink);
    font-family: var(--text);
    font-size: 1rem;
}
.comment-form-cookies-consent { display: flex; align-items: flex-start; gap: .5rem; }
.comment-form-cookies-consent label { display: inline; }
.comment-notes, .logged-in-as, .must-log-in, .comments-closed { font-size: .9rem; color: var(--muted); }
.comment-respond .req { color: var(--brick); }
.form-submit .tag-btn { font-size: 1rem; }

/* ---------- 404 ---------- */
.lost { text-align: left; }
.stamp--big { margin-bottom: 1.4rem; font-size: clamp(2.6rem, 6vw, 4rem); border-width: 6px; }
.lost-home { margin: 1.4rem 0 0; }

/* ---------- Cookie-баннер ---------- */
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 1rem;
    z-index: 90;
    width: min(92%, 860px);
    margin: 0 auto;
    padding: 1rem 1.4rem;
    background: var(--paper);
    border: 2px solid var(--copper);
    outline: 1px solid var(--copper);
    outline-offset: -6px;
    color: var(--ink);
}
.cookie-inner { display: flex; align-items: center; gap: 1.2rem; }
.cookie-text { flex: 1; min-width: 0; margin: 0; font-size: .9rem; line-height: 1.45; }

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
    .anatomy { column-gap: 2.2rem; }
    .callout::before { width: 3.6rem; }
    .callouts--left .callout::before { right: -3.8rem; }
    .callouts--left .callout::after { right: -4.05rem; }
    .callouts--right .callout::before { left: -3.8rem; }
    .callouts--right .callout::after { left: -4.05rem; }
    .anatomy-art { opacity: .55; }
}

@media (max-width: 960px) {
    .masthead-row { flex-wrap: wrap; }
    .nav-toggle { display: inline-flex; }
    .site-nav { display: none; width: 100%; }
    .site-nav.is-open { display: block; }
    .site-nav .nav-list { flex-direction: column; gap: 0; padding: .4rem 0 .6rem; border-top: 1px solid rgba(169, 126, 75, .5); }
    .site-nav li { border-bottom: 1px solid rgba(169, 126, 75, .25); }
    .site-nav a { display: block; padding: .7rem 0; }

    .rubrics { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 3.2rem; }
    .rubric { margin-inline: .4rem; }

    .zone-anatomy { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; }
    .zone-anatomy .shell { order: 0; flex: 0 0 auto; }
    .anatomy-art {
        position: static;
        order: 1;
        transform: none;
        width: 32%;
        max-width: 190px;
        margin-top: 2rem;
        opacity: 1;
    }
    .anatomy-art--right { width: 30%; max-width: 176px; }
    .anatomy { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: 2rem; column-gap: 1.6rem; max-width: 640px; }
    .specimen { grid-column: 1 / -1; grid-row: 1; }
    .callouts { gap: 1.6rem; padding-top: 0; text-align: left; }
    .callouts--left, .callouts--right { text-align: left; padding-top: 0; }
    .callout { padding-left: 1rem; border-left: 1px solid var(--copper); }
    .callout::before, .callout::after { display: none; }

    .cards--front { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pair { grid-template-columns: minmax(0, 1fr); gap: 2.4rem; }

    .layout-with-sidebar { display: block; }
    .sidebar { padding-top: 3rem; }
    .colophon-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    body { font-size: 1rem; }
    .shell { width: 92%; }
    .zone { padding: 2.6rem 0; }
    .masthead-row { padding: 1rem 0; gap: 1rem; }
    .brand { gap: .8rem; }
    .brand-svg { width: 36px; height: 48px; }
    .brand-mark { width: 36px; }
    .brand-desc { display: block; font-size: .76rem; }
    .label-title { margin-bottom: 2rem; }

    .rubrics { grid-template-columns: minmax(0, 1fr); row-gap: 2.8rem; padding-inline: .4rem; }
    .rubric, .rubric:nth-child(odd), .rubric:nth-child(even) { margin-inline: 0; transform: none; }
    .rubric-link { padding: 2.2rem 1.2rem 1.5rem; }

    .anatomy { grid-template-columns: minmax(0, 1fr); }
    .specimen-sheet { padding: 1.6rem 1.3rem 2.6rem; }

    .cards--front, .cards--list { grid-template-columns: minmax(0, 1fr); }
    .card { padding: 1rem 1rem .9rem; }
    .cards--front .card:nth-child(n) { transform: none; }
    .card-thumb, .cards--list .card-thumb { flex-basis: 84px; }
    .card-thumb img, .cards--list .card-thumb img { width: 84px; height: 84px; }

    .diary-entry:nth-child(even) { margin-left: .5rem; margin-right: 0; }
    .ledger-sheet { padding: 0 1.1rem 1.4rem; }
    .ledger-table thead th:nth-child(2), .ledger-table td:nth-child(2) { display: none; }
    .ledger-table tbody th { white-space: normal; }

    .sheet { padding: 1.4rem 1.2rem; }
    .entry-nav { grid-template-columns: minmax(0, 1fr); }
    .entry-nav-link--next { grid-column: auto; }
    .alignleft, .alignright { float: none; margin: 0 0 1em; }

    .colophon-cols { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
    .cookie-inner { flex-direction: column; align-items: flex-start; gap: .8rem; }
    .cookie-banner { padding: 1rem 1.1rem; }
    .find { flex-wrap: wrap; }
    .find-field { flex-basis: 100%; }
}

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

/* Главная: закреплённая запись может добавить карточку сверх лимита — держим ряд из трёх */
.cards--front .card:nth-child(n+4) { display: none; }
.ledger-table thead th.num { font-size: .82rem; color: var(--muted); }
