/*
Theme Name: dds_petrovskiyproekt.ru
Author: Осипов Ярослав Андреевич
Description: Тема информационного сайта «Петровская эпоха и реформы — На всех парусах»: разворот морского атласа начала XVIII века — чертёж корабля, навигационная карта, медь и чернила на состаренной бумаге.
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: nvsp
*/

/* ---------- Шрифты ---------- */
@font-face { font-family: "Oranienbaum"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/oranienbaum-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: "Oranienbaum"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/oranienbaum-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: 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: 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 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; }

/* ---------- Палитра ---------- */
:root {
    --deep: #0F2233;
    --deep-ink: #0A1926;
    --deep-panel: #14293C;
    --parch: #E8DCC0;
    --parch-sheet: #F0E6CF;
    --parch-back: #DFCFAE;
    --ivory: #F2E9D8;
    --ink: #1C2A38;
    --muted-dark: #8A9BAE;
    --muted-parch: #6B5F4A;
    --copper: #B87333;
    --copper-deep: #8C5526;
    --gold: #C9A227;
    --line: #3D5A73;
    --font-head: "Oranienbaum", "Cormorant Garamond", "Times New Roman", Georgia, serif;
    --font-text: "PT Serif", Georgia, "Times New Roman", serif;
    --bevel: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
    --chart-bg: linear-gradient(rgba(61, 90, 115, .16) 1px, transparent 1px), linear-gradient(90deg, rgba(61, 90, 115, .16) 1px, transparent 1px), url("images/texture-chart.jpg");
    --parch-bg: repeating-linear-gradient(-45deg, rgba(28, 42, 56, .028) 0 1px, transparent 1px 7px), url("images/texture-parchment.jpg");
}

/* ---------- Сброс и база ---------- */
*, *::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-text);
    font-size: 1rem;
    line-height: 1.75;
    color: var(--ivory);
    background-color: var(--deep);
    background-image: var(--chart-bg);
    background-size: 72px 72px, 72px 72px, 720px 336px;
    overflow-wrap: break-word;
}
p, li, dd, dt, h1, h2, h3, h4, h5, h6, blockquote, figcaption, td, th { hyphens: auto; overflow-wrap: break-word; }
p { margin: 0 0 1em; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-head); font-weight: 400; line-height: 1.15; margin: 1.4em 0 .55em; letter-spacing: .01em; }
img, svg, video { max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-color: var(--copper); text-decoration-thickness: 1px; text-underline-offset: .22em; transition: color .15s, text-decoration-color .15s; }
a:hover { color: var(--copper); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
button { font: inherit; }
table { width: 100%; border-collapse: collapse; margin: 1.4em 0; border: 1px solid var(--line); }
th, td { border: 1px solid var(--line); padding: .55em .8em; text-align: start; vertical-align: top; }
th { font-family: var(--font-head); font-weight: 400; font-size: 1.1em; }

.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-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--ivory); color: var(--ink); padding: .6rem 1rem; }
.skip-link:focus { top: 1rem; }

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

/* ---------- Кнопки со скошенными углами ---------- */
.btn-bevel {
    --btn-bg: var(--parch-sheet);
    --btn-fg: var(--ink);
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4em;
    padding: .5em 1.5em .6em;
    border: 0;
    background: var(--copper);
    color: var(--btn-fg);
    clip-path: var(--bevel);
    font-family: var(--font-text);
    font-size: .95rem;
    font-variant-caps: all-small-caps;
    letter-spacing: .08em;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
    transition: color .12s;
}
.btn-bevel::before { content: ""; position: absolute; inset: 1px; z-index: -1; background: var(--btn-bg); clip-path: var(--bevel); transition: background .12s; }
.btn-bevel:hover, .btn-bevel:focus-visible { --btn-bg: var(--copper); --btn-fg: var(--ivory); color: var(--ivory); }
.btn-bevel--small { font-size: .88rem; padding: .35em 1.1em .45em; }

/* ---------- Шапка ---------- */
.masthead {
    position: relative;
    background-color: var(--deep-ink);
    background-image: linear-gradient(rgba(5, 14, 23, .55), rgba(5, 14, 23, .55)), url("images/texture-chart.jpg");
    background-size: auto, 720px 336px;
    color: var(--ivory);
}
.masthead-row { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 1.4rem 0 1.3rem; }
.brand { display: flex; align-items: center; gap: 1.25rem; text-decoration: none; color: var(--ivory); min-width: 0; }
.brand:hover { color: var(--ivory); }
.brand-mark { flex: 0 0 auto; display: block; width: 68px; }
.brand-compass { display: block; width: 68px; height: 85px; }
.brand-logo { display: block; width: 68px; height: auto; }
.brand-text { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.brand-name { font-family: var(--font-head); font-size: clamp(1.55rem, 2.5vw, 2.35rem); line-height: 1.06; max-width: 14em; }
.brand-tagline { font-size: .86rem; line-height: 1.4; color: var(--ivory); opacity: .82; max-width: 30em; }

.topnav { flex: 0 0 auto; }
.topnav-toggle { display: none; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.7rem; }
.nav-list a { display: inline-block; padding: .2rem 0; color: var(--ivory); text-decoration: none; font-size: 1rem; border-bottom: 1px solid transparent; }
.nav-list a:hover, .nav-list .current-menu-item > a, .nav-list .current_page_item > a { color: var(--copper); border-bottom-color: var(--copper); }

.rhumb-rule {
    height: 7px;
    background:
        repeating-linear-gradient(90deg, var(--deep-ink) 0 16px, transparent 16px 44px) center / 100% 3px no-repeat,
        linear-gradient(var(--copper), var(--copper-deep));
}

/* ---------- Полосы главной ---------- */
.sea-band { position: relative; overflow: hidden; padding: 2.6rem 0 3.4rem; }
.sea-band > .shell { position: relative; z-index: 1; }
.sea-band--chart { background-color: var(--deep); background-image: var(--chart-bg); background-size: 72px 72px, 72px 72px, 720px 336px; color: var(--ivory); }
.sea-band--chart::before {
    content: "";
    position: absolute;
    top: -70px;
    right: -70px;
    width: 260px;
    height: 260px;
    background: url("images/compass-rose.svg") center / contain no-repeat;
    opacity: .6;
    pointer-events: none;
}
.sea-band--parchment { background-color: var(--parch); background-image: var(--parch-bg); background-size: auto, 696px 660px; color: var(--ink); box-shadow: inset 0 12px 18px -14px rgba(28, 42, 56, .35), inset 0 -12px 18px -14px rgba(28, 42, 56, .35); }

.band-title { margin: 0 0 1.2rem; text-align: center; font-size: clamp(2rem, 3.4vw, 2.85rem); color: var(--ivory); }
.band-title::after {
    content: "";
    display: block;
    width: 170px;
    height: 10px;
    margin: .45rem auto 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 170 10'%3E%3Cpath d='M0 5H74M96 5H170' stroke='%23B87333' stroke-width='1.2'/%3E%3Cpath d='M85 1l4 4-4 4-4-4z' fill='%23B87333'/%3E%3C/svg%3E") center / contain no-repeat;
}
.band-title--ink { color: var(--ink); }
.band-title--left { text-align: start; }
.band-title--left::after { margin-inline: 0; }

/* ---------- Блок 1: Чертёж реформ ---------- */
.blueprint::after {
    content: "";
    position: absolute;
    left: -60px;
    bottom: -70px;
    width: 230px;
    height: 230px;
    background: url("images/compass-rose.svg") center / contain no-repeat;
    opacity: .5;
    pointer-events: none;
}
.blueprint { padding-bottom: 4.6rem; }
.blueprint-stage { position: relative; aspect-ratio: 1000 / 450; margin-top: .8rem; }
.blueprint-leaders { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.blueprint-ship { position: absolute; left: 30%; top: 8%; width: 47%; height: auto; display: block; }
.blueprint-nodes { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; }
.medal-node { position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); width: 7.6%; transform: translate(-50%, -50%); cursor: pointer; outline-offset: 6px; }
.medal {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #EBB27C 0, #C27C3D 38%, var(--copper) 58%, #6E411F 100%);
    box-shadow: inset 0 0 0 3px rgba(70, 36, 12, .45), inset 0 0 0 5px rgba(255, 222, 186, .28);
    color: #3B2310;
    transition: transform .15s;
}
.medal svg { width: 58%; height: 58%; display: block; }
.medal-label { position: absolute; top: calc(100% + .45rem); left: 50%; transform: translateX(-50%); width: max-content; max-width: 10em; text-align: center; font-size: .98rem; line-height: 1.25; color: var(--ivory); }
.medal-note {
    position: absolute;
    top: calc(100% + 3.4rem);
    left: 50%;
    z-index: 5;
    width: 16em;
    padding: .75rem .95rem;
    transform: translate(-50%, 6px);
    background: var(--parch-sheet);
    color: var(--ink);
    border: 1px solid var(--copper);
    font-size: .86rem;
    line-height: 1.5;
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s, transform .15s, visibility .15s;
}
.medal-node--up .medal-note { top: auto; bottom: calc(100% + .7rem); }
.medal-node:hover .medal, .medal-node:focus-visible .medal, .medal-node.is-active .medal { transform: scale(1.08); }
.medal-node:hover .medal-note, .medal-node:focus .medal-note, .medal-node.is-active .medal-note { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* ---------- Блок 2: Хроника ---------- */
.chronicle { padding-bottom: 2.6rem; }
.chronicle-line { --vig: 128px; position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; list-style: none; margin: 1.8rem 0 0; padding: 0; }
.chronicle-line::before { content: ""; position: absolute; left: -2%; right: -1%; top: calc(var(--vig) + 24px); height: 2px; background: var(--copper); }
.chronicle-line::after { content: ""; position: absolute; right: -2%; top: calc(var(--vig) + 19px); border-style: solid; border-width: 6px 0 6px 13px; border-color: transparent transparent transparent var(--copper); }
.chronicle-point { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.chronicle-vignette { display: block; width: var(--vig); aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--copper); box-shadow: 0 0 0 4px var(--parch), 0 0 0 5px rgba(184, 115, 51, .55); overflow: hidden; background: var(--parch-sheet); }
.chronicle-vignette img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.chronicle-tick { display: block; width: 2px; height: 22px; background: var(--copper); margin-top: 3px; }
.chronicle-tick::after { content: ""; display: block; width: 9px; height: 9px; margin: 18px 0 0 -3.5px; background: var(--parch); border: 2px solid var(--copper); transform: rotate(45deg); }
.chronicle-year { margin-top: .5rem; font-family: var(--font-head); font-size: clamp(2rem, 3vw, 2.7rem); line-height: 1; color: var(--ink); }
.chronicle-event { margin-top: .35rem; font-size: .88rem; line-height: 1.4; color: var(--muted-parch); max-width: 13em; }
.chronicle-facts { display: flex; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; list-style: none; margin: 2rem 0 0; padding: 1rem 0 0; border-top: 1px solid rgba(28, 42, 56, .25); font-size: .9rem; line-height: 1.45; }
.chronicle-facts li { position: relative; padding-inline-start: 1.1rem; flex: 1 1 14em; min-width: 0; }
.chronicle-facts li::before { content: ""; position: absolute; left: 0; top: .5em; width: 6px; height: 6px; background: var(--copper); transform: rotate(45deg); }

/* ---------- Блок 3: Карта ---------- */
.atlas { padding-bottom: 0; }
.atlas .band-title { margin-bottom: 0; }
.atlas-rose { position: absolute; left: 1%; bottom: -70px; width: 270px; height: 270px; opacity: .85; pointer-events: none; z-index: 0; }
.atlas::before { top: -40px; right: -90px; }
.atlas-stage { position: relative; width: 88%; margin-left: 17%; aspect-ratio: 1632 / 768; margin-top: -1.2rem; }
.atlas-map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.atlas-tag { position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); transform: translateY(-50%); cursor: pointer; z-index: 2; }
.atlas-tag::before { content: ""; position: absolute; left: -15px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; border: 2px solid var(--ivory); background: var(--copper); }
.atlas-tag-label {
    display: block;
    padding: .3em 1em .38em;
    background: var(--parch-sheet);
    color: var(--ink);
    clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
    font-size: .95rem;
    line-height: 1.3;
    white-space: nowrap;
    transition: background .12s, color .12s;
}
.atlas-tag:hover .atlas-tag-label, .atlas-tag:focus-visible .atlas-tag-label, .atlas-tag.is-active .atlas-tag-label { background: var(--copper); color: var(--ivory); }
.atlas-tag-note {
    position: absolute;
    top: calc(100% + .5rem);
    left: 0;
    width: 17em;
    padding: .7rem .9rem;
    background: var(--deep-ink);
    color: var(--ivory);
    border: 1px solid var(--copper);
    font-size: .85rem;
    line-height: 1.5;
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s, visibility .15s;
}
.atlas-tag:hover .atlas-tag-note, .atlas-tag:focus .atlas-tag-note, .atlas-tag.is-active .atlas-tag-note { opacity: 1; visibility: visible; z-index: 6; }
.atlas-tag:hover, .atlas-tag:focus, .atlas-tag.is-active { z-index: 6; }
.atlas-legend { display: none; margin: 0; }

/* ---------- Морские журналы (карточки) ---------- */
.journals { padding-bottom: 2.4rem; box-shadow: inset 0 12px 18px -14px rgba(28, 42, 56, .35); }
.journal-desk { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.4rem; align-items: start; padding: .6rem 0 1rem; }
.journal-desk .card:nth-child(1) { transform: rotate(-.6deg); }
.journal-desk .card:nth-child(2) { margin-top: 1.4rem; transform: rotate(.5deg); }
.journal-desk .card:nth-child(3) { margin-top: .5rem; transform: rotate(-.3deg); }
.journals-more { text-align: center; margin: 1.6rem 0 0; }

.card { position: relative; display: flex; flex-direction: column; min-width: 0; overflow: visible; }
.card::before { content: ""; position: absolute; inset: 7px -7px -7px 7px; background: var(--parch-back); border: 1px solid rgba(28, 42, 56, .55); transform: rotate(1.3deg); }
.card-sheet { position: relative; flex: 1; display: flex; flex-direction: column; padding: .85rem; background: var(--parch-sheet); border: 1px solid var(--ink); color: var(--ink); transition: transform .12s; }
.card:hover .card-sheet, .card:focus-within .card-sheet { transform: translate(-4px, -4px); }
.card-vignette { display: block; padding: 4px; border: 3px double var(--copper); background: var(--parch); }
.card-vignette img { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: cover; filter: sepia(.18); }
.card-body { flex: 1; display: flex; flex-direction: column; min-width: 0; padding: .3rem .15rem 0; }
.card-title { margin: .75rem 0 .4rem; font-size: 1.5rem; line-height: 1.12; color: var(--ink); }
.card-title a { text-decoration: none; background: linear-gradient(var(--copper), var(--copper)) 0 100% / 0 1px no-repeat; transition: background-size .2s; }
.card-title a:hover { color: var(--ink); background-size: 100% 1px; }
.card-excerpt { font-size: .9rem; line-height: 1.6; color: #2E3A46; }
.card-excerpt p { margin: 0 0 .5em; background: none; }
.card-excerpt a { color: var(--ink); }
.card-foot { margin-top: auto; padding-top: .5rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; }
.card-date { font-size: .8rem; color: var(--muted-parch); letter-spacing: .03em; }
.card.sticky .card-sheet { border-color: var(--copper); }

.empty-note { font-style: italic; color: inherit; opacity: .85; text-align: center; margin: 1rem 0; }

/* ---------- Блок 4: Разбор указа ---------- */
.decree { padding-top: 1.6rem; box-shadow: inset 0 -12px 18px -14px rgba(28, 42, 56, .35); }
.decree::before { content: ""; position: absolute; left: 7.5%; right: 7.5%; top: 0; height: 1px; background: repeating-linear-gradient(90deg, rgba(28, 42, 56, .4) 0 6px, transparent 6px 10px); }
.decree-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 2.5rem; align-items: center; }
.decree-head { position: relative; min-width: 0; }
.decree-scroll { position: relative; z-index: 2; display: block; width: min(250px, 78%); margin: -.6rem -2.8rem 0 auto; transform: rotate(-4deg); }
.decree-body { position: relative; z-index: 1; min-width: 0; }
.decree-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.decree-list li { display: grid; grid-template-columns: 2rem minmax(0, 1fr); column-gap: .9rem; align-items: baseline; }
.decree-num { grid-row: span 2; align-self: start; display: grid; place-items: center; width: 1.85rem; height: 1.85rem; margin-top: .15rem; background: var(--copper); color: var(--ivory); font-family: var(--font-head); font-size: 1.15rem; line-height: 1; clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 0 calc(100% - 4px), 0 4px); }
.decree-q { font-size: 1.35rem; line-height: 1.2; font-variant-caps: small-caps; letter-spacing: .02em; color: var(--ink); }
.decree-a { font-size: .88rem; line-height: 1.45; color: var(--muted-parch); }
.decree-line { margin: 1.3rem 0 0; padding-top: .8rem; border-top: 1px solid rgba(184, 115, 51, .6); font-size: .9rem; font-style: italic; color: var(--ink); }

/* ---------- Подвал ---------- */
.colophon {
    position: relative;
    overflow: hidden;
    background-color: var(--deep-ink);
    background-image: linear-gradient(rgba(5, 14, 23, .55), rgba(5, 14, 23, .55)), url("images/texture-chart.jpg");
    background-size: auto, 720px 336px;
    color: var(--ivory);
    padding: 2.6rem 0 1.4rem;
    border-top: 3px solid var(--copper-deep);
}
.colophon::before, .colophon::after { content: ""; position: absolute; bottom: -150px; width: 320px; height: 320px; background: url("images/compass-rose.svg") center / contain no-repeat; opacity: .55; pointer-events: none; }
.colophon::before { left: -160px; }
.colophon::after { right: -160px; }
.colophon-cols { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 3.5rem; }
.colophon-col { min-width: 0; }
.colophon .widget { margin: 0 0 1.2rem; color: var(--ivory); font-size: .9rem; line-height: 1.6; }
.colophon .widget-title { margin: 0 0 .7rem; font-size: 1.65rem; color: var(--ivory); }
.colophon .widget p { color: var(--ivory); opacity: .88; }
.colophon .widget a { color: var(--ivory); text-decoration: underline; text-decoration-color: var(--copper); }
.colophon .widget a:hover { color: var(--copper); }
.colophon .widget ul { list-style: none; margin: 0; padding: 0; }
.colophon .widget li { margin: 0 0 .45rem; }
.colophon .widget .post-date { color: var(--muted-dark); }
.colophon-copy { position: relative; z-index: 1; margin-top: 1.6rem; padding-top: 1rem; border-top: 1px solid rgba(61, 90, 115, .6); text-align: center; font-size: .82rem; color: var(--muted-dark); }

/* ---------- Внутренние страницы ---------- */
.inner-page { padding: 1.6rem 0 4rem; }
.crumbs { margin: 0 0 1.6rem; font-size: .88rem; color: var(--muted-dark); }
.crumbs a { color: var(--ivory); text-decoration: underline; text-decoration-color: var(--copper); }
.crumbs a:hover { color: var(--copper); }
.crumbs-sep { color: var(--copper); margin: 0 .2em; }

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

.page-head { margin-bottom: 1.8rem; }
.page-title { margin: 0 0 .5rem; font-size: clamp(2.2rem, 4vw, 3.2rem); color: var(--ivory); }
.page-title::after { content: ""; display: block; width: 110px; height: 2px; margin-top: .6rem; background: var(--copper); }
.page-lede { color: var(--muted-dark); max-width: 42em; margin: .6rem 0 0; }
.page-lede p { margin: 0; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.4rem 2.2rem; }
.layout-with-sidebar .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.paper-sheet {
    position: relative;
    padding: clamp(1.4rem, 4vw, 3rem);
    background-color: var(--parch);
    background-image: var(--parch-bg);
    background-size: auto, 696px 660px;
    color: var(--ink);
    border: 1px solid var(--copper);
    outline: 1px solid rgba(184, 115, 51, .4);
    outline-offset: 5px;
}
.paper-sheet + .paper-sheet { margin-top: 2.4rem; }
.entry-head { margin-bottom: 1.4rem; }
.entry-title { margin: 0 0 .5rem; font-size: clamp(2rem, 3.6vw, 2.9rem); color: var(--ink); }
.entry-meta { margin: 0; font-size: .85rem; color: var(--muted-parch); display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.entry-meta a { color: var(--ink); }
.entry-cover { margin: 0 0 1.6rem; padding: 5px; border: 3px double var(--copper); }
.entry-cover img { display: block; width: 100%; }
.entry-content { font-size: 1.04rem; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content h2 { font-size: 2rem; }
.entry-content h3 { font-size: 1.6rem; }
.entry-content h4 { font-size: 1.3rem; }
.entry-content a { color: var(--ink); text-decoration-color: var(--copper); }
.entry-content a:hover { color: var(--copper-deep); }
.entry-content ul, .entry-content ol { padding-inline-start: 1.4em; margin: 0 0 1.2em; }
.entry-content li { margin-bottom: .35em; }
.entry-content ul li::marker { color: var(--copper); }
.entry-content ol li::marker { color: var(--copper-deep); font-family: var(--font-head); }
.entry-content blockquote { margin: 1.6em 0; padding: 1rem 1.4rem 1rem 1.6rem; border-inline-start: 3px solid var(--copper); background: rgba(184, 115, 51, .08); font-style: italic; }
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content table, .entry-content th, .entry-content td { border-color: rgba(28, 42, 56, .55); }
.entry-content th { background: rgba(184, 115, 51, .14); }
.entry-content figure { margin: 1.6em 0; }
.entry-content figcaption { font-size: .85rem; color: var(--muted-parch); margin-top: .4em; }
.entry-content pre { overflow-x: auto; background: rgba(28, 42, 56, .08); padding: 1rem; }
.entry-content hr { border: 0; height: 10px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 170 10'%3E%3Cpath d='M0 5H74M96 5H170' stroke='%23B87333' stroke-width='1.2'/%3E%3Cpath d='M85 1l4 4-4 4-4-4z' fill='%23B87333'/%3E%3C/svg%3E") center / 170px 10px no-repeat; margin: 2em 0; }
.alignleft { float: left; margin: .3em 1.4em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.4em; }
.aligncenter { display: block; margin-inline: auto; }
.entry-tags { margin: 1.6rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .88rem; }
.entry-tags a { color: var(--copper-deep); }
.page-links { margin-top: 1.4rem; }

.entry-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; margin: 2.2rem 0; }
.entry-nav-link { display: block; padding: 1rem 1.2rem; border: 1px solid var(--line); background: rgba(10, 25, 38, .6); color: var(--ivory); text-decoration: none; font-family: var(--font-head); font-size: 1.2rem; line-height: 1.25; transition: border-color .12s, transform .12s; }
.entry-nav-link span { display: block; font-family: var(--font-text); font-size: .8rem; color: var(--muted-dark); margin-bottom: .3rem; }
.entry-nav-link--next { text-align: end; grid-column: 2; }
.entry-nav-link:hover { border-color: var(--copper); color: var(--ivory); transform: translateY(-3px); }

.lost-page { text-align: center; }
.lost-code { margin: 0; font-family: var(--font-head); font-size: clamp(5rem, 14vw, 9rem); line-height: 1; color: var(--copper); }
.lost-page .seek-form { max-width: 30rem; margin: 1.6rem auto; }

/* ---------- Сайдбар ---------- */
.sidebar { min-width: 0; padding: 1.5rem 1.4rem; background: var(--deep-panel); border: 1px solid var(--line); color: var(--ivory); }
.sidebar .widget { margin: 0 0 1.8rem; font-size: .93rem; line-height: 1.6; color: var(--ivory); }
.sidebar .widget:last-child { margin-bottom: 0; }
.sidebar .widget-title { margin: 0 0 .9rem; font-size: 1.55rem; color: var(--ivory); }
.sidebar .widget-title::after { content: ""; display: block; width: 52px; height: 2px; margin-top: .4rem; background: var(--copper); }
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li { padding: .5rem 0; border-bottom: 1px dashed rgba(138, 155, 174, .35); }
.sidebar .widget li:last-child { border-bottom: 0; }
.sidebar .widget a { color: var(--ivory); text-decoration: none; }
.sidebar .widget a:hover { color: var(--copper); }
.sidebar .widget p { color: var(--ivory); }
.sidebar .widget .post-date, .sidebar .widget .rss-date { display: block; font-size: .8rem; color: var(--muted-dark); }

/* ---------- Поиск ---------- */
.seek-form { display: flex; gap: .5rem; align-items: stretch; }
.seek-field { flex: 1; min-width: 0; padding: .55rem .8rem; border: 1px solid var(--copper); background: #F6EEDB; color: var(--ink); font: inherit; font-size: .95rem; border-radius: 0; }
.seek-field::placeholder { color: var(--muted-parch); }
.seek-submit { flex: 0 0 auto; }

/* ---------- Пагинация ---------- */
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; margin: 2.6rem 0 0; }
.pager .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 2.6rem; height: 2.6rem; padding: 0 .8rem; border: 1px solid var(--copper); color: var(--ivory); text-decoration: none; font-size: .95rem; background: rgba(10, 25, 38, .55); transition: background .12s, color .12s; }
.pager a.page-numbers:hover { background: var(--ivory); color: var(--deep); }
.pager .page-numbers.current { background: var(--copper); color: var(--deep-ink); font-weight: 700; }
.pager .page-numbers.dots { border-color: transparent; background: none; min-width: 1.6rem; padding: 0; }

/* ---------- Комментарии ---------- */
.talk { margin-top: 2.4rem; }
.talk-title, .comment-reply-title { margin: 0 0 1.2rem; font-size: 1.9rem; color: var(--ink); }
.talk-list, .talk-list .children { list-style: none; margin: 0; padding: 0; }
.talk-list .children { padding-inline-start: 1.6rem; border-inline-start: 1px solid rgba(184, 115, 51, .5); }
.talk-list > li, .talk-list .children > li { margin: 0 0 1.2rem; }
.note { padding: 1rem 1.1rem; background: rgba(240, 230, 207, .75); border: 1px solid rgba(28, 42, 56, .3); }
.note-head { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .8rem; margin-bottom: .5rem; }
.note-head img { flex: none; width: 44px; height: 44px; border-radius: 50%; display: block; overflow: hidden; font-size: 0; background: var(--parch-back); border: 1px solid rgba(28, 42, 56, .3); }
.note-author { font-weight: 700; }
.note-date { font-size: .8rem; color: var(--muted-parch); }
.note-wait { font-style: italic; color: var(--copper-deep); }
.note-text p:last-child { margin-bottom: 0; }
.note-reply a { font-size: .85rem; color: var(--copper-deep); }
.comment-respond { margin-top: 1.6rem; }
.comment-form p { margin: 0 0 1rem; }
.comment-form label { display: block; margin-bottom: .3rem; font-size: .9rem; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; padding: .6rem .8rem; border: 1px solid rgba(28, 42, 56, .6); background: #F6EEDB; color: var(--ink); font: inherit; border-radius: 0; }
.comment-form .comment-form-cookies-consent { display: flex; gap: .5rem; align-items: flex-start; }
.comment-form .comment-form-cookies-consent label { display: inline; margin: 0; }
.comment-notes, .logged-in-as, .must-log-in, .talk-closed { font-size: .88rem; color: var(--muted-parch); }
.comment-navigation .nav-links, .comments-pagination { display: flex; justify-content: space-between; gap: 1rem; margin: 1rem 0; }

/* ---------- Cookie-баннер ---------- */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 1rem 1.4rem;
    max-width: 44rem;
    margin-inline: auto;
    padding: 1rem 1.4rem;
    background: var(--deep-ink);
    color: var(--ivory);
    border: 1px solid var(--copper);
    outline: 1px solid rgba(184, 115, 51, .45);
    outline-offset: 4px;
}
.cookie-text { margin: 0; font-size: .88rem; line-height: 1.5; }
.cookie-banner .btn-bevel { --btn-bg: var(--deep-ink); --btn-fg: var(--ivory); color: var(--ivory); flex: 0 0 auto; }
.cookie-banner .btn-bevel:hover { --btn-bg: var(--copper); }

/* ---------- Адаптив: планшет ---------- */
@media (max-width: 960px) {
    .shell { width: min(92%, 1180px); }
    .masthead-row { padding: 1rem 0; gap: 1rem; }
    .brand-mark, .brand-compass, .brand-logo { width: 54px; }
    .brand-compass { height: 68px; }
    .topnav-toggle { display: inline-flex; align-items: center; gap: .55rem; padding: .5rem .8rem; background: none; border: 1px solid var(--copper); color: var(--ivory); cursor: pointer; }
    .topnav-bars, .topnav-bars::before, .topnav-bars::after { display: block; width: 18px; height: 2px; background: var(--copper); position: relative; }
    .topnav-bars::before, .topnav-bars::after { content: ""; position: absolute; left: 0; }
    .topnav-bars::before { top: -6px; }
    .topnav-bars::after { top: 6px; }
    .topnav-label { font-size: .9rem; }
    .nav-list { display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 40; flex-direction: column; gap: 0; padding: .6rem 4%; background: var(--deep-ink); border-bottom: 2px solid var(--copper); }
    .topnav.is-open .nav-list { display: flex; }
    .nav-list a { display: block; padding: .7rem 0; border-bottom: 1px solid rgba(61, 90, 115, .5); }

    .blueprint-stage { aspect-ratio: auto; }
    .blueprint-leaders { display: none; }
    .blueprint-ship { position: static; width: min(100%, 620px); margin: 0 auto; }
    .blueprint-nodes { position: static; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.8rem 1.2rem; margin-top: 2rem; }
    .medal-node { position: static; width: auto; transform: none; display: flex; flex-direction: column; align-items: center; text-align: center; }
    .medal { width: 76px; }
    .medal-label { position: static; transform: none; margin-top: .5rem; max-width: none; }
    .medal-note { position: static; width: auto; opacity: 1; visibility: visible; transform: none; margin-top: .35rem; padding: 0; background: none; border: 0; color: var(--muted-dark); font-size: .84rem; }
    .medal-node:hover .medal-note, .medal-node:focus .medal-note, .medal-node.is-active .medal-note { transform: none; }

    .chronicle-line { --vig: 96px; gap: .6rem; }
    .chronicle-event { font-size: .82rem; }

    .atlas-stage { width: 112%; margin-left: -4%; margin-top: .5rem; }
    .atlas-tag-label { font-size: .8rem; }
    .atlas-tag-note { display: none; }
    .atlas-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; padding: 0 0 2.4rem; }
    .atlas-legend dt { font-family: var(--font-head); font-size: 1.35rem; color: var(--ivory); }
    .atlas-legend dd { margin: .3rem 0 0; font-size: .88rem; line-height: 1.5; color: var(--muted-dark); }
    .atlas-rose { width: 180px; height: 180px; bottom: auto; top: 1rem; left: -50px; }

    .journal-desk, .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
    .layout-with-sidebar .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .journal-desk .card:nth-child(3) { display: none; }

    .decree-grid { gap: 1.6rem; }
    .decree-scroll { margin-right: -1rem; }

    .layout-with-sidebar { grid-template-columns: minmax(0, 1fr); row-gap: 2.6rem; }
    .colophon-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Адаптив: телефон ---------- */
@media (max-width: 600px) {
    body { font-size: .97rem; }
    .brand { gap: .8rem; }
    .brand-mark, .brand-compass, .brand-logo { width: 44px; }
    .brand-compass { height: 55px; }
    .brand-name { font-size: 1.35rem; }
    .brand-tagline { font-size: .78rem; display: none; }
    .topnav-label { display: none; }

    .sea-band { padding: 2rem 0 2.6rem; }
    .blueprint-nodes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .medal { width: 64px; }

    .chronicle-line { --vig: 76px; grid-template-columns: minmax(0, 1fr); gap: 1.2rem; }
    .chronicle-line::before { left: calc(var(--vig) / 2 - 1px); right: auto; top: 0; bottom: 0; width: 2px; height: auto; }
    .chronicle-line::after { display: none; }
    .chronicle-point { display: grid; grid-template-columns: var(--vig) minmax(0, 1fr); column-gap: 1rem; align-items: center; text-align: start; }
    .chronicle-vignette { grid-row: 1 / span 2; position: relative; z-index: 1; }
    .chronicle-tick { display: none; }
    .chronicle-year { margin: 0; align-self: end; }
    .chronicle-event { align-self: start; max-width: none; }
    .chronicle-facts { flex-direction: column; }
    .chronicle-facts li { flex: none; }

    .atlas-tag { display: none; }
    .atlas-stage { width: 120%; margin-left: -8%; }
    .atlas-legend { grid-template-columns: minmax(0, 1fr); }

    .journal-desk, .card-grid, .layout-with-sidebar .card-grid { grid-template-columns: minmax(0, 1fr); }
    .journal-desk .card:nth-child(n) { transform: none; margin-top: 0; }
    .journal-desk .card:nth-child(3) { display: flex; }
    .card::before { inset: 5px -5px -5px 5px; }

    .decree-grid { grid-template-columns: minmax(0, 1fr); }
    .band-title--left { text-align: center; }
    .band-title--left::after { margin-inline: auto; }
    .decree-scroll { margin: .4rem auto 0; width: 190px; }

    .paper-sheet { padding: 1.3rem 1.1rem; outline-offset: 3px; }
    .entry-nav { grid-template-columns: minmax(0, 1fr); }
    .entry-nav-link--next { grid-column: auto; }
    .colophon-cols { grid-template-columns: minmax(0, 1fr); }
    .cookie-banner { flex-direction: column; align-items: flex-start; padding: 1rem 1.1rem; }
    .alignleft, .alignright { float: none; margin: 1em 0; }
}
