/*
Theme Name: dds_bhagirathiasacademy.com
Theme URI: https://bhagirathiasacademy.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: gsplan
*/

/* ---------- Шрифты ---------- */

@font-face { font-family: "PT Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/pt-serif-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: "PT Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/pt-serif-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: "PT Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/pt-serif-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: "PT Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/pt-serif-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: "PT Serif"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/pt-serif-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: "PT Serif"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/pt-serif-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; }
@font-face { font-family: "PT Sans Narrow"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/pt-sans-narrow-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: "PT Sans Narrow"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/pt-sans-narrow-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 {
    --navy: #1B2A4A;
    --grid: #2E4270;
    --head: #14203A;
    --paper: #F4EFE3;
    --paper-2: #EADFC6;
    --paper-3: #E1D5BA;
    --kraft: #E3CFA7;
    --rose: #D79F8D;
    --ink: #1A1A1A;
    --muted: #6B6350;
    --stamp: #A32B2B;
    --gold: #C9A227;
    --line: #B9AE94;
    --light: #F4EFE3;
    --light-muted: #C8C1AE;
    --ink-blue: #2F4A86;
    --thumb-bg: #F2EFDE;
    --serif: "PT Serif", "Georgia", "Times New Roman", serif;
    --narrow: "PT Sans Narrow", "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
    --shadow: 0 10px 22px rgba(5, 10, 25, .45);
    --edge: polygon(0 .6%, 7% 0, 19% .5%, 33% .1%, 52% .7%, 68% 0, 84% .5%, 100% .1%, 99.6% 22%, 100% 47%, 99.5% 74%, 100% 99.4%, 86% 100%, 64% 99.3%, 47% 100%, 28% 99.4%, 12% 100%, 0 99.5%, .5% 76%, 0 51%, .4% 26%);
}

/* ---------- Сброс и база ---------- */

*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    overflow-x: hidden;
    font-family: var(--serif);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--light);
    background-color: var(--navy);
    background-image:
        linear-gradient(rgba(46, 66, 112, .9) 1px, transparent 1px),
        linear-gradient(90deg, rgba(46, 66, 112, .9) 1px, transparent 1px),
        linear-gradient(rgba(46, 66, 112, .45) 1px, transparent 1px),
        linear-gradient(90deg, rgba(46, 66, 112, .45) 1px, transparent 1px);
    background-size: 110px 110px, 110px 110px, 22px 22px, 22px 22px;
    background-position: -1px -1px;
}

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }

p { margin: 0 0 1em; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--serif);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -.01em;
    margin: 1.4em 0 .6em;
}

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

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

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

.skip {
    position: absolute;
    left: 1rem; top: -4rem;
    z-index: 100;
    padding: .6rem 1rem;
    background: var(--gold);
    color: var(--head);
    font-family: var(--narrow);
    text-transform: uppercase;
    letter-spacing: .06em;
    text-decoration: none;
}
.skip:focus { top: 1rem; }

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

/* ---------- Шапка ---------- */

.masthead {
    background: var(--head);
    border-top: 4px solid var(--gold);
    border-bottom: 2px solid var(--gold);
    box-shadow: inset 0 -6px 0 var(--head), inset 0 -7px 0 rgba(201, 162, 39, .45);
    position: relative;
    z-index: 3;
}

.masthead-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    padding: 1.3rem 0 1.4rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    text-decoration: none;
    color: var(--light);
    flex: 1 1 520px;
    min-width: 0;
}

.brand-mark { flex: 0 0 auto; display: block; }
.brand-seal { width: 72px; height: 72px; display: block; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }
.brand-logo { width: 72px; height: 72px; object-fit: contain; }

.brand-text { display: flex; flex-direction: column; gap: .45rem; min-width: 0; }

.brand-name {
    font-weight: 700;
    font-size: clamp(1.25rem, 3.2vw, 2rem);
    line-height: 1.12;
    letter-spacing: -.015em;
}

.brand-desc {
    font-size: .9rem;
    line-height: 1.45;
    color: var(--light-muted);
    max-width: 40rem;
}

.nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .9rem;
    background: transparent;
    color: var(--light);
    border: 2px solid var(--gold);
    font-family: var(--narrow);
    font-size: .95rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    cursor: pointer;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block;
    width: 20px; height: 2px;
    background: var(--gold);
    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; }

.topnav { display: none; width: 100%; }
.topnav.is-open { display: block; }

.topnav-list {
    list-style: none;
    margin: 0;
    padding: .6rem 0 0;
    border-top: 1px solid rgba(201, 162, 39, .35);
}
.topnav-list a {
    display: block;
    padding: .45rem 0;
    text-decoration: none;
    color: var(--light);
    font-size: 1.02rem;
}
.topnav-list a:hover { color: var(--gold); }
.topnav-list .current-menu-item > a,
.topnav-list .current_page_item > a { color: var(--gold); }

/* Бумажная полоса с закладками под шапкой */

.tabstrip {
    position: relative;
    height: 58px;
    margin-top: -6px;
    z-index: 2;
    pointer-events: none;
}
.tabstrip-paper {
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 40px;
    background: linear-gradient(180deg, var(--paper-3), var(--paper) 55%);
    clip-path: polygon(0 0, 100% 0, 100% 62%, 92% 78%, 81% 66%, 70% 84%, 58% 70%, 44% 88%, 31% 72%, 18% 90%, 7% 76%, 0 92%);
    filter: drop-shadow(0 5px 6px rgba(0, 0, 0, .4));
}
.tabstrip-ribbon {
    position: absolute;
    top: 0;
    width: 22px;
    height: 54px;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
}
.tabstrip-ribbon--gold { left: 5%; background: linear-gradient(90deg, #B08B1C, var(--gold) 45%, #A9881F); }
.tabstrip-ribbon--red { right: 2.5%; background: linear-gradient(90deg, #8A2222, var(--stamp) 45%, #7F1F1F); }
.tabstrip-stamp {
    position: absolute;
    right: 9%;
    top: 7px;
    padding: .05rem .55rem;
    border: 2px solid var(--stamp);
    border-radius: 4px;
    box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 3px var(--stamp);
    color: var(--stamp);
    font-family: var(--narrow);
    font-size: .95rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    transform: rotate(-5deg);
    opacity: .9;
    background: rgba(244, 239, 227, .6);
}

.site-main { display: block; padding: 1.2rem 0 4rem; }

/* ---------- Лист бумаги ---------- */

.sheet {
    position: relative;
    isolation: isolate;
    color: var(--ink);
    padding: 1.8rem 1.4rem;
    filter: drop-shadow(0 10px 14px rgba(5, 10, 25, .45));
}
.sheet::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-color: var(--paper);
    background-image: radial-gradient(rgba(107, 99, 80, .06) 1px, transparent 1.2px);
    background-size: 5px 5px;
    clip-path: var(--edge);
}
.sheet::after {
    content: "";
    position: absolute;
    inset: 6px -7px -7px 6px;
    z-index: -2;
    background: var(--paper-3);
    clip-path: var(--edge);
    transform: rotate(.6deg);
}

.sheet a { color: var(--ink); }
.sheet a:hover { color: var(--stamp); }

/* ---------- Главная ---------- */

.front { width: 100%; }

.front-title {
    margin: 2.4rem 0 1.4rem;
    text-align: center;
    color: var(--light);
    text-transform: uppercase;
    font-size: clamp(1.55rem, 4vw, 2.5rem);
    letter-spacing: 0;
    text-shadow: 0 2px 0 rgba(5, 10, 25, .5);
}

.sheet-title {
    margin: 0 0 1.4rem;
    text-align: center;
    text-transform: uppercase;
    font-size: clamp(1.4rem, 3.4vw, 2.2rem);
    color: var(--ink);
    letter-spacing: 0;
}

/* План повторения */

.plan { margin-top: .4rem; }

.plan-weeks {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem .5rem;
}
.plan-week { min-width: 0; }

.plan-tab {
    position: relative;
    width: 100%;
    min-height: 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: 1.4rem .4rem .8rem;
    border: 0;
    cursor: pointer;
    color: var(--ink);
    font-family: var(--serif);
    background: linear-gradient(180deg, #EFE5CF, var(--paper-2));
    clip-path: polygon(0 12px, 16% 12px, 23% 0, 77% 0, 84% 12px, 100% 12px, 100% 100%, 0 100%);
    filter: drop-shadow(0 4px 5px rgba(5, 10, 25, .45));
    transition: transform .15s ease, background-color .15s ease;
}
.plan-tab::after {
    content: "";
    position: absolute;
    left: 8px; right: 8px; bottom: 7px;
    border-bottom: 1px dashed var(--line);
}
.plan-tab:hover { transform: translateY(-4px); }
.plan-num { font-weight: 700; font-size: 1.45rem; line-height: 1; }
.plan-topic { font-size: .92rem; font-weight: 700; line-height: 1.2; text-align: center; max-width: 100%; }
.plan-mark {
    position: absolute;
    top: 16px; right: 8px;
    width: 26px; height: 26px;
    display: grid;
    place-items: center;
    border: 2px solid var(--stamp);
    border-radius: 50%;
    color: var(--stamp);
    font-family: var(--narrow);
    font-size: .95rem;
    line-height: 1;
    opacity: 0;
    transform: rotate(-14deg) scale(.6);
    transition: opacity .15s ease, transform .15s ease;
}
.plan-tab[aria-pressed="true"] { background: linear-gradient(180deg, #E6D9BC, var(--paper-3)); }
.plan-tab[aria-pressed="true"] .plan-topic { text-decoration: line-through; text-decoration-color: var(--stamp); text-decoration-thickness: 2px; }
.plan-tab[aria-pressed="true"] .plan-mark { opacity: 1; transform: rotate(-14deg) scale(1); }

.plan-note {
    margin: 1.3rem 0 0;
    text-align: center;
    color: var(--light-muted);
    font-size: .98rem;
}

/* Разбор задания */

.drill { margin-top: 3rem; }
.drill-sheet { padding: 2rem 1.4rem 2.2rem; }

.drill-grid { position: relative; display: grid; gap: 1.4rem; }
.drill-part { min-width: 0; position: relative; z-index: 1; }

.drill-label {
    display: inline-block;
    margin: 0 0 .55rem;
    padding-bottom: .15rem;
    border-bottom: 2px solid var(--stamp);
    font-size: 1.12rem;
    text-transform: uppercase;
    letter-spacing: .01em;
    color: var(--ink);
}

.drill-text, .drill-list {
    font-style: italic;
    font-size: .98rem;
    line-height: 1.55;
    color: #3A372F;
    margin: 0;
}
.drill-text--task { color: var(--ink); }
.drill-list { padding-left: 1.25rem; }
.drill-list li { margin-bottom: .35rem; padding-left: .2rem; }
.drill-list li::marker { font-style: normal; font-weight: 700; color: var(--ink); }

.drill-scheme {
    position: relative;
    width: 130px;
    height: 100px;
    margin: 0 auto 1.6rem;
}
.scheme-box {
    position: absolute;
    width: 36px; height: 36px;
    display: grid;
    place-items: center;
    border: 2px solid var(--ink);
    background: var(--paper);
    font-weight: 700;
    font-size: 1.15rem;
    box-shadow: 2px 2px 0 var(--line);
}
.scheme-box--1 { left: 0; top: 2px; }
.scheme-box--2 { left: 62px; top: 2px; }
.scheme-box--3 { left: 30px; top: 60px; }
.scheme-box--4 { left: 92px; top: 60px; }
.scheme-arrows { position: absolute; inset: 0; width: 130px; height: 100px; }
.scheme-arrows path {
    fill: none;
    stroke: var(--ink);
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.scheme-legend {
    position: absolute;
    left: -50px; right: -50px; top: 104px;
    margin: 0;
    text-align: center;
    font-family: var(--narrow);
    font-size: .72rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    hyphens: manual;
}

/* Последние записи */

.latest { margin-top: 3.2rem; }

.latest-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2.2rem;
}

.card {
    display: flex;
    flex-direction: column;
    position: relative;
    min-width: 0;
    background: var(--paper);
    color: var(--ink);
    padding: .9rem .9rem 1.2rem;
    box-shadow: 5px 5px 0 -1px var(--paper-2), 10px 9px 0 -2px var(--paper-3), 0 14px 22px rgba(5, 10, 25, .45);
    transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { box-shadow: 5px 5px 0 -1px var(--paper-2), 10px 9px 0 -2px var(--paper-3), 0 20px 28px rgba(5, 10, 25, .55); }

.card-thumb {
    background: var(--thumb-bg);
    overflow: hidden;
    border: 1px solid #E3DBC4;
}
.card-thumb a { display: block; }
.card-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform .3s ease;
}
.card:hover .card-thumb img { transform: scale(1.03); }

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: .9rem .2rem 0;
}
.card-title { margin: 0 0 .5rem; font-size: 1.28rem; line-height: 1.22; }
.card-title a { text-decoration: none; color: var(--ink); }
.card-title a:hover { color: var(--stamp); }
.card-excerpt { font-size: .95rem; line-height: 1.5; color: #3A372F; }
.card-excerpt p { margin: 0 0 .5em; background: none; }
.card-date {
    display: block;
    margin: .3rem 0 1rem;
    font-family: var(--narrow);
    font-size: .8rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
}
.card-more, .btn-frame {
    display: block;
    margin-top: auto;
    padding: .6rem 1rem;
    border: 2px solid var(--gold);
    background: transparent;
    color: var(--ink);
    text-align: center;
    text-decoration: none;
    font-family: var(--narrow);
    font-size: .95rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    transition: background-color .15s ease, color .15s ease, transform .15s ease;
}
.sheet .card-more, .card .card-more { color: var(--ink); }
.card-more:hover, .btn-frame:hover { background: var(--gold); color: var(--head); transform: translate(-2px, -2px); box-shadow: 2px 2px 0 var(--head); }

.latest-all { text-align: center; margin: 2.4rem 0 0; }
.latest-all .btn-frame { display: inline-block; color: var(--light); padding: .65rem 1.6rem; }
.latest-all .btn-frame:hover { color: var(--head); }

.empty-note { margin: 0; text-align: center; }
.latest .empty-note { color: var(--light-muted); }

/* Требования и коллекция тем */

.pair { display: grid; gap: 2.6rem; margin-top: 3.4rem; }
.rules, .topics { min-width: 0; }

.rules-sheet { padding: 2rem 1.4rem 1.6rem; }
.rules-sheet::before {
    background-color: transparent;
    background-image:
        linear-gradient(135deg, #D6C9AC 0, #E9DFC9 48%, transparent 50%),
        linear-gradient(315deg, transparent 32px, var(--paper) 32px);
    background-size: 46px 46px, 100% 100%;
    background-position: right bottom, 0 0;
    background-repeat: no-repeat;
}

.rules-table-wrap { overflow-x: auto; }
.rules-table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid var(--ink);
    font-size: .88rem;
    background: rgba(255, 255, 255, .25);
}
.rules-table th, .rules-table td {
    hyphens: manual;
    border: 1.5px solid var(--ink);
    padding: .65rem .55rem;
    text-align: center;
    vertical-align: middle;
}
.rules-table th {
    font-family: var(--narrow);
    font-size: .82rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: var(--paper-2);
}
.rules-table td:first-child { font-weight: 700; }
.rules-note {
    margin: .9rem 0 0;
    font-size: .85rem;
    font-style: italic;
    color: var(--muted);
}
.rules-stamp {
    display: block;
    width: 112px;
    height: 112px;
    margin: 1.1rem auto 0;
    transform: rotate(-12deg);
    opacity: .78;
}
.rules-stamp circle, .rules-stamp path { fill: none; stroke: var(--ink-blue); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.rules-stamp .rules-stamp-dash { stroke-width: 5; stroke-dasharray: 1.5 5; }

.topics .front-title { margin-top: .4rem; }
.topics-lead { text-align: center; color: var(--light-muted); margin: -.6rem 0 1.4rem; }

.topics-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: .7rem .5rem;
}
.topic { min-width: 0; }
.topic-btn {
    position: relative;
    width: 100%;
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.05rem .5rem .6rem;
    border: 0;
    cursor: pointer;
    font-family: var(--serif);
    font-weight: 700;
    font-size: .76rem;
    line-height: 1.2;
    text-align: center;
    color: var(--ink);
    background: var(--paper);
    clip-path: polygon(0 0, 40% 0, 46% 9px, 100% 9px, 100% 100%, 0 100%);
    filter: drop-shadow(0 3px 3px rgba(5, 10, 25, .45));
    transition: transform .15s ease, filter .15s ease;
}
.topic-name { max-width: 100%; padding: 0 .55rem .35rem 0; }
.topic--b .topic-btn { background: var(--kraft); }
.topic--c .topic-btn { background: var(--rose); }
.topic--d .topic-btn { background: var(--stamp); color: var(--paper); }
.topic-seal {
    position: absolute;
    right: 5px; bottom: 5px;
    width: 15px; height: 15px;
    border: 1.5px solid var(--stamp);
    border-radius: 50%;
    opacity: .75;
    box-shadow: inset 0 0 0 2px transparent, inset 0 0 0 3px rgba(163, 43, 43, .5);
}
.topic--d .topic-seal { border-color: var(--paper); box-shadow: inset 0 0 0 3px rgba(244, 239, 227, .45); }
.topic-btn:hover { transform: translate(-2px, -3px); }
.topic-btn[aria-pressed="true"] {
    outline: 3px solid var(--gold);
    outline-offset: -3px;
}
.topic-btn[aria-pressed="true"] .topic-seal {
    background: var(--stamp);
    border-color: var(--stamp);
    opacity: 1;
}
.topic-btn[aria-pressed="true"] .topic-seal::after {
    content: "✓";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--paper);
    font-size: .7rem;
    font-family: var(--narrow);
}
.topic--d .topic-btn[aria-pressed="true"] .topic-seal { background: var(--paper); }
.topic--d .topic-btn[aria-pressed="true"] .topic-seal::after { color: var(--stamp); }

.topics-count {
    margin: 1.1rem 0 0;
    text-align: center;
    font-family: var(--narrow);
    font-size: .85rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--light-muted);
}
.topics-num { color: var(--gold); }

/* ---------- Внутренние страницы ---------- */

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

.page-head { margin-bottom: 2rem; }
.page-title {
    margin: .3rem 0 .4rem;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    line-height: 1.15;
    color: var(--ink);
}
.page-lead { margin: .4rem 0 0; color: var(--muted); font-style: italic; }
.page-intro { margin-top: .8rem; }

.crumbs {
    font-family: var(--narrow);
    font-size: .82rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: .8rem;
}
.crumbs a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }
.sheet .crumbs a:hover { color: var(--stamp); border-color: var(--stamp); }
.crumbs-sep { color: var(--gold); padding: 0 .2rem; }

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

.entry { margin-bottom: 2rem; }
.entry-meta {
    margin: 0 0 1.4rem;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem 1.2rem;
    font-family: var(--narrow);
    font-size: .82rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}
.entry-meta a { color: var(--stamp); text-decoration: none; }
.entry-figure { margin: 0 0 1.6rem; }
.entry-figure img { width: 100%; border: 1px solid var(--line); }

.entry-content { font-size: 1.05rem; line-height: 1.72; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content h2 { font-size: 1.6rem; padding-bottom: .3rem; border-bottom: 2px solid var(--stamp); display: table; }
.entry-content h3 { font-size: 1.3rem; }
.entry-content a { color: var(--stamp); text-decoration: underline; }
.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(--stamp); }
.entry-content blockquote {
    margin: 1.6em 0;
    padding: 1.1rem 1.4rem 1.1rem 1.6rem;
    background: var(--paper-2);
    border-left: 5px solid var(--stamp);
    font-style: italic;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: .95rem; border: 2px solid var(--ink); }
.entry-content th, .entry-content td { border: 1px solid var(--ink); padding: .55rem .7rem; text-align: left; }
.entry-content th { background: var(--paper-2); font-family: var(--narrow); letter-spacing: .06em; text-transform: uppercase; font-size: .85rem; }
.entry-content img { max-width: 100%; height: auto; }
.entry-content figure { margin: 1.4em 0; }
.entry-content figcaption { font-size: .85rem; color: var(--muted); margin-top: .4rem; }
.entry-content pre { overflow-x: auto; padding: 1rem; background: var(--paper-2); border: 1px solid var(--line); }
.entry-content hr { border: 0; border-top: 2px dashed var(--line); margin: 2em 0; }

.entry-tags { margin: 1.6rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.entry-tags a {
    padding: .2rem .6rem;
    border: 1px solid var(--line);
    background: var(--paper-2);
    text-decoration: none;
    font-family: var(--narrow);
    font-size: .85rem;
    letter-spacing: .06em;
}

.entry-nav {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.4rem;
    border-top: 2px solid var(--line);
}
.entry-nav a { display: block; text-decoration: none; font-weight: 700; line-height: 1.3; }
.entry-nav span {
    display: block;
    font-family: var(--narrow);
    font-weight: 700;
    font-size: .78rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: .2rem;
}
.entry-nav-next { text-align: right; }

/* Сайдбар */

.sidebar {
    margin-top: 2.4rem;
    min-width: 0;
    align-self: start;
    background: var(--paper-2);
    color: var(--ink);
    padding: 1.4rem 1.3rem;
    border-top: 5px solid var(--gold);
    box-shadow: var(--shadow);
}
.sidebar .widget + .widget { margin-top: 1.8rem; }
.sidebar .widget-title {
    margin: 0 0 .9rem;
    padding-bottom: .4rem;
    border-bottom: 2px solid var(--stamp);
    font-size: 1.05rem;
    text-transform: uppercase;
    color: var(--ink);
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: .55rem 0; border-bottom: 1px dashed var(--line); line-height: 1.35; }
.sidebar li:last-child { border-bottom: 0; }
.sidebar a { color: var(--ink); text-decoration: none; }
.sidebar a:hover { color: var(--stamp); text-decoration: underline; }
.sidebar .post-date { display: block; font-size: .8rem; color: var(--muted); }
.sidebar p { color: var(--ink); }

/* Пагинация */

.pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .45rem;
    margin: 2.6rem 0 0;
}
.pager .page-numbers {
    min-width: 2.6rem;
    padding: .45rem .8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--paper);
    color: var(--ink);
    border: 2px solid var(--gold);
    font-family: var(--narrow);
    font-size: .95rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-decoration: none;
    transition: transform .15s ease, background-color .15s ease;
}
.pager a.page-numbers:hover { background: var(--gold); color: var(--head); transform: translate(-2px, -2px); box-shadow: 2px 2px 0 var(--head); }
.pager .page-numbers.current { background: var(--stamp); border-color: var(--stamp); color: var(--paper); }
.pager .page-numbers.dots { background: transparent; border-color: transparent; color: var(--light); min-width: 0; }
.pager--inner { justify-content: flex-start; margin-top: 1.4rem; }
.pager--inner .post-page-numbers {
    padding: .3rem .7rem;
    border: 2px solid var(--gold);
    text-decoration: none;
    font-family: var(--narrow);
}
.pager--inner .post-page-numbers.current { background: var(--stamp); color: var(--paper); border-color: var(--stamp); }

/* Поиск */

.finder { display: flex; gap: .5rem; margin: 1rem 0; max-width: 34rem; }
.finder-field {
    flex: 1;
    min-width: 0;
    padding: .65rem .85rem;
    border: 2px solid var(--line);
    background: #FBF8F1;
    color: var(--ink);
    font-family: var(--serif);
    font-size: 1rem;
}
.finder-field:focus { border-color: var(--gold); outline: none; }
.finder-btn {
    padding: .6rem 1.2rem;
    border: 2px solid var(--head);
    background: var(--head);
    color: var(--light);
    font-family: var(--narrow);
    font-size: .95rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    cursor: pointer;
}
.finder-btn:hover { background: var(--gold); border-color: var(--gold); color: var(--head); }

/* 404 */

.lost { text-align: center; padding: 2.6rem 1.4rem 3rem; overflow: hidden; }
.lost-code {
    margin: 0;
    font-size: clamp(4.5rem, 16vw, 8rem);
    font-weight: 700;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 2px var(--ink);
}
.lost-text { max-width: 34rem; margin: 0 auto 1rem; color: var(--muted); }
.lost .finder { margin-inline: auto; }
.lost-home { margin: 1.4rem 0 0; }
.lost-home .btn-frame { display: inline-block; }
.lost-stamp {
    position: absolute;
    top: 1.6rem; right: 1.2rem;
    padding: .1rem .6rem;
    border: 2px solid var(--stamp);
    color: var(--stamp);
    font-family: var(--narrow);
    text-transform: uppercase;
    letter-spacing: .1em;
    transform: rotate(8deg);
    opacity: .85;
}

/* Комментарии */

.notes { margin-top: 2rem; }
.notes-title, .comment-reply-title { margin: 0 0 1.2rem; font-size: 1.4rem; text-transform: uppercase; }
.notes-list, .notes-list .children { list-style: none; margin: 0; padding: 0; }
.notes-list .children { margin-left: 1.4rem; padding-left: 1rem; border-left: 2px dashed var(--line); }
.note-body { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.note-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .8rem; margin-bottom: .5rem; }
.note-meta img { border-radius: 50%; display: block; }
.note-author { font-weight: 700; }
.note-date { font-family: var(--narrow); font-size: .8rem; letter-spacing: .12em; color: var(--muted); }
.note-moderation { font-style: italic; color: var(--stamp); }
.note-reply a { font-family: var(--narrow); text-transform: uppercase; letter-spacing: .1em; font-size: .85rem; color: var(--stamp); }
.notes-closed { font-style: italic; color: var(--muted); }
.comment-respond { margin-top: 1.6rem; }
.comment-form p { margin: 0 0 1rem; }
.comment-form label { display: block; font-family: var(--narrow); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .3rem; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
    width: 100%;
    padding: .6rem .75rem;
    border: 2px solid var(--line);
    background: #FBF8F1;
    font-family: var(--serif);
    font-size: 1rem;
    color: var(--ink);
}
.comment-form-cookies-consent { display: flex; gap: .5rem; align-items: flex-start; }
.comment-form-cookies-consent label { text-transform: none; letter-spacing: 0; font-family: var(--serif); font-size: .9rem; }
.form-note { font-size: .9rem; color: var(--muted); }
.comment-form .submit {
    padding: .7rem 1.6rem;
    border: 2px solid var(--stamp);
    background: var(--stamp);
    color: var(--paper);
    font-family: var(--narrow);
    font-size: 1rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    cursor: pointer;
}
.comment-form .submit:hover { background: var(--head); border-color: var(--head); }
.comments-navigation .nav-links { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1rem; }

/* ---------- Подвал ---------- */

.colophon {
    background: var(--head);
    color: var(--light-muted);
    border-top: 2px solid var(--gold);
    box-shadow: inset 0 6px 0 var(--head), inset 0 7px 0 rgba(201, 162, 39, .45);
    padding: 2.6rem 0 1.4rem;
}
.colophon-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
.colophon-col { min-width: 0; }
.colophon .widget-title {
    margin: 0 0 .8rem;
    font-size: 1.15rem;
    line-height: 1.25;
    color: var(--light);
}
.colophon .widget, .colophon p { color: var(--light-muted); font-size: .93rem; line-height: 1.55; }
.colophon a { color: var(--light); text-decoration: none; }
.colophon a:hover { color: var(--gold); text-decoration: underline; }
.colophon ul { list-style: none; margin: 0; padding: 0; }
.colophon li { padding: .22rem 0; }
.colophon .post-date { color: var(--light-muted); }
.colophon-copy {
    margin: 2.2rem 0 0;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(201, 162, 39, .35);
    text-align: center;
    font-family: var(--narrow);
    font-size: .82rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--light-muted);
}

/* ---------- Cookie-баннер ---------- */

.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    z-index: 50;
    width: min(92%, 760px);
    transform: translateX(-50%);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .8rem 1.2rem;
    padding: 1rem 1.3rem;
    background: var(--paper);
    color: var(--ink);
    border: 2px solid var(--gold);
    box-shadow: 6px 6px 0 var(--head), 0 12px 24px rgba(5, 10, 25, .5);
}
.cookie-text { flex: 1 1 320px; margin: 0; font-size: .92rem; line-height: 1.45; min-width: 0; }
.cookie-accept {
    flex: 0 0 auto;
    padding: .6rem 1.5rem;
    border: 2px solid var(--stamp);
    background: var(--stamp);
    color: var(--paper);
    font-family: var(--narrow);
    font-size: .95rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    cursor: pointer;
}
.cookie-accept:hover { background: var(--head); border-color: var(--head); }

/* ---------- Адаптив ---------- */

@media (min-width: 600px) {
    .sheet { padding: 2.2rem 2.2rem; }
    .drill-sheet { padding: 2.4rem 2.4rem 2.6rem; }
    .rules-sheet { padding: 2.4rem 2rem 1.8rem; }
    .plan-weeks { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .card-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .latest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .colophon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .entry-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .brand-seal, .brand-logo { width: 88px; height: 88px; }
}

@media (min-width: 960px) {
    .nav-toggle { display: none; }
    .topnav { display: block; width: auto; flex: 0 0 auto; }
    .topnav-list { border-top: 0; padding: 0; }
    .topnav-list a { padding: .22rem 0; }

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

    .plan-weeks { grid-template-columns: repeat(6, minmax(0, 1fr)) minmax(0, 1.55fr) minmax(0, 1fr); gap: .4rem; }
    .plan-topic { font-size: .8rem; hyphens: manual; }

    .drill-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, .95fr);
        grid-template-areas:
            "cond cond scheme"
            "check steps error";
        column-gap: 2.4rem;
        row-gap: 2.2rem;
    }
    .drill-cond { grid-area: cond; }
    .drill-check { grid-area: check; padding-left: 1.6rem; }
    .drill-steps { grid-area: steps; }
    .drill-error { grid-area: error; padding-top: 3.4rem; }
    .drill-check::before, .drill-steps::before, .drill-error::before {
        content: "";
        position: absolute;
        background-repeat: no-repeat;
        background-size: 100% 100%;
        pointer-events: none;
    }
    .drill-check::before { left: 0; top: -2.4rem; width: 24px; height: 58px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 58'%3E%3Cpath d='M16 2C3 14 2 36 14 54M8 50l6 4 1-7' fill='none' stroke='%231A1A1A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
    .drill-steps::before { left: -2.4rem; top: -1.7rem; width: 36px; height: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36'%3E%3Cpath d='M2 2C5 18 14 27 33 29M27 24l6 5-7 3' fill='none' stroke='%231A1A1A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
    .drill-error::before { left: -2.3rem; top: .6rem; width: 44px; height: 46px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 46'%3E%3Cpath d='M2 4C24 3 37 17 39 42M34 37l5 6 3-7' fill='none' stroke='%231A1A1A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
    .drill-scheme { grid-area: scheme; justify-self: center; align-self: start; margin: 0; }

    .latest-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.4rem; align-items: start; }
    .latest-grid .card:nth-child(1) { transform: rotate(-1.4deg); }
    .latest-grid .card:nth-child(2) { transform: rotate(.9deg); margin-top: 1.4rem; }
    .latest-grid .card:nth-child(3) { transform: rotate(-.6deg); margin-top: .5rem; }
    .latest-grid .card:hover { transform: rotate(0) translateY(-4px); }

    .pair {
        grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
        gap: 3rem;
        align-items: start;
    }
    .rules-sheet { transform: rotate(-.6deg); }

    .colophon-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr) minmax(0, 1.1fr); gap: 3rem; }
    .card-list { gap: 2.4rem; }
}

@media (min-width: 1200px) {
    .plan-topic { font-size: .86rem; }
}

@media (max-width: 600px) {
    .sheet { padding: 1.5rem 1.15rem; }
    .drill-sheet, .rules-sheet { padding: 1.6rem 1.15rem 1.8rem; }
    .tabstrip { height: 44px; }
    .tabstrip-paper { height: 30px; }
    .tabstrip-ribbon { height: 40px; width: 16px; }
    .tabstrip-stamp { font-size: .78rem; right: 14%; top: 4px; }
    .rules-table { font-size: .82rem; }
    .rules-table th, .rules-table td { padding: .5rem .3rem; }
    .lost-stamp { position: static; display: inline-block; margin-bottom: 1rem; }
    .cookie-banner { padding: 1rem 1.1rem; bottom: .6rem; }
    .cookie-accept { width: 100%; }
}

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