/*
Theme Name: dds_sucatotradingcostarica.com
Theme URI: https://sucatotradingcostarica.com/
Author: Алексей Воронов
Description: Тема информационного портала о российской ипотеке в стилистике канцелярского досье: бланки, штампы, картотека и разлинованные листы.
Version: 1.1
Requires at least: 6.0
Tested up to: 6.6
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: ipodos
*/

/* ---------- Шрифты ---------- */
@font-face { font-family: "Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Mono"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-cyrillic-400-italic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Plex Mono"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-mono-cyrillic-600-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/ibm-plex-mono-cyrillic-700-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Plex Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/ibm-plex-mono-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Переменные ---------- */
:root {
    --paper: #EDE6D6;
    --sheet: #F4EEE1;
    --sheet-2: #F7F3EA;
    --kraft: #E7D6BD;
    --kraft-deep: #D9C4A3;
    --card: #EADCC6;
    --ink: #12263A;
    --ink-2: #1B3450;
    --muted: #6B6A63;
    --line: #8A8578;
    --blank: #C9D6DF;
    --blank-soft: #DCE5EB;
    --red: #B23A2E;
    --green: #2F6B5E;
    --on-ink: #EDE6D6;
    --on-ink-muted: #B9BFC4;
    --font: "Plex Mono", "IBM Plex Mono", "PT Mono", "Courier New", Consolas, monospace;
    --grid: 22px;
}

/* ---------- Управление атрибутом hidden ---------- */
.cookie-banner[hidden] { display: none !important; }
[hidden] { display: none !important; }

/* ---------- Сброс и база ---------- */
*, *::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; } }

body {
    margin: 0;
    overflow-x: hidden;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.7;
    color: var(--ink);
    background-color: var(--paper);
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .27 .14 0 0 0 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
        linear-gradient(rgba(138, 133, 120, .17) 1px, transparent 1px),
        linear-gradient(90deg, rgba(138, 133, 120, .17) 1px, transparent 1px);
    background-size: 220px 220px, var(--grid) var(--grid), var(--grid) var(--grid);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--line); transition: color .15s, text-decoration-color .15s; }
a:hover { color: var(--red); text-decoration-color: var(--red); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px dashed var(--red); outline-offset: 3px; }

h1, h2, h3, h4, h5, h6 { font-family: var(--font); font-weight: 700; line-height: 1.25; margin: 1.6em 0 .6em; color: var(--ink); }
h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.85rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.1em; padding-left: 1.4em; }
li { margin-bottom: .35em; }
hr { border: 0; border-top: 1px dashed var(--line); margin: 2rem 0; }

p, li, h1, h2, h3, h4, td, th, .card-title, .brand-name, .widget { overflow-wrap: break-word; hyphens: auto; }

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -60px; z-index: 100; background: var(--red); color: #fff; padding: .6rem 1rem; text-decoration: none; }
.skip-link:focus { top: 1rem; color: #fff; }

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

/* ---------- Кнопки-штампы ---------- */
.stamp-btn {
    display: inline-block;
    font-family: var(--font);
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink);
    background: transparent;
    border: 3px solid var(--ink);
    outline: 1px solid var(--ink);
    outline-offset: 3px;
    padding: .6rem 1.3rem;
    transform: rotate(-2deg);
    cursor: pointer;
    transition: background .15s, color .15s, transform .15s;
    white-space: normal;
    text-align: center;
}
.stamp-btn:hover { background: var(--ink); color: var(--on-ink); transform: rotate(0) translateY(-1px); }
.stamp-btn:active { transform: rotate(0) translateY(1px); }
.stamp-btn--small { font-size: .74rem; padding: .45rem .9rem; border-width: 2px; outline-offset: 2px; }
.stamp-btn--light { color: var(--on-ink); border-color: var(--on-ink); outline-color: var(--on-ink); }
.stamp-btn--light:hover { background: var(--on-ink); color: var(--ink); }

/* ---------- Печати ---------- */
.stamp {
    display: inline-block;
    font-family: var(--font);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    line-height: 1.1;
    padding: .35rem .8rem;
    border: 3px solid currentColor;
    outline: 1.5px solid currentColor;
    outline-offset: -7px;
    transform: rotate(-9deg);
    opacity: .88;
    mix-blend-mode: multiply;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.4 2.15'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.4 2.15'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)'/%3E%3C/svg%3E");
    pointer-events: none;
}
.stamp--red { color: var(--red); }
.stamp--green { color: var(--green); }
.stamp--big { font-size: clamp(1.5rem, 3.4vw, 2.6rem); padding: .4rem 1.1rem; border-width: 5px; outline-offset: -10px; outline-width: 2px; }
.stamp--link { pointer-events: auto; font-size: .72rem; transform: rotate(-3deg); text-decoration: none; padding: .3rem .7rem; outline-offset: -5px; border-width: 2px; }
.stamp--link:hover { color: var(--ink); }

/* ---------- Скрепка ---------- */
.clip {
    position: absolute;
    width: 26px;
    height: 70px;
    z-index: 3;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 70'%3E%3Cpath d='M8 20V9a5 5 0 0 1 10 0v42a8 8 0 0 1-16 0V14' fill='none' stroke='%237C8086' stroke-width='2.6' stroke-linecap='round'/%3E%3Cpath d='M9 21V9.5a4 4 0 0 1 8 0' fill='none' stroke='%23D7DADD' stroke-width='1' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / contain;
    filter: drop-shadow(1px 2px 1px rgba(18, 38, 58, .25));
}

/* ---------- Шапка ---------- */
.masthead {
    background: var(--ink);
    color: var(--on-ink);
    border-bottom: 4px solid var(--ink-2);
    box-shadow: inset 0 -1px 0 rgba(237, 230, 214, .15);
}
.masthead-row { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem 2rem; padding: 1.4rem 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 1rem; color: var(--on-ink); text-decoration: none; min-width: 0; flex: 1 1 420px; max-width: 700px; }
.brand:hover { color: #fff; }
.brand-mark { flex: 0 0 auto; color: var(--on-ink); }
.brand-seal { width: 64px; height: 64px; display: block; }
.brand-logo { width: 64px; height: 64px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { hyphens: manual; font-weight: 700; font-size: clamp(1rem, 1.55vw, 1.28rem); line-height: 1.3; letter-spacing: .01em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.brand-desc { margin-top: .35rem; font-size: .74rem; line-height: 1.5; color: var(--on-ink-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.topnav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem 1.8rem; }
.topnav-list li { margin: 0; }
.topnav-list a { color: var(--on-ink); text-decoration: none; font-size: .95rem; padding: .3rem 0; border-bottom: 1px solid transparent; display: inline-block; }
.topnav-list a:hover, .topnav-list .current-menu-item > a { border-bottom-color: var(--on-ink); color: #fff; }

.menu-toggle { display: none; align-items: center; gap: .6rem; background: transparent; color: var(--on-ink); border: 2px solid var(--on-ink); font-family: var(--font); font-size: .85rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: .45rem .8rem; cursor: pointer; }
.menu-toggle-bars { width: 18px; height: 12px; background: linear-gradient(var(--on-ink) 0 0) top / 100% 2px no-repeat, linear-gradient(var(--on-ink) 0 0) center / 100% 2px no-repeat, linear-gradient(var(--on-ink) 0 0) bottom / 100% 2px no-repeat; }

/* ---------- Заголовки секций ---------- */
.sec-title {
    margin: 0;
    font-size: clamp(1.3rem, 2.6vw, 2.05rem);
    text-transform: uppercase;
    letter-spacing: .03em;
    line-height: 1.2;
}
.sec-num { color: var(--ink); }
.dossier-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: .5rem 1.5rem;
    flex-wrap: wrap;
    padding-bottom: .55rem;
    border-bottom: 2px solid var(--ink);
    margin-bottom: 1.4rem;
}
.dossier-head--plain { border-bottom: 0; padding-bottom: 0; }
.dossier-head--plain .sec-title { border-bottom: 2px solid var(--ink); padding-bottom: .25rem; }
.dossier-ref { font-size: .82rem; color: var(--ink); white-space: nowrap; border-bottom: 1px solid var(--line); }
.link-line { text-decoration: none; }

/* ---------- Главная ---------- */
.front { width: min(85%, 1180px); padding: 2.6rem 0 3.5rem; }
.front > section { margin-bottom: 3.6rem; position: relative; isolation: isolate; }

.dossier {
    position: relative;
    background: var(--sheet);
    border: 1px solid rgba(138, 133, 120, .55);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 3px 0 -1px #E2D7C2, 0 4px 0 -1px rgba(138, 133, 120, .45);
    padding: 2rem 2.4rem 1.6rem;
}
.dossier-lead { color: var(--muted); font-size: .88rem; max-width: 70ch; }

/* таблица-бланк */
.ledger-wrap { position: relative; overflow-x: auto; }
.ledger { hyphens: manual; width: 100%; min-width: 720px; border-collapse: collapse; font-size: .84rem; line-height: 1.45; background: var(--sheet-2); border: 2px solid var(--ink); }
.ledger th, .ledger td { border: 1px solid var(--ink); padding: .6rem .75rem; vertical-align: top; text-align: left; }
.ledger thead th { background: var(--blank); font-weight: 600; text-align: center; vertical-align: middle; font-size: .88rem; }
.ledger tbody th { background: var(--blank-soft); font-weight: 600; width: 19%; }
.ledger tbody td:nth-child(4) { text-align: center; white-space: nowrap; }
.ledger tbody tr:hover td { background: rgba(201, 214, 223, .25); }
.ledger-stamp { position: absolute; left: 44%; top: 34%; transform: rotate(-13deg); }
.dossier-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; flex-wrap: wrap; margin-top: 1.1rem; font-size: .8rem; color: var(--muted); }
.foot-field { border-bottom: 1px solid var(--line); padding-bottom: .2rem; max-width: 62ch; }
.foot-sign { display: inline-flex; align-items: flex-end; gap: .5rem; white-space: nowrap; }
.foot-sign img { width: 120px; height: auto; margin-bottom: -6px; }

/* чек-лист на крафте */
.dossier--kraft {
    background: var(--kraft);
    border-color: rgba(138, 133, 120, .6);
    box-shadow: 6px 6px 0 -1px var(--kraft-deep), 6px 6px 0 0 rgba(138, 133, 120, .55);
    padding: 2rem 17rem 2.2rem 2.4rem;
}
.checksheet { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.6rem; }
.checksheet li { align-content: start; display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: .9rem; padding: .85rem 0; margin: 0; border-bottom: 1.5px dashed var(--line); }
.check-box { grid-row: span 2; width: 30px; height: 30px; border: 3px solid var(--ink); position: relative; margin-top: .1rem; background: rgba(255, 255, 255, .25); }
.check-box::after { content: ""; position: absolute; left: 8px; top: -8px; width: 13px; height: 26px; border-right: 4px solid var(--ink); border-bottom: 4px solid var(--ink); transform: rotate(40deg); }
.check-name { font-size: 1.22rem; font-weight: 600; line-height: 1.3; }
.check-note { font-size: .8rem; color: #55544E; line-height: 1.55; margin-top: .2rem; }
.memo {
    position: absolute;
    right: 1.6rem;
    top: 1.4rem;
    width: 13.5rem;
    padding: 2.1rem 1.1rem 1.1rem;
    background-color: #F6F3EC;
    background-image: repeating-linear-gradient(transparent 0 21px, rgba(110, 150, 178, .45) 21px 22px);
    background-position: 0 14px;
    border: 1px solid rgba(138, 133, 120, .45);
    box-shadow: 2px 3px 0 rgba(138, 133, 120, .35);
    transform: rotate(4deg);
    z-index: 2;
    clip-path: polygon(0 0, 100% 0, 100% 86%, 88% 100%, 0 100%);
}
.memo-label { display: inline-block; font-size: 1.2rem; font-weight: 700; text-transform: lowercase; border-bottom: 2px solid var(--red); line-height: 1.1; margin-bottom: .55rem; }
.memo p { font-size: .76rem; line-height: 22px; margin: 0; color: var(--ink); }
.clip--note { right: 9.4rem; top: -1.4rem; transform: rotate(-12deg); }

/* последние записи */
.card-grid { display: grid; gap: 2rem 1.6rem; }
.card-grid--drawer { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-grid--drawer .card:nth-child(3n+1) { transform: rotate(-.8deg); }
.card-grid--drawer .card:nth-child(3n+2) { transform: rotate(.6deg) translateY(6px); }
.card-grid--drawer .card:nth-child(3n) { transform: rotate(-.4deg); }
.card-grid--drawer .card:nth-child(n+4) { display: none; }
.card-grid--list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }

.card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: var(--card);
    background-image: linear-gradient(rgba(138, 133, 120, .28) 1px, transparent 1px);
    background-size: 100% 26px;
    border: 1px solid rgba(138, 133, 120, .8);
    border-top: 0;
    overflow: hidden;
    transition: transform .2s;
}
.card-grid .card:hover { transform: rotate(0) translateY(-6px); }
.card-tab { display: flex; justify-content: space-between; gap: .8rem; align-items: center; padding: .5rem .9rem; background: var(--ink); color: var(--on-ink); font-size: .74rem; letter-spacing: .04em; }
.card-num { white-space: nowrap; }
.card-date { white-space: nowrap; color: var(--on-ink-muted); }
.card-photo { position: relative; margin: 1rem 18% 0 1rem; padding: 7px 7px 7px; background: #FBFAF6; box-shadow: 0 1px 3px rgba(18, 38, 58, .2); transform: rotate(-1deg); }
.card-photo a { display: block; }
.card-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; filter: grayscale(.25) sepia(.12); }
.card-stamp { position: absolute; right: -22%; top: 10px; color: var(--red); background: rgba(244, 238, 225, .78); font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: .25rem .5rem; border: 2px solid currentColor; outline: 1px solid currentColor; outline-offset: -5px; transform: rotate(7deg); max-width: 75%; }
.card-body { flex: 1; display: flex; flex-direction: column; padding: 1rem 1.1rem 1.2rem; min-width: 0; }
.card-title { font-size: 1.02rem; line-height: 1.4; margin: 0 0 .55rem; }
.card-title a { text-decoration: none; color: var(--ink); }
.card-title a:hover { color: var(--red); }
.card-excerpt { font-size: .8rem; line-height: 1.7; color: #4D4C46; flex: 1; }
.card-excerpt p { margin: 0 0 .5em; background: none; }
.card-foot { padding-top: .9rem; }
.empty-note { padding: 1.4rem 1.6rem; background: var(--sheet); border: 1px dashed var(--line); color: var(--muted); }

/* путь от заявки */
.route-sheet {
    position: relative;
    background-color: var(--sheet-2);
    background-image:
        linear-gradient(90deg, transparent 54px, rgba(178, 58, 46, .55) 54px 56px, transparent 56px),
        repeating-linear-gradient(transparent 0 27px, rgba(110, 150, 178, .4) 27px 28px);
    border: 1px solid rgba(138, 133, 120, .55);
    box-shadow: 0 3px 0 -1px #E2D7C2, 0 4px 0 -1px rgba(138, 133, 120, .45);
    padding: 3.4rem 2.4rem 3.4rem 4.6rem;
    overflow: hidden;
}
.route-line { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1rem; position: relative; transform: rotate(-2.4deg); }
.route-line::before { content: ""; position: absolute; left: 6%; right: 6%; top: 34px; border-top: 2px solid var(--line); }
.route-line li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; margin: 0; min-width: 0; }
.route-line li:nth-child(even) { transform: translateY(14px); }
.route-dot { position: relative; z-index: 1; width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; font-size: 1.9rem; font-weight: 700; color: var(--ink); background: var(--sheet-2); border: 3px solid var(--ink); box-shadow: 0 0 0 4px var(--sheet-2), 0 0 0 5.5px var(--line); }
.route-line li:last-child .route-dot { color: var(--green); border-color: var(--green); }
.route-name { margin-top: 1rem; font-weight: 700; font-size: .95rem; line-height: 1.3; }
.route-note { margin-top: .35rem; font-size: .74rem; line-height: 1.5; color: var(--muted); }

/* разбор программы */
.spread { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--sheet); border: 1px solid rgba(138, 133, 120, .6); }
.spread::before { content: ""; position: absolute; inset: -10px -8px 6px -6px; background: var(--kraft-deep); border: 1px solid rgba(138, 133, 120, .6); transform: rotate(-.8deg); z-index: -1; }
.spread::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1.5px dashed var(--line); }
.spread-page { position: relative; padding: 2rem 2.2rem; min-width: 0; }
.spread-frame { position: relative; border: 2px solid var(--ink); outline: 1px solid var(--ink); outline-offset: -7px; padding: 1.6rem 1.6rem 4.6rem; height: 100%; }
.spread-ref { display: block; text-align: right; font-size: .76rem; border-bottom: 1px solid var(--line); margin-left: auto; width: max-content; max-width: 100%; }
.spread-title { font-size: clamp(1.5rem, 2.8vw, 2.2rem); margin: .9rem 0 .2rem; padding-bottom: .4rem; border-bottom: 2px solid var(--ink); }
.spread-sub { font-size: .8rem; color: var(--muted); margin-bottom: 1.1rem; }
.clauses { list-style: none; padding: 0; margin: 0; }
.clauses li { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); font-size: .82rem; line-height: 1.55; border-bottom: 1px solid rgba(138, 133, 120, .5); margin: 0; }
.clause-no { white-space: nowrap; font-weight: 700; padding: .45rem .5rem .45rem 0; border-right: 1px solid var(--line); margin-right: .7rem; color: var(--red); }
.clauses li > span:last-child { padding: .45rem 0; }
.spread-stamp-left { position: absolute; left: 1.4rem; bottom: 1.1rem; font-size: 1.35rem; transform: rotate(-10deg); }
.spread-stamp-right { position: absolute; right: 1.6rem; top: 1.4rem; font-size: 1.5rem; transform: rotate(6deg); }
.spread-page--right { padding-top: 5.4rem; }
.ruled { font-size: .86rem; line-height: 28px; background-image: repeating-linear-gradient(transparent 0 27px, rgba(138, 133, 120, .55) 27px 28px); margin-bottom: 1.4rem; }
.spread-sign { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; margin-top: 1.6rem; }
.sign-block { display: inline-flex; flex-direction: column; align-items: center; }
.sign-block img { width: 150px; }
.sign-caption { font-size: .7rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: .15rem; font-style: italic; }
.clip--spread { left: 3.4rem; top: -1.6rem; transform: rotate(8deg); }

/* ---------- Внутренние страницы ---------- */
.inner { padding: 1.8rem 0 3.5rem; }
.crumbs { font-size: .8rem; color: var(--muted); margin-bottom: 1.6rem; padding: .5rem .9rem; background: var(--sheet); border: 1px solid rgba(138, 133, 120, .5); display: inline-block; max-width: 100%; }
.crumbs a { color: var(--ink); }
.crumbs-sep { color: var(--red); margin: 0 .25rem; }
.crumbs-current { color: var(--muted); }

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

.page-head { margin-bottom: 1.6rem; }
.page-title { margin: 0; font-size: clamp(1.5rem, 3vw, 2.2rem); text-transform: uppercase; letter-spacing: .03em; border-bottom: 2px solid var(--ink); padding-bottom: .35rem; }
.page-intro { margin-top: 1rem; color: var(--muted); font-size: .9rem; }

.sheet { position: relative; background: var(--sheet); border: 1px solid rgba(138, 133, 120, .55); box-shadow: 0 3px 0 -1px #E2D7C2, 0 4px 0 -1px rgba(138, 133, 120, .45); padding: 2.2rem 2.4rem; }
.sheet-head { margin-bottom: 1.6rem; }
.sheet-meta { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .76rem; color: var(--muted); border-bottom: 1px dashed var(--line); padding-bottom: .45rem; margin-bottom: 1rem; }
.sheet-title { margin: 0; font-size: clamp(1.45rem, 3vw, 2.15rem); line-height: 1.25; }
.sheet-cats { display: flex; flex-wrap: wrap; gap: .6rem 1rem; margin-top: 1rem; }
.sheet-photo { margin: 0 0 1.8rem; padding: 8px; background: #FBFAF6; box-shadow: 0 1px 3px rgba(18, 38, 58, .2); }
.sheet-photo img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.sheet-tags { margin-top: 2rem; padding-top: 1rem; border-top: 1px dashed var(--line); font-size: .82rem; display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.sheet-tags-label { color: var(--muted); }

.entry-content { font-size: .95rem; line-height: 1.8; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content h2 { font-size: 1.4rem; border-bottom: 1.5px solid var(--ink); padding-bottom: .25rem; }
.entry-content h3 { font-size: 1.15rem; }
.entry-content ul { list-style: none; padding-left: 1.6em; }
.entry-content ul li { position: relative; }
.entry-content ul li::before { content: ""; position: absolute; left: -1.3em; top: .55em; width: .62em; height: .62em; border: 2px solid var(--ink); }
.entry-content ol li::marker { font-weight: 700; color: var(--red); }
.entry-content blockquote { margin: 1.8rem 0; padding: 1.3rem 1.6rem 1.3rem 1.8rem; background: var(--kraft); border-left: 5px solid var(--red); font-style: italic; }
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.6rem 0; font-size: .85rem; background: var(--sheet-2); border: 2px solid var(--ink); }
.entry-content th, .entry-content td { border: 1px solid var(--ink); padding: .55rem .7rem; text-align: left; vertical-align: top; }
.entry-content th { background: var(--blank); }
.entry-content figure { margin: 1.8rem 0; }
.entry-content figcaption, .wp-caption-text { font-size: .76rem; color: var(--muted); margin-top: .4rem; }
.entry-content img { height: auto; }
.entry-content pre, .entry-content code { font-family: var(--font); background: var(--blank-soft); }
.entry-content pre { padding: 1rem; overflow-x: auto; }
.entry-content .wp-block-table { overflow-x: auto; }
.alignleft { float: left; margin: .3rem 1.5rem 1rem 0; }
.alignright { float: right; margin: .3rem 0 1rem 1.5rem; }
.aligncenter { margin-left: auto; margin-right: auto; }

.neighbours { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 2rem; }
.neighbour { display: block; padding: 1rem 1.2rem; background: var(--kraft); border: 1px solid rgba(138, 133, 120, .6); text-decoration: none; font-weight: 600; font-size: .86rem; line-height: 1.45; }
.neighbour span { display: block; font-weight: 400; font-size: .72rem; color: var(--muted); margin-bottom: .3rem; text-transform: uppercase; letter-spacing: .06em; }
.neighbour--next { grid-column: 2; text-align: right; }
.neighbour:hover { background: var(--ink); color: var(--on-ink); }
.neighbour:hover span { color: var(--on-ink-muted); }

/* ---------- Сайдбар ---------- */
.sidebar { min-width: 0; background: var(--kraft); border: 1px solid rgba(138, 133, 120, .6); box-shadow: 5px 5px 0 -1px var(--kraft-deep), 5px 5px 0 0 rgba(138, 133, 120, .5); padding: 1.6rem 1.5rem; color: var(--ink); }
.sidebar .widget { margin-bottom: 1.8rem; font-size: .84rem; }
.sidebar .widget:last-child { margin-bottom: 0; }
.sidebar .widget-title { margin: 0 0 .9rem; font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink); border-bottom: 2px solid var(--ink); padding-bottom: .3rem; }
.sidebar a { color: var(--ink); }
.sidebar a:hover { color: var(--red); }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li { padding: .55rem 0; margin: 0; border-bottom: 1px dashed var(--line); line-height: 1.5; }
.sidebar .post-date { display: block; color: #55544E; font-size: .72rem; }

/* ---------- Пагинация ---------- */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 2.4rem; }
.pager .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 2.6rem; height: 2.6rem; padding: 0 .8rem; border: 2px solid var(--ink); background: var(--sheet); color: var(--ink); text-decoration: none; font-weight: 700; font-size: .85rem; }
.pager a.page-numbers:hover { background: var(--ink); color: var(--on-ink); }
.pager .page-numbers.current { background: var(--red); border-color: var(--red); color: #fff; transform: rotate(-3deg); }
.pager .page-numbers.dots { border: 0; background: none; min-width: auto; padding: 0 .3rem; }
.pager--inline { margin-top: 1.4rem; }
.pager--inline .post-page-numbers { display: inline-flex; min-width: 2.2rem; height: 2.2rem; align-items: center; justify-content: center; border: 2px solid var(--ink); text-decoration: none; }
.pager--inline .post-page-numbers.current { background: var(--ink); color: var(--on-ink); }

/* ---------- Поиск ---------- */
.lookup { display: flex; gap: 0; max-width: 520px; margin: 1.2rem 0; }
.lookup-field { flex: 1; min-width: 0; font-family: var(--font); font-size: .9rem; padding: .65rem .9rem; border: 2px solid var(--ink); border-right: 0; background: var(--sheet-2); color: var(--ink); border-radius: 0; }
.lookup-btn { font-family: var(--font); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; padding: 0 1.2rem; border: 2px solid var(--ink); background: var(--ink); color: var(--on-ink); cursor: pointer; border-radius: 0; }
.lookup-btn:hover { background: var(--red); border-color: var(--red); }
.empty-sheet { background: var(--sheet); border: 1px dashed var(--line); padding: 1.6rem; }
.empty-sheet .empty-note { padding: 0; border: 0; background: none; }

/* ---------- 404 ---------- */
.sheet--lost { padding: 3rem 2.6rem; overflow: hidden; }
.lost-code { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .5rem; }
.lost-stamp { position: absolute; right: 2rem; top: 1.6rem; transform: rotate(10deg); }
.lost-back { margin-top: 1.6rem; }

/* ---------- Комментарии ---------- */
.notes { margin-top: 2.6rem; background: var(--sheet); border: 1px solid rgba(138, 133, 120, .55); padding: 2rem 2.2rem; }
.notes-title, .comment-reply-title { font-size: 1.15rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 2px solid var(--ink); padding-bottom: .3rem; margin: 0 0 1.2rem; }
.comment-reply-title small { margin-left: .8rem; font-size: .72rem; text-transform: none; letter-spacing: 0; }
.notes-list, .notes-list .children { list-style: none; margin: 0; padding: 0; }
.notes-list .children { margin-left: 2rem; }
.note-item { margin: 0 0 1rem; }
.note-body { padding: 1rem 1.2rem; background: var(--sheet-2); border: 1px solid rgba(138, 133, 120, .5); border-left: 4px solid var(--ink); font-size: .86rem; }
.note-head { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: .5rem; }
.note-avatar { width: 40px; height: 40px; filter: grayscale(1); }
.note-author { font-weight: 700; }
.note-date { color: var(--muted); font-size: .74rem; }
.note-wait { color: var(--red); font-size: .78rem; }
.note-reply a { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.notes-closed, .form-hint { font-size: .8rem; color: var(--muted); }
.comment-respond { margin-top: 1.6rem; }
.comment-form label { display: block; font-size: .78rem; font-weight: 600; margin-bottom: .3rem; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; font-family: var(--font); font-size: .9rem; padding: .6rem .8rem; border: 2px solid var(--ink); background: var(--sheet-2); color: var(--ink); border-radius: 0; }
.comment-form-cookies-consent { display: flex; gap: .6rem; align-items: flex-start; }
.comment-form-cookies-consent label { font-weight: 400; margin: 0; }
.comment-form .stamp-btn { margin-top: .4rem; }

/* ---------- Подвал ---------- */
.colophon { background: var(--ink); color: var(--on-ink-muted); margin-top: 1rem; border-top: 4px solid var(--ink-2); }
.colophon-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 3rem; padding: 3rem 0 2.2rem; }
.colophon-col { min-width: 0; }
.colophon .widget { font-size: .82rem; line-height: 1.7; color: var(--on-ink-muted); margin-bottom: 1.4rem; }
.colophon .widget-title { margin: 0 0 .9rem; font-size: 1rem; color: var(--on-ink); text-transform: none; font-weight: 600; letter-spacing: .02em; }
.colophon a { color: var(--on-ink); text-decoration-color: rgba(237, 230, 214, .45); }
.colophon a:hover { color: #fff; text-decoration-color: #fff; }
.colophon ul { list-style: none; padding: 0; margin: 0; }
.colophon li { margin: 0 0 .45rem; }
.colophon .post-date { color: var(--on-ink-muted); }
.colophon-bottom { border-top: 1px solid rgba(237, 230, 214, .18); padding: 1.2rem 0 1.5rem; text-align: center; }
.colophon-bottom p { margin: 0; font-size: .76rem; color: var(--on-ink-muted); }

/* ---------- Cookie-баннер ---------- */
.cookie-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    max-width: 980px;
    margin: 0 auto;
    padding: 1.1rem 1.6rem;
    background: var(--ink);
    color: var(--on-ink);
    border: 1px solid rgba(237, 230, 214, .3);
    outline: 1px solid var(--ink);
    outline-offset: 3px;
}
.cookie-text { margin: 0; font-size: .8rem; line-height: 1.55; }
.cookie-banner .stamp-btn { flex: 0 0 auto; }

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
    .dossier--kraft { padding-right: 2.4rem; padding-top: 2rem; }
    .memo { position: relative; right: auto; top: auto; width: auto; max-width: 26rem; margin: 0 0 1.6rem auto; transform: rotate(1.5deg); }
    .clip--note { right: 2rem; top: -1.5rem; }
}

@media (max-width: 960px) {
    .front { width: min(92%, 1180px); }
    .menu-toggle { display: inline-flex; }
    .masthead-row { flex-wrap: wrap; }
    .brand { flex: 1 1 0; }
    .topnav { display: none; flex-basis: 100%; }
    .topnav.is-open { display: block; }
    .topnav-list { flex-direction: column; gap: 0; border-top: 1px solid rgba(237, 230, 214, .2); padding-top: .5rem; }
    .topnav-list a { padding: .6rem 0; display: block; }
    .card-grid--drawer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .route-line { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 2.6rem; transform: rotate(-1.2deg); }
    .route-line::before { display: none; }
    .route-line li:nth-child(even) { transform: none; }
    .spread { grid-template-columns: minmax(0, 1fr); }
    .spread::after { display: none; }
    .spread-page--right { border-top: 1.5px dashed var(--line); }
    .layout-with-sidebar { grid-template-columns: minmax(0, 1fr); row-gap: 2.4rem; }
    .layout-single > .content-area { width: 100%; }
    .colophon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    body { font-size: 14px; }
    .brand-seal, .brand-logo { width: 48px; height: 48px; }
    .brand-desc { display: none; }
    .front { padding-top: 1.6rem; }
    .front > section { margin-bottom: 2.6rem; }
    .dossier { padding: 1.5rem 1.2rem 1.3rem; }
    .dossier--kraft { padding: 1.5rem 1.2rem 1.6rem; }
    .checksheet { grid-template-columns: minmax(0, 1fr); }
    .check-name { font-size: 1.08rem; }
    .ledger { min-width: 0; border: 0; background: none; }
    .ledger thead { display: none; }
    .ledger, .ledger tbody, .ledger tr, .ledger th, .ledger td { display: block; width: 100%; }
    .ledger tr { border: 2px solid var(--ink); background: var(--sheet-2); margin-bottom: 1rem; }
    .ledger tbody th { width: 100%; border: 0; border-bottom: 1px solid var(--ink); background: var(--blank); }
    .ledger td { border: 0; border-bottom: 1px dashed var(--line); padding: .45rem .75rem; }
    .ledger td:last-child { border-bottom: 0; }
    .ledger tbody td:nth-child(4) { text-align: left; white-space: normal; }
    .ledger td::before { content: attr(data-label); display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
    .ledger tbody tr:hover td { background: none; }
    .ledger-stamp { left: auto; right: .4rem; top: 4.6rem; font-size: 1.3rem; }
    .dossier-ref { white-space: normal; }
    .card-grid--drawer { grid-template-columns: minmax(0, 1fr); }
    .card-grid--drawer .card:nth-child(n) { transform: none; }
    .route-sheet { padding: 2rem 1.2rem 2rem 3.4rem; background-image: linear-gradient(90deg, transparent 34px, rgba(178, 58, 46, .55) 34px 36px, transparent 36px), repeating-linear-gradient(transparent 0 27px, rgba(110, 150, 178, .4) 27px 28px); }
    .route-line { grid-template-columns: minmax(0, 1fr); transform: none; row-gap: 1.4rem; }
    .route-line li { display: grid; grid-template-columns: 52px minmax(0, 1fr); column-gap: 1rem; text-align: left; align-items: start; }
    .route-dot { width: 48px; height: 48px; font-size: 1.3rem; grid-row: span 2; box-shadow: 0 0 0 3px var(--sheet-2), 0 0 0 4.5px var(--line); }
    .route-name { margin-top: .3rem; }
    .spread-page { padding: 1.6rem 1.2rem; }
    .spread-frame { padding: 1.2rem 1rem 4.4rem; }
    .spread-page--right { padding-top: 4.6rem; }
    .clauses li { grid-template-columns: 2.6rem minmax(0, 1fr); }
    .sheet { padding: 1.5rem 1.2rem; }
    .sheet--lost { padding: 4.6rem 1.2rem 1.8rem; }
    .lost-stamp { right: 1rem; top: 1rem; font-size: 1.3rem; }
    .notes { padding: 1.5rem 1.2rem; }
    .notes-list .children { margin-left: 1rem; }
    .sidebar { padding: 1.4rem 1.2rem; }
    .neighbours { grid-template-columns: minmax(0, 1fr); }
    .neighbour--next { grid-column: auto; }
    .colophon-grid { grid-template-columns: minmax(0, 1fr); padding-top: 2.2rem; }
    .cookie-banner { flex-direction: column; align-items: flex-start; padding: 1rem 1.2rem; left: .6rem; right: .6rem; bottom: .6rem; }
    .alignleft, .alignright { float: none; margin: 1rem 0; }
}
