/*
Theme Name: dds_thebaybali.com
Theme URI: https://thebaybali.com/
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: baytax
*/

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

/* ---------- Палитра ---------- */
:root {
    --paper: #E8E4DA;
    --sheet: #F6F0E6;
    --sheet-2: #EDE3D3;
    --card: #E6D3B3;
    --card-edge: #CDB68F;
    --ink: #23282B;
    --pencil: #8A8578;
    --blue: #1E3A66;
    --blue-deep: #172E52;
    --red: #C0362C;
    --green: #2E6B4F;
    --honey: #E3B341;
    --slate: #5C7389;
    --aside-bg: #DDE2E3;
    --light-on-dark: #EEE8DC;
    --muted-on-dark: #C9C3B5;
    --font-type: "Bay Typewriter", "Courier New", Courier, monospace;
    --font-text: "Bay Serif", "PT Serif", Georgia, "Times New Roman", serif;
    --grid: linear-gradient(rgba(138, 133, 120, .13) 1px, transparent 1px), linear-gradient(90deg, rgba(138, 133, 120, .13) 1px, transparent 1px);
    --grid-big: linear-gradient(rgba(138, 133, 120, .2) 1px, transparent 1px), linear-gradient(90deg, rgba(138, 133, 120, .2) 1px, transparent 1px);
}

/* ---------- Сброс и база ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    overflow-x: hidden;
    background-color: var(--paper);
    background-image: var(--grid-big), var(--grid);
    background-size: 40px 40px, 8px 8px;
    color: var(--ink);
    font-family: var(--font-text);
    font-size: 17px;
    line-height: 1.65;
}
img { max-width: 100%; height: auto; }
a { color: var(--blue); }
a:hover { color: var(--red); }
p { margin: 0 0 1em; }
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-type);
    font-weight: 700;
    line-height: 1.2;
    margin: 1.4em 0 .6em;
    overflow-wrap: break-word;
    hyphens: manual;
}
.site-name, .card-title { overflow-wrap: break-word; hyphens: manual; }
p, li, td, th, dd, dt, blockquote, figcaption, .site-desc {
    overflow-wrap: break-word;
    hyphens: auto;
}
:focus-visible { outline: 3px solid var(--honey); outline-offset: 2px; }

.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: 12px;
    top: -60px;
    z-index: 100;
    background: var(--honey);
    color: var(--ink);
    padding: .5rem 1rem;
    font-family: var(--font-type);
    text-decoration: none;
}
.skip-link:focus { top: 12px; }

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

/* ---------- Заголовок-«шапка документа» ---------- */
.doc-head {
    display: inline-block;
    margin: 0 0 1.4rem;
    padding-bottom: .35rem;
    font-size: clamp(1.6rem, 3.2vw, 2.5rem);
    letter-spacing: -.01em;
    border-bottom: 6px double currentColor;
}
.fs-kicker {
    margin: 0 0 .5rem;
    font-family: var(--font-type);
    font-size: .85rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--pencil);
}
.fs-kicker::before { content: "№ "; color: var(--red); }

/* ---------- Кнопки-штампы и карандашные ссылки ---------- */
.stamp-btn {
    display: inline-block;
    padding: .55rem 1.2rem;
    border: 2px solid var(--red);
    border-radius: 6px 3px 7px 4px / 4px 7px 3px 6px;
    outline: 1px solid rgba(192, 54, 44, .55);
    outline-offset: 2px;
    background: transparent;
    color: var(--red);
    font-family: var(--font-type);
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .03em;
    line-height: 1.3;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transform: rotate(-3deg);
    transition: background-color .15s, color .15s, transform .15s;
}
.stamp-btn:hover,
.stamp-btn:focus-visible {
    background: var(--red);
    color: var(--sheet);
    transform: rotate(0) translateY(-1px);
}
.pencil-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-family: var(--font-type);
    font-weight: 700;
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--pencil);
    text-decoration-thickness: 1px;
    text-underline-offset: 5px;
}
.pencil-link::after { content: "↗"; color: var(--red); }
.pencil-link:hover { color: var(--red); text-decoration-color: var(--red); }

/* ---------- Шапка ---------- */
.masthead { position: relative; }
.binder-edge {
    height: 26px;
    background: var(--blue-deep);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 12%;
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18);
}
.binder-edge span {
    width: 72px;
    height: 10px;
    border-radius: 6px;
    background: linear-gradient(#d8cfbd, #b7ad98);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35);
}
.binder-edge span:nth-child(2) { width: 120px; }
.topbar { background: var(--blue); border-bottom: 4px solid var(--blue-deep); }
.topbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 76px;
}
.brand-mark { display: inline-flex; align-items: center; flex: 0 0 auto; }
.brand-logo { display: block; width: auto; max-height: 58px; }
.brand-svg { width: 56px; height: 56px; }

.topnav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}
.topnav-list li + li { border-left: 1px solid rgba(232, 228, 218, .35); }
.topnav-list a {
    display: block;
    padding: .35rem 1rem;
    color: var(--light-on-dark);
    font-family: var(--font-type);
    font-size: 1rem;
    text-decoration: none;
}
.topnav-list a:hover,
.topnav-list .current-menu-item > a {
    color: #fff;
    text-decoration: underline;
    text-decoration-color: var(--honey);
    text-decoration-thickness: 2px;
    text-underline-offset: 7px;
}
.menu-toggle {
    display: none;
    align-items: center;
    gap: .6rem;
    padding: .5rem .9rem;
    background: transparent;
    border: 2px solid var(--light-on-dark);
    color: var(--light-on-dark);
    font-family: var(--font-type);
    font-size: .95rem;
    cursor: pointer;
}
.menu-toggle-bars,
.menu-toggle-bars::before,
.menu-toggle-bars::after {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    position: relative;
}
.menu-toggle-bars::before,
.menu-toggle-bars::after { content: ""; position: absolute; left: 0; }
.menu-toggle-bars::before { top: -6px; }
.menu-toggle-bars::after { top: 6px; }

.title-sheet {
    position: relative;
    background-color: var(--sheet);
    background-image: var(--grid-big), var(--grid);
    background-size: 40px 40px, 8px 8px;
    border-bottom: 1px solid rgba(138, 133, 120, .4);
    overflow: hidden;
}
.title-row {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 2rem 0 1.8rem;
}
.title-text { min-width: 0; flex: 1 1 auto; }
.site-name {
    margin: 0 0 .6rem;
    font-family: var(--font-type);
    font-weight: 700;
    font-size: clamp(1.25rem, 2.2vw, 1.85rem);
    line-height: 1.25;
}
.title-sheet.is-home .site-name { font-size: clamp(1.45rem, 3vw, 2.45rem); }
.site-name a { color: var(--ink); text-decoration: none; }
.site-name a:hover { color: var(--blue); }
.site-desc {
    margin: 0;
    max-width: 62ch;
    font-size: 1.02rem;
    color: #4a4e4f;
}
.seal {
    flex: 0 0 auto;
    width: 150px;
    height: 150px;
    transform: rotate(-12deg);
    opacity: .82;
    mix-blend-mode: multiply;
}

/* ---------- Главная: общая основа секций ---------- */
.front { padding: 2.2rem 0 3rem; }
.fs {
    position: relative;
    padding: 0 clamp(18px, 3vw, 40px);
    margin-top: -6px;
}
.fs::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 50px;
    bottom: 50px;
    width: 5px;
    border-radius: 3px;
    background: repeating-linear-gradient(to bottom, rgba(70, 66, 58, .45) 0 46px, transparent 46px 210px);
    pointer-events: none;
}
.fs-inner {
    position: relative;
    width: 85%;
    margin-inline: auto;
    padding: 4rem 0 4.6rem;
}
.tab-row {
    position: absolute;
    left: 6%;
    right: 3%;
    bottom: 0;
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    pointer-events: none;
}
.tab-row span {
    flex: 0 1 11%;
    height: 22px;
    border-radius: 9px 9px 0 0;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .25);
}
.tab-row .t-gap { background: transparent; box-shadow: none; }
.t-honey { background: #D9A93A; }
.t-red { background: var(--red); }
.t-blue { background: #2E62A3; }
.t-green { background: var(--green); }
.t-slate { background: var(--slate); }
.t-paper { background: var(--sheet-2); }

.paperclip {
    position: absolute;
    top: -14px;
    right: 7%;
    width: 16px;
    height: 48px;
    border: 3px solid #6f6b63;
    border-radius: 10px;
    z-index: 2;
    transform: rotate(8deg);
}
.paperclip::after {
    content: "";
    position: absolute;
    left: 2px;
    top: 8px;
    width: 6px;
    height: 28px;
    border: 3px solid #6f6b63;
    border-top: 0;
    border-radius: 0 0 6px 6px;
}

/* ---------- Блок 1: шкала срока владения ---------- */
.fs-term {
    background-color: var(--honey);
    background-image:
        radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1.5px),
        linear-gradient(90deg, rgba(0, 0, 0, .07) 0 14px, transparent 14px);
    background-size: 7px 7px, 100% 100%;
    clip-path: polygon(0 2.6rem, 74% 2.6rem, 76.5% 0, 96% 0, 98.5% 2.6rem, 100% 2.6rem, 100% 100%, 0 100%);
    padding-top: 2.6rem;
}
.fs-term .paperclip { top: 6px; right: 5%; }
.fs-term .fs-inner { padding-top: 2.6rem; }
.fs-term .fs-kicker { color: #6b5418; }
.term-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    flex-wrap: wrap;
}
.term-top > div { min-width: 0; }
.pencil-note {
    max-width: 300px;
    margin: .4rem 0 0;
    font-style: italic;
    font-size: .98rem;
    line-height: 1.45;
    color: #3d3a33;
    transform: rotate(-2deg);
    border-left: 3px solid rgba(35, 40, 43, .4);
    padding-left: .8rem;
}
.term-switch {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin: 1.4rem 0 2.2rem;
}
.term-tab {
    flex: 1 1 260px;
    min-width: 0;
    padding: .7rem 1rem;
    background: rgba(246, 240, 230, .75);
    border: 2px solid var(--ink);
    border-top-width: 6px;
    color: var(--ink);
    font-family: var(--font-type);
    font-size: .92rem;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
    transition: background-color .15s, color .15s, transform .15s;
}
.term-tab:hover { transform: translateY(-2px); }
.term-tab[aria-selected="true"] {
    background: var(--blue);
    border-color: var(--blue-deep);
    color: var(--light-on-dark);
}

.ruler {
    --min: 3;
    position: relative;
    padding: 0 .5rem;
}
.ruler-zones {
    display: flex;
    height: 92px;
    margin-bottom: .4rem;
}
.zone {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    transition: flex-basis .45s ease;
}
.zone-tax {
    flex: 0 0 calc(var(--min) / 6 * 100%);
    background: repeating-linear-gradient(-45deg, rgba(192, 54, 44, .16) 0 8px, transparent 8px 16px);
}
.zone-free {
    flex: 1 1 auto;
    background: repeating-linear-gradient(-45deg, rgba(46, 107, 79, .16) 0 8px, transparent 8px 16px);
}
.zone-stamp {
    display: inline-block;
    padding: .35rem .9rem;
    border: 2px solid currentColor;
    outline: 1px solid currentColor;
    outline-offset: 3px;
    border-radius: 3px 6px 4px 7px;
    background: rgba(246, 240, 230, .55);
    font-family: var(--font-type);
    font-size: clamp(1rem, 2vw, 1.45rem);
    white-space: nowrap;
}
.zone-tax .zone-stamp { color: var(--red); transform: rotate(-4deg); }
.zone-free .zone-stamp { color: var(--green); transform: rotate(3deg); }
.ruler-line {
    position: relative;
    height: 3px;
    background: var(--ink);
}
.ruler-line::after {
    content: "";
    position: absolute;
    right: -4px;
    top: -6px;
    width: 12px;
    height: 12px;
    border-top: 3px solid var(--ink);
    border-right: 3px solid var(--ink);
    transform: rotate(45deg);
}
.runner {
    position: absolute;
    top: 50%;
    left: calc(var(--min) / 6 * 100%);
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    background: radial-gradient(circle at 40% 35%, #d6463b, var(--red) 60%, #8f241c);
    border-radius: 5px;
    box-shadow: 0 3px 0 rgba(0, 0, 0, .25);
    transition: left .45s ease;
}
.runner::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 100%;
    height: 100px;
    border-left: 2px dashed var(--ink);
}
.runner::after {
    content: "";
    position: absolute;
    right: 70%;
    top: 55%;
    width: 80px;
    height: 9px;
    background: var(--red);
    border-radius: 4px;
    transform: rotate(-12deg);
    transform-origin: right center;
    opacity: .85;
}
.ruler-ticks {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 3.2rem;
}
.ruler-ticks li {
    position: absolute;
    top: -14px;
    left: calc(var(--t) / 6 * 100%);
    transform: translateX(-50%);
    text-align: center;
}
.ruler-ticks li::before {
    content: "";
    display: block;
    width: 3px;
    height: 24px;
    margin: 0 auto .35rem;
    background: var(--ink);
}
.ruler-ticks li:first-child { transform: translateX(-2px); text-align: left; }
.ruler-ticks li:first-child::before { margin-left: 0; }
.ruler-ticks li:last-child { transform: translateX(-100%); text-align: right; }
.ruler-ticks li:last-child::before { margin-right: 0; }
.ruler-ticks span {
    font-family: var(--font-type);
    font-size: .95rem;
    white-space: nowrap;
}
.ruler-caption {
    margin: 1.2rem 0 0;
    padding: .9rem 1.2rem;
    background: rgba(246, 240, 230, .78);
    border-left: 6px solid var(--red);
    font-size: 1rem;
}
.ruler[data-min="3"] .cap-5,
.ruler[data-min="5"] .cap-3 { display: none; }
.term-notes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.2rem;
    margin-top: 1.8rem;
}
.term-notes p {
    position: relative;
    margin: 0;
    padding: 1.3rem 1.4rem 1.1rem;
    background: var(--sheet);
    background-image: repeating-linear-gradient(transparent 0 27px, rgba(30, 58, 102, .12) 27px 28px);
    font-size: .98rem;
    box-shadow: 0 2px 0 rgba(0, 0, 0, .12);
}
.term-notes p::before {
    content: "";
    position: absolute;
    top: -9px;
    left: 50%;
    width: 70px;
    height: 18px;
    margin-left: -35px;
    background: rgba(255, 255, 255, .55);
    transform: rotate(-3deg);
}
.term-notes p:nth-child(2)::before { transform: rotate(4deg); }

/* ---------- Блок 2: разбор вычета ---------- */
.fs-deduct {
    background-color: var(--blue);
    background-image: linear-gradient(90deg, rgba(0, 0, 0, .16) 0 14px, transparent 14px), repeating-linear-gradient(0deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 6px);
    color: var(--light-on-dark);
}
.fs-deduct::before { background: repeating-linear-gradient(to bottom, rgba(232, 228, 218, .45) 0 46px, transparent 46px 210px); }
.fs-deduct .fs-kicker { color: var(--muted-on-dark); }
.fs-deduct .doc-head { color: var(--light-on-dark); }
.deduct-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
    gap: 3rem;
    align-items: start;
}
.blank-figure {
    position: relative;
    margin: 0;
    transform: rotate(-1deg);
}
.blank-figure img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1060 / 690;
    object-fit: cover;
    box-shadow: 8px 10px 0 rgba(0, 0, 0, .25);
}
.pin {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border-radius: 50%;
    background: var(--red);
    border: 3px solid var(--sheet);
    color: #fff;
    font-family: var(--font-type);
    font-size: 1rem;
    line-height: 28px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
.big-sum {
    margin: 0;
    font-family: var(--font-type);
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    line-height: 1.1;
}
.big-sum span {
    display: inline-block;
    padding: .1em .35em;
    color: var(--ink);
    background: linear-gradient(100deg, transparent 0 2%, var(--honey) 3% 96%, transparent 97%), linear-gradient(transparent 0 12%, rgba(227, 179, 65, .6) 12% 90%, transparent 90%);
    transform: rotate(-1.5deg);
    white-space: nowrap;
}
.big-sum-cap {
    margin: .9rem 0 1.6rem;
    font-family: var(--font-type);
    font-size: 1.1rem;
    line-height: 1.4;
    color: var(--light-on-dark);
}
.callouts {
    list-style: none;
    counter-reset: callout;
    margin: 0;
    padding: 0;
}
.callouts li {
    counter-increment: callout;
    position: relative;
    padding: .7rem 0 .7rem 3rem;
    border-top: 1px dashed rgba(232, 228, 218, .4);
    font-size: .96rem;
    line-height: 1.5;
    color: var(--muted-on-dark);
}
.callouts li b { color: var(--light-on-dark); font-family: var(--font-type); }
.callouts li::before {
    content: counter(callout);
    position: absolute;
    left: 0;
    top: .7rem;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    font-family: var(--font-type);
    line-height: 30px;
    text-align: center;
}

/* ---------- Блок записей ---------- */
.fs-latest {
    background-color: var(--sheet);
    background-image: var(--grid-big), var(--grid);
    background-size: 40px 40px, 8px 8px;
    clip-path: polygon(0 0, 100% 10px, 100% 100%, 0 100%);
}
.card-grid,
.card-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.6rem 2rem;
    padding-top: 1rem;
}
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: var(--card);
    background-image: radial-gradient(rgba(120, 90, 50, .08) 1px, transparent 1.5px);
    background-size: 5px 5px;
    border-left: 14px solid var(--red);
    box-shadow: 6px 6px 0 var(--card-edge);
    transition: transform .15s;
}
.card:hover { transform: translate(-2px, -3px); }
.card:nth-child(3n+2) { border-left-color: var(--green); }
.card:nth-child(3n) { border-left-color: #2E62A3; }
.card-tab {
    position: absolute;
    top: -16px;
    left: 18%;
    width: 42%;
    height: 17px;
    background: var(--card);
    clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%);
}
.card::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 30px;
    background: linear-gradient(225deg, var(--sheet) 50%, #d4bd96 50%);
    box-shadow: -2px 2px 2px rgba(0, 0, 0, .1);
}
.card-thumb { padding: 1rem 1.2rem 0; }
.card-thumb a { display: block; }
.card-thumb img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border: 6px solid var(--sheet);
    filter: sepia(.25) saturate(.85);
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 1.3rem 1.4rem 1.6rem;
}
.card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
    margin-bottom: .8rem;
}
.stamp-date {
    display: inline-block;
    padding: .1rem .5rem;
    border: 2px solid var(--blue);
    color: var(--blue);
    font-family: var(--font-type);
    font-size: .82rem;
    transform: rotate(-2deg);
}
.card-cat {
    font-family: var(--font-type);
    font-size: .8rem;
    color: #5b4f3c;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.card-cat:hover { color: var(--red); }
.card-title {
    margin: 0 0 .7rem;
    font-size: 1.32rem;
    line-height: 1.22;
}
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.card-excerpt { flex: 1; font-size: .96rem; line-height: 1.55; color: #3a3d3e; }
.card-excerpt p { margin: 0 0 .5em; background: none; }
.card-more { align-self: flex-start; margin-top: .9rem; }
.all-link-wrap { margin: 2.4rem 0 0; text-align: right; }
.empty-note {
    padding: 1.2rem 1.4rem;
    background: var(--sheet);
    border: 2px dashed var(--pencil);
    font-family: var(--font-type);
}

/* ---------- Блок 3: календарь ---------- */
.fs-calendar {
    background-color: var(--green);
    background-image: linear-gradient(90deg, rgba(0, 0, 0, .15) 0 14px, transparent 14px), repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 7px);
    color: var(--light-on-dark);
}
.fs-calendar::before { background: repeating-linear-gradient(to bottom, rgba(232, 228, 218, .45) 0 46px, transparent 46px 210px); }
.fs-calendar .fs-kicker { color: #BFD6CA; }
.fs-calendar .doc-head { color: var(--light-on-dark); }
.cal-rings {
    position: absolute;
    top: 1.2rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
}
.cal-rings span {
    width: 14px;
    height: 34px;
    border-radius: 7px;
    border: 3px solid #c9c4b8;
    background: linear-gradient(90deg, #8d8a82, #e7e2d6 50%, #8d8a82);
}
.cal-grid {
    list-style: none;
    margin: .6rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 2px solid rgba(232, 228, 218, .7);
}
.cal-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0 1.2rem 1.4rem;
    border-left: 2px solid rgba(232, 228, 218, .7);
}
.cal-col:first-child { border-left: 0; }
.cal-col.is-key { background: rgba(232, 228, 218, .16); }
.cal-month {
    display: block;
    margin: 0 -1.2rem 1.2rem;
    padding: .8rem 1.2rem;
    border-bottom: 2px solid rgba(232, 228, 218, .7);
    font-family: var(--font-type);
    font-size: clamp(1.3rem, 2.2vw, 1.9rem);
    text-align: center;
    color: var(--light-on-dark);
}
.cal-stamp {
    align-self: center;
    display: inline-block;
    margin-bottom: 1rem;
    padding: .35rem .8rem;
    background: var(--sheet);
    border: 2px solid var(--red);
    outline: 1px solid var(--red);
    outline-offset: -5px;
    color: var(--red);
    font-family: var(--font-type);
    font-size: .98rem;
    text-align: center;
    transform: rotate(-5deg);
}
.cal-col:nth-child(even) .cal-stamp { transform: rotate(4deg); }
.cal-col.is-key .cal-stamp { font-size: 1.15rem; padding: .5rem 1rem; }
.cal-task {
    margin: 0 0 .5rem;
    font-size: 1.12rem;
    color: #fff;
}
.cal-col p { margin: 0; font-size: .94rem; line-height: 1.5; color: #DCE6DF; }
.cal-foot {
    margin: 1.4rem 0 0;
    padding: .8rem 1.2rem;
    border: 1px dashed rgba(232, 228, 218, .6);
    font-style: italic;
    color: #E3ECE6;
}

/* ---------- Блок 4: FAQ + цитата ---------- */
.fs-faq {
    background-color: var(--sheet-2);
    background-image: var(--grid);
    background-size: 8px 8px;
    border-bottom: 3px solid rgba(35, 40, 43, .2);
}
.faq-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: 3.2rem;
    align-items: center;
}
.faq-list { min-width: 0; }
.faq-item { border-bottom: 2px solid var(--ink); }
.faq-item:first-of-type { border-top: 2px solid var(--ink); }
.faq-item summary {
    position: relative;
    list-style: none;
    padding: .95rem 2.6rem .95rem 0;
    font-family: var(--font-type);
    font-size: 1.06rem;
    line-height: 1.35;
    cursor: pointer;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    position: absolute;
    right: .2rem;
    top: 50%;
    width: 1.6rem;
    height: 1.6rem;
    margin-top: -.8rem;
    border: 2px solid var(--ink);
    line-height: 1.3rem;
    text-align: center;
    font-size: 1.1rem;
}
.faq-item[open] summary::after { content: "−"; background: var(--red); border-color: var(--red); color: #fff; }
.faq-item summary:hover { color: var(--blue); }
.faq-answer {
    padding: 0 0 1.1rem 1.1rem;
    margin-left: .2rem;
    border-left: 4px solid var(--honey);
}
.faq-answer p { margin: 0; font-size: .98rem; }
.quote-card {
    position: relative;
    margin: 1rem 0;
    padding: 2.6rem 2.2rem;
    background-color: #F4ECDE;
    background-image: linear-gradient(90deg, transparent 0 34px, rgba(192, 54, 44, .35) 34px 36px, transparent 36px), repeating-linear-gradient(transparent 0 31px, rgba(30, 58, 102, .16) 31px 32px);
    box-shadow: 10px 10px 0 #d8c8b0, 10px 10px 0 2px rgba(35, 40, 43, .15);
    transform: rotate(1.5deg);
    text-align: center;
}
.quote-card::before {
    content: "";
    position: absolute;
    inset: 12px;
    border: 2px solid var(--ink);
    outline: 1px solid var(--ink);
    outline-offset: -6px;
    pointer-events: none;
}
.quote-card .paperclip { top: -18px; right: 18%; }
.quote-big {
    position: relative;
    margin: 0 0 .9rem;
    font-family: var(--font-type);
    font-size: clamp(1.8rem, 3.4vw, 2.6rem);
    line-height: 1.15;
}
.quote-small {
    position: relative;
    margin: 0;
    font-size: .98rem;
    color: #46494a;
}

/* ---------- Внутренние страницы ---------- */
.inner-wrap { padding: 1.6rem 0 3.6rem; }
.crumbs {
    margin: 0 0 1.6rem;
    font-family: var(--font-type);
    font-size: .88rem;
    color: var(--pencil);
}
.crumbs a { color: var(--blue); text-decoration: underline; text-decoration-color: var(--pencil); text-underline-offset: 3px; }
.crumbs a:hover { color: var(--red); }
.crumbs .sep { margin: 0 .35rem; color: var(--red); }
.crumbs span:last-child { color: var(--ink); }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    column-gap: 6%;
    align-items: start;
}
.layout-single {
    display: block;
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}
.content-area { min-width: 0; }
.layout-with-sidebar .card-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.list-head { margin-bottom: 1.4rem; }
.list-intro { margin-top: -.4rem; }

.doc-sheet {
    position: relative;
    padding: 2.6rem 3rem 2.4rem;
    background-color: #F8F3EA;
    background-image: var(--grid);
    background-size: 8px 8px;
    border-left: 12px solid var(--blue);
    box-shadow: 6px 6px 0 rgba(138, 133, 120, .35);
}
.doc-sheet::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 36px;
    height: 36px;
    background: linear-gradient(225deg, var(--paper) 50%, #ddd3c2 50%);
}
.entry-head { margin-bottom: 1.2rem; }
.entry-meta { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin-bottom: 1rem; }
.entry-title { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.entry-thumb { margin: 0 0 1.6rem; }
.entry-thumb img { display: block; width: 100%; height: auto; border: 8px solid var(--sheet); box-shadow: 0 2px 0 rgba(0, 0, 0, .12); }
.entry-content { font-size: 1.04rem; }
.entry-content h2 { font-size: 1.6rem; border-bottom: 4px double var(--pencil); padding-bottom: .25rem; }
.entry-content h3 { font-size: 1.3rem; }
.entry-content h4 { font-size: 1.1rem; }
.entry-content a { text-decoration-color: var(--pencil); text-underline-offset: 3px; }
.entry-content ul, .entry-content ol { padding-left: 1.4rem; margin: 0 0 1.2em; }
.entry-content li { margin-bottom: .35em; }
.entry-content ul li::marker { color: var(--red); content: "■  "; font-size: .8em; }
.entry-content ol li::marker { color: var(--red); font-family: var(--font-type); font-weight: 700; }
.entry-content blockquote {
    margin: 1.6rem 0;
    padding: 1.2rem 1.4rem 1.2rem 1.6rem;
    background: rgba(227, 179, 65, .18);
    border-left: 6px solid var(--red);
    font-style: italic;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content table {
    width: 100%;
    margin: 1.4rem 0;
    border-collapse: collapse;
    border: 2px solid var(--ink);
    font-size: .95rem;
}
.entry-content th, .entry-content td {
    padding: .55rem .75rem;
    border: 1px solid var(--pencil);
    text-align: left;
    vertical-align: top;
}
.entry-content th {
    background: var(--blue);
    color: var(--light-on-dark);
    font-family: var(--font-type);
    border-color: var(--blue-deep);
}
.entry-content tr:nth-child(even) td { background: rgba(227, 179, 65, .1); }
.entry-content figure { margin: 1.4rem 0; }
.entry-content img { display: block; }
.entry-content figcaption { font-size: .88rem; color: var(--pencil); margin-top: .4rem; }
.entry-content pre {
    overflow-x: auto;
    padding: 1rem;
    background: var(--ink);
    color: var(--light-on-dark);
    font-size: .9rem;
}
.entry-content hr { border: 0; border-top: 4px double var(--pencil); margin: 2rem 0; }
.entry-tags { margin: 1.6rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.entry-tags a {
    padding: .15rem .6rem;
    border: 1px solid var(--blue);
    font-family: var(--font-type);
    font-size: .85rem;
    text-decoration: none;
}
.alignleft { float: left; margin: .3rem 1.4rem 1rem 0; }
.alignright { float: right; margin: .3rem 0 1rem 1.4rem; }
.aligncenter { margin-left: auto; margin-right: auto; }
.wp-caption-text { font-size: .88rem; color: var(--pencil); }

/* ---------- Сайдбар ---------- */
.sidebar { min-width: 0; }
.sidebar .widget {
    position: relative;
    margin-bottom: 2rem;
    padding: 1.6rem 1.5rem 1.4rem;
    background: var(--aside-bg);
    border-top: 8px solid var(--blue);
    box-shadow: 5px 5px 0 rgba(30, 58, 102, .25);
    color: var(--ink);
}
.sidebar .widget-title {
    display: inline-block;
    margin: 0 0 1rem;
    padding-bottom: .25rem;
    font-size: 1.15rem;
    color: var(--ink);
    border-bottom: 4px double var(--ink);
}
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li { padding: .55rem 0; border-bottom: 1px dashed #9aa4a8; }
.sidebar .widget li:last-child { border-bottom: 0; }
.sidebar .widget a { color: var(--blue); text-decoration: none; }
.sidebar .widget a:hover { color: var(--red); text-decoration: underline; }
.sidebar .widget .post-date { display: block; font-size: .82rem; color: #4f5659; }
.sidebar .widget p { color: var(--ink); }

/* ---------- Пагинация ---------- */
.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin: 2.8rem 0 0;
}
.pager .page-numbers {
    display: inline-block;
    min-width: 2.6rem;
    padding: .45rem .75rem;
    border: 2px solid var(--ink);
    background: var(--sheet);
    color: var(--ink);
    font-family: var(--font-type);
    text-align: center;
    text-decoration: none;
    transition: transform .12s, background-color .12s;
}
.pager a.page-numbers:hover { background: var(--honey); transform: translateY(-2px); }
.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: 0; }

/* ---------- Поиск ---------- */
.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    align-items: center;
    margin: 1.2rem 0;
}
.search-field {
    flex: 1 1 220px;
    min-width: 0;
    padding: .65rem .9rem;
    border: 2px solid var(--ink);
    background: #FBF8F2;
    color: var(--ink);
    font-family: var(--font-text);
    font-size: 1rem;
}
.search-submit { transform: none; }
.sheet-404 { text-align: left; }
.code-404 {
    margin: 0;
    font-family: var(--font-type);
    font-size: clamp(4rem, 12vw, 8rem);
    line-height: 1;
    color: var(--blue);
    opacity: .2;
}
.stamp-mark {
    display: inline-block;
    margin: -1rem 0 1rem;
    padding: .3rem .9rem;
    border: 3px solid var(--red);
    color: var(--red);
    font-family: var(--font-type);
    text-transform: uppercase;
    transform: rotate(-6deg);
}
.empty-sheet { padding: 1rem 0; }

/* ---------- Комментарии ---------- */
.notes {
    margin-top: 2.6rem;
    padding: 2rem 2.2rem;
    background: var(--sheet);
    border-top: 6px solid var(--green);
}
.notes-title { font-size: 1.5rem; }
.note-list, .note-list .children { list-style: none; margin: 0; padding: 0; }
.note-list .children { margin-left: 1.8rem; }
.note-body {
    margin-bottom: 1.2rem;
    padding: 1rem 1.2rem;
    background: #FBF8F2;
    border-left: 4px solid var(--blue);
}
.note-head { display: flex; flex-wrap: wrap; gap: .8rem; align-items: baseline; margin-bottom: .4rem; }
.note-author { font-family: var(--font-type); font-weight: 700; }
.note-date { font-size: .85rem; color: var(--pencil); }
.note-wait { font-style: italic; color: var(--red); }
.note-reply a { font-family: var(--font-type); font-size: .88rem; }
.comment-respond { margin-top: 1.6rem; }
.comment-reply-title { font-size: 1.3rem; }
.comment-form label { display: block; font-family: var(--font-type); font-size: .9rem; margin-bottom: .25rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: .6rem .8rem;
    border: 2px solid var(--ink);
    background: #FBF8F2;
    color: var(--ink);
    font-family: var(--font-text);
    font-size: 1rem;
}
.comment-form-cookies-consent label { display: inline; font-family: var(--font-text); }
.comment-form .submit {
    padding: .6rem 1.4rem;
    border: 2px solid var(--red);
    background: var(--red);
    color: #fff;
    font-family: var(--font-type);
    font-size: 1rem;
    cursor: pointer;
}
.comment-form .submit:hover { background: var(--ink); border-color: var(--ink); }

/* ---------- Подвал ---------- */
.site-foot {
    position: relative;
    margin-top: 0;
    background: var(--ink);
    color: var(--muted-on-dark);
    padding: 3.6rem 0 1.6rem;
}
.foot-spines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    height: 8px;
}
.foot-spines span:nth-child(1) { flex: 3; background: var(--blue); }
.foot-spines span:nth-child(2) { flex: 1; background: var(--red); }
.foot-spines span:nth-child(3) { flex: 2; background: var(--green); }
.foot-spines span:nth-child(4) { flex: 1; background: var(--honey); }
.foot-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.4rem;
}
.foot-col { min-width: 0; }
.site-foot .widget { margin-bottom: 1.4rem; color: var(--muted-on-dark); }
.site-foot .widget-title {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    color: var(--light-on-dark);
}
.site-foot .widget-title::after {
    content: "";
    display: block;
    width: 3.2rem;
    height: 5px;
    margin-top: .4rem;
    border-top: 1px solid var(--honey);
    border-bottom: 1px solid var(--honey);
}
.site-foot .widget p,
.site-foot .widget li,
.site-foot .textwidget { color: var(--muted-on-dark); font-size: .96rem; }
.site-foot .widget ul { list-style: none; margin: 0; padding: 0; }
.site-foot .widget li { padding: .3rem 0; }
.site-foot .widget a {
    color: var(--light-on-dark);
    text-decoration: underline;
    text-decoration-color: rgba(201, 195, 181, .45);
    text-underline-offset: 4px;
}
.site-foot .widget a:hover { color: var(--honey); text-decoration-color: var(--honey); }
.copyline {
    margin: 2.2rem 0 0;
    padding-top: 1.2rem;
    border-top: 1px dashed rgba(201, 195, 181, .35);
    font-family: var(--font-type);
    font-size: .88rem;
    color: #A9A396;
}

/* ---------- Cookie-баннер ---------- */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 16px;
    z-index: 90;
    width: min(92%, 780px);
    margin-left: auto;
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 1.4rem;
    padding: 1.1rem 1.4rem;
    background: var(--ink);
    border-left: 10px solid var(--red);
    color: var(--light-on-dark);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}
.cookie-text { margin: 0; font-size: .93rem; line-height: 1.5; min-width: 0; }
.cookie-accept {
    flex: 0 0 auto;
    color: var(--light-on-dark);
    border-color: var(--light-on-dark);
    outline-color: rgba(238, 232, 220, .5);
    transform: rotate(-2deg);
}
.cookie-accept:hover { background: var(--red); border-color: var(--red); }

/* ---------- Адаптив ---------- */
@media (max-width: 960px) {
    .fs-inner { width: 100%; }
    .layout-single { width: 100%; }
    .layout-with-sidebar { display: block; }
    .sidebar { margin-top: 2.6rem; }
    .deduct-grid { grid-template-columns: minmax(0, 1fr); gap: 2.4rem; }
    .card-grid, .card-list, .layout-with-sidebar .card-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cal-col:nth-child(3) { border-left: 0; }
    .cal-col:nth-child(n+3) { border-top: 2px solid rgba(232, 228, 218, .7); }
    .faq-grid { grid-template-columns: minmax(0, 1fr); gap: 2.4rem; }
    .quote-card { max-width: 480px; }
    .foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .seal { width: 110px; height: 110px; }
}

@media (max-width: 760px) {
    .menu-toggle { display: inline-flex; }
    .topbar-row { flex-wrap: wrap; }
    .topnav { display: none; flex: 1 0 100%; padding-bottom: 1rem; }
    .topnav.is-open { display: block; }
    .topnav-list { flex-direction: column; align-items: stretch; }
    .topnav-list li + li { border-left: 0; border-top: 1px solid rgba(232, 228, 218, .25); }
    .topnav-list a { padding: .75rem .2rem; }
    .binder-edge span { width: 44px; }
    .binder-edge span:nth-child(2) { width: 70px; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .front { padding-top: 1.4rem; }
    .fs { padding: 0 18px; }
    .fs::before { left: 5px; }
    .fs-inner { padding: 3rem 0 3.6rem; }
    .fs-term { clip-path: polygon(0 1.8rem, 58% 1.8rem, 63% 0, 95% 0, 100% 1.8rem, 100% 100%, 0 100%); padding-top: 1.8rem; }
    .fs-term .fs-inner { padding-top: 1.6rem; }
    .title-row { padding: 1.4rem 0; }
    .seal { position: absolute; right: -14px; top: -6px; width: 84px; height: 84px; opacity: .45; }
    .title-text { padding-right: 40px; }
    .term-notes { grid-template-columns: minmax(0, 1fr); }
    .ruler-zones { height: 76px; }
    .zone-stamp { padding: .25rem .5rem; font-size: .9rem; }
    .ruler-ticks li:nth-child(2) span,
    .ruler-ticks li:nth-child(3) span,
    .ruler-ticks li:nth-child(5) span { display: none; }
    .ruler-ticks span { font-size: .82rem; }
    .runner::after { width: 44px; }
    .card-grid, .card-list, .layout-with-sidebar .card-list { grid-template-columns: minmax(0, 1fr); }
    .cal-grid { grid-template-columns: minmax(0, 1fr); }
    .cal-col { border-left: 0; }
    .cal-col + .cal-col { border-top: 2px solid rgba(232, 228, 218, .7); }
    .cal-rings span:nth-child(n+3) { display: none; }
    .tab-row span { height: 16px; }
    .quote-card { padding: 2.2rem 1.6rem; transform: none; }
    .doc-sheet { padding: 1.8rem 1.3rem 1.6rem; border-left-width: 8px; }
    .notes { padding: 1.6rem 1.2rem; }
    .foot-cols { grid-template-columns: minmax(0, 1fr); gap: 1.2rem; }
    .cookie-banner { flex-direction: column; align-items: flex-start; gap: .9rem; padding: 1rem 1.2rem; bottom: 10px; }
    .alignleft, .alignright { float: none; margin: 1rem 0; }
}

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