/*
Theme Name: dds_anndragichandcompany.com
Author: Ann Dragich
Description: A custom theme styled as an Indian title-deed register: stamped paper, wax seals, ink-blue fields and handwritten margin notes. Built for a residential real estate guide.
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: anndrag
*/

/* ---------- Fonts ---------- */
@font-face {
    font-family: "Roboto Condensed";
    src: url("fonts/roboto-condensed-latin-400-normal.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Roboto Condensed";
    src: url("fonts/roboto-condensed-latin-700-normal.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "PT Serif";
    src: url("fonts/pt-serif-latin-400-normal.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "PT Serif";
    src: url("fonts/pt-serif-latin-400-italic.woff2") format("woff2");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "PT Serif";
    src: url("fonts/pt-serif-latin-700-normal.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Marck Script";
    src: url("fonts/marck-script-latin-400-normal.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
    --paper: #EDE4CE;
    --paper-rule: #D8CBAA;
    --paper-card: #E6DABD;
    --paper-light: #F6F0E2;
    --paper-side: #E2D4B3;
    --ink: #1B2A4A;
    --ink-deep: #15213B;
    --text: #22201C;
    --muted: #6E6656;
    --seal: #B3402A;
    --seal-dark: #8F3020;
    --gold: #C9A227;
    --gold-soft: rgba(201, 162, 39, 0.4);
    --line: #8C7B54;
    --cream: #EDE4CE;

    --f-head: "Roboto Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
    --f-body: "PT Serif", Georgia, "Times New Roman", serif;
    --f-hand: "Marck Script", "Segoe Script", "Brush Script MT", cursive;

    --shell: min(92%, 1180px);
    --gutter-front: min(85%, 1180px);
}

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

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

body {
    margin: 0;
    overflow-x: hidden;
    font-family: var(--f-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--text);
    background-color: var(--paper);
    background-image: repeating-linear-gradient(180deg, transparent 0 33px, rgba(216, 203, 170, 0.75) 33px 34px);
}

p,
li,
dd,
td,
th,
h1,
h2,
h3,
h4,
h5,
h6,
blockquote,
figcaption {
    overflow-wrap: break-word;
    hyphens: auto;
}

p {
    margin: 0 0 1.05em;
}

h1, h2, h3, h4, h5, h6,
.brand-name,
.brand-desc,
.seal-quote p,
.card-title,
.route-name,
.hand-note {
    hyphens: manual;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--f-head);
    font-weight: 700;
    line-height: 1.15;
    color: var(--ink);
    margin: 1.6em 0 0.6em;
}

a {
    color: var(--seal);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

a:hover {
    color: var(--seal-dark);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

img {
    max-width: 100%;
    height: auto;
}

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

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 100;
    padding: 0.6rem 1rem;
    background: var(--gold);
    color: var(--ink);
    font-family: var(--f-head);
    font-weight: 700;
    text-decoration: none;
}

.skip-link:focus {
    top: 1rem;
}

.shell {
    width: var(--shell);
    margin-inline: auto;
}

.shell--front {
    width: var(--gutter-front);
    position: relative;
}

/* ---------- Shared pieces ---------- */
.sec-no {
    display: inline-block;
    font-family: var(--f-head);
    font-size: 0.95rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink);
    text-decoration: none;
}

.sec-head {
    margin-bottom: 2rem;
}

.sec-title {
    display: flex;
    align-items: center;
    gap: 1.6rem;
    margin: 0.2rem 0 0;
    font-size: clamp(1.75rem, 3.5vw, 2.7rem);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.sec-title::after {
    content: "";
    flex: 1 1 60px;
    min-width: 40px;
    height: 8px;
    border-top: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
}

.sec-head--top .sec-no {
    display: block;
    padding-bottom: 0.45rem;
    border-bottom: 7px double var(--ink);
}

.sec-head--top .sec-title::after {
    content: none;
}

.stamp-btn {
    display: inline-block;
    padding: 0.5rem 1.05rem;
    font-family: var(--f-head);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    line-height: 1.2;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    color: var(--seal);
    background: transparent;
    border: 4px double var(--seal);
    transform: rotate(-2deg);
    cursor: pointer;
    transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.stamp-btn:hover,
.stamp-btn:focus-visible {
    color: var(--paper-light);
    background: var(--seal);
    transform: rotate(0deg) translateY(-1px);
}

.stamp-btn--small {
    padding: 0.38rem 0.75rem;
    font-size: 0.82rem;
}

.text-link {
    font-family: var(--f-head);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--ink);
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
}

.text-link::after {
    content: "\2192";
    display: inline-block;
    margin-left: 0.35rem;
    font-size: 0.85em;
    transition: transform 0.18s ease;
}

.text-link:hover {
    color: var(--seal);
}

.text-link:hover::after {
    transform: translateX(4px);
}

.paper-stamp {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    font-family: var(--f-head);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.25;
    text-transform: uppercase;
    color: var(--seal);
    border: 2px solid currentColor;
    outline: 1px solid currentColor;
    outline-offset: 3px;
    opacity: 0.85;
    transform: rotate(6deg);
    pointer-events: none;
}

.hand-note {
    font-family: var(--f-hand);
    color: var(--ink);
}

.pin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    font-family: var(--f-head);
    font-size: 0.8rem;
    font-weight: 700;
    font-style: normal;
    color: var(--paper-light);
    background: var(--seal);
    box-shadow: 0 0 0 2px var(--paper-light);
}

.empty-state {
    padding: 1.4rem 1.5rem;
    border: 1.5px dashed var(--line);
    background: rgba(246, 240, 226, 0.55);
    color: var(--muted);
}

/* ---------- Header ---------- */
.masthead {
    background-color: var(--ink);
    background-image:
        radial-gradient(circle at 12% 30%, rgba(255, 255, 255, 0.04), transparent 45%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 5px);
    color: var(--cream);
    border-bottom: 3px solid var(--ink-deep);
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 780px;
}

.brand-seal {
    flex: 0 0 auto;
    display: block;
    line-height: 0;
    filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.35));
    transition: transform 0.25s ease;
}

.brand-seal:hover {
    transform: rotate(-8deg);
}

.brand-logo {
    display: block;
    width: 96px;
    height: 96px;
    object-fit: contain;
}

.brand-text {
    min-width: 0;
}

.brand-name {
    margin: 0;
    font-family: var(--f-head);
    font-size: clamp(1.1rem, 1.75vw, 1.5rem);
    font-weight: 700;
    line-height: 1.22;
    color: var(--cream);
}

.brand-name a {
    color: inherit;
    text-decoration: none;
}

.brand-name a:hover {
    color: #F3E5BB;
}

.brand-desc {
    margin: 0.5rem 0 0;
    font-size: 0.88rem;
    line-height: 1.5;
    color: rgba(237, 228, 206, 0.78);
}

.menu-toggle {
    display: none;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.9rem;
    font-family: var(--f-head);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--cream);
    background: transparent;
    border: 3px double var(--gold);
    cursor: pointer;
}

.menu-toggle-bars,
.menu-toggle-bars::before,
.menu-toggle-bars::after {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--gold);
    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;
}

.primary-nav {
    flex: 0 0 auto;
    max-width: 340px;
}

.mast-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: navitem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.mast-menu li {
    counter-increment: navitem;
}

.mast-menu a {
    font-family: var(--f-head);
    font-size: 1.1rem;
    color: var(--cream);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.mast-menu a::after {
    content: counter(navitem, decimal-leading-zero);
    margin-left: 0.2rem;
    font-size: 0.66rem;
    vertical-align: super;
    color: var(--gold);
}

.mast-menu a:hover,
.mast-menu .current-menu-item > a,
.mast-menu .current_page_item > a {
    color: var(--gold);
    border-bottom-color: var(--gold-soft);
}

/* ---------- Front sections ---------- */
.fs {
    position: relative;
    padding: 3.6rem 0 3.8rem;
}

.fs-paper {
    background-color: var(--paper);
    background-image: repeating-linear-gradient(180deg, transparent 0 33px, rgba(216, 203, 170, 0.9) 33px 34px);
}

.fs-paper::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc((100% - var(--gutter-front)) / 2 - 26px);
    width: 1px;
    background: rgba(140, 123, 84, 0.55);
    pointer-events: none;
}

.fs-ink {
    color: var(--cream);
    background-color: var(--ink);
    background-image:
        radial-gradient(ellipse at 80% 10%, rgba(255, 255, 255, 0.05), transparent 55%),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.015) 0 1px, transparent 1px 4px);
}

.fs-ink .sec-no,
.fs-ink .sec-title {
    color: var(--cream);
}

/* Margin column of section 01 */
.fs-margin {
    display: none;
}

/* Section 01 — route of stamps */
.fs-route {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200' fill='none' stroke='%238C7B54' stroke-opacity='.22' stroke-width='1.2'%3E%3Ccircle cx='100' cy='100' r='80'/%3E%3Ccircle cx='100' cy='100' r='62'/%3E%3Cpath d='M100 8 112 100 100 192 88 100Z M8 100 100 88 192 100 100 112Z M35 35 104 96 165 165 96 104Z M165 35 104 104 35 165 96 96Z'/%3E%3C/svg%3E"),
        repeating-linear-gradient(180deg, transparent 0 33px, rgba(216, 203, 170, 0.9) 33px 34px);
    background-repeat: no-repeat, repeat;
    background-position: right -60px bottom -70px, 0 0;
    background-size: 300px 300px, auto;
}

.paper-stamp--corner {
    position: absolute;
    top: -1.5rem;
    right: 0;
}

.route {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0.5rem 0 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2.4rem;
}

.route-stamp {
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.6rem 0.9rem 1.2rem;
    color: var(--ink);
    background:
        radial-gradient(circle at 20% 30%, rgba(179, 64, 42, 0.06), transparent 40%),
        rgba(246, 240, 226, 0.45);
    border: 2.5px solid rgba(179, 64, 42, 0.8);
    outline: 1px solid rgba(179, 64, 42, 0.6);
    outline-offset: -8px;
    transform: rotate(-2deg);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.route-stamp:nth-child(even) {
    transform: rotate(1.6deg);
}

.route-stamp:hover {
    transform: rotate(0deg) translateY(-3px);
    background-color: rgba(246, 240, 226, 0.85);
}

.route-stamp::before {
    content: "";
    position: absolute;
    top: 12px;
    right: 14px;
    width: 30px;
    height: 20px;
    border: 1px dashed rgba(179, 64, 42, 0.6);
    background: repeating-linear-gradient(0deg, rgba(179, 64, 42, 0.25) 0 1px, transparent 1px 4px);
}

.route-stamp:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 100%;
    width: 2.4rem;
    border-top: 2px dashed var(--line);
}

.route-no {
    font-family: var(--f-head);
    font-size: 2.3rem;
    font-weight: 700;
    line-height: 1;
    color: var(--seal);
}

.route-name {
    margin-top: 0.35rem;
    font-family: var(--f-head);
    font-size: 1.22rem;
    font-weight: 700;
    line-height: 1.15;
}

.route-hint {
    margin-top: 0.45rem;
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--muted);
}

.route-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    position: relative;
}

.route-foot .hand-note {
    margin: 0.4rem 0 0;
    font-size: clamp(1.7rem, 3.4vw, 2.6rem);
    line-height: 1.2;
    text-align: center;
    transform: rotate(-1.2deg);
}

.paper-stamp--checked {
    position: absolute;
    right: 0;
    bottom: -0.6rem;
    color: var(--ink);
    transform: rotate(-4deg);
    text-align: center;
}

.paper-stamp--checked i {
    display: block;
    font-family: var(--f-hand);
    font-size: 1.15rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    text-transform: none;
}

/* Section 02 — market registry */
.market-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
    gap: 2.5rem;
    align-items: stretch;
}

.market-main {
    min-width: 0;
}

.registry-wrap {
    overflow-x: auto;
}

.registry {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    border: 1px solid rgba(201, 162, 39, 0.35);
    color: var(--cream);
}

.registry caption {
    caption-side: bottom;
    padding-top: 0.9rem;
    font-size: 0.85rem;
    text-align: left;
    color: rgba(237, 228, 206, 0.7);
}

.registry th,
.registry td {
    padding: 0.8rem 0.9rem;
    border: 1px solid rgba(201, 162, 39, 0.3);
    text-align: left;
    vertical-align: middle;
}

.registry thead th {
    font-family: var(--f-head);
    font-size: 1.1rem;
    line-height: 1.2;
    color: var(--gold);
    border-bottom: 2px solid var(--gold);
}

.registry tbody th {
    font-family: var(--f-body);
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--cream);
}

.registry tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.tier {
    display: inline-flex;
    gap: 3px;
    margin-right: 0.55rem;
    vertical-align: -2px;
}

.tier i {
    display: block;
    width: 7px;
    height: 15px;
    border: 1px solid var(--gold);
}

.tier i.on {
    background: var(--gold);
}

.registry-note {
    margin: 1.1rem 0 0;
    padding-left: 1rem;
    border-left: 3px solid var(--seal);
    font-size: 0.95rem;
    color: rgba(237, 228, 206, 0.88);
}

.market-scale {
    display: flex;
    gap: 14px;
    justify-content: flex-end;
    min-width: 0;
}

.market-ruler {
    display: block;
    width: 44px;
    height: 100%;
    max-height: 380px;
    object-fit: cover;
    box-shadow: 4px 6px 14px rgba(0, 0, 0, 0.35);
}

.market-ticks {
    display: block;
    width: 52px;
    max-height: 380px;
    background-image:
        repeating-linear-gradient(180deg, rgba(201, 162, 39, 0.85) 0 2px, transparent 2px 64px),
        repeating-linear-gradient(180deg, rgba(201, 162, 39, 0.7) 0 1px, transparent 1px 12.8px);
    background-size: 100% 100%, 60% 100%;
    background-position: right top, right top;
    background-repeat: no-repeat;
}

/* Section 03 — cards */
.fs-latest::after,
.fs-anatomy::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 34px;
    display: none;
    background-image:
        repeating-linear-gradient(180deg, rgba(201, 162, 39, 0.8) 0 2px, transparent 2px 60px),
        repeating-linear-gradient(180deg, rgba(201, 162, 39, 0.65) 0 1px, transparent 1px 12px);
    background-size: 100% 100%, 55% 100%;
    background-position: right top, right top;
    background-repeat: no-repeat;
    pointer-events: none;
}

.latest-more {
    margin: 2.2rem 0 0;
    text-align: right;
}

.card-grid {
    counter-reset: cardno;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
    gap: 2.2rem 2rem;
}

@media (min-width: 961px) {
    .card-grid--three {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.card {
    counter-increment: cardno;
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: var(--paper-card);
    background-image: linear-gradient(160deg, rgba(255, 255, 255, 0.22), rgba(140, 123, 84, 0.08));
    border: 1.5px solid var(--line);
    box-shadow: 4px 5px 0 rgba(140, 123, 84, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translate(-2px, -3px);
    box-shadow: 7px 9px 0 rgba(140, 123, 84, 0.35);
}

.card-top {
    position: relative;
    padding: 1.1rem 1.3rem 0;
}

.card-thumb-wrap {
    width: 74%;
    padding: 6px;
    background: var(--paper-light);
    transform: rotate(-2.5deg);
    transform-origin: left center;
    -webkit-mask: linear-gradient(#000 0 0) content-box, radial-gradient(circle, transparent 3px, #000 3.6px) -5px -5px / 10px 10px;
    mask: linear-gradient(#000 0 0) content-box, radial-gradient(circle, transparent 3px, #000 3.6px) -5px -5px / 10px 10px;
    filter: drop-shadow(1px 2px 2px rgba(34, 32, 28, 0.25));
}

.card:nth-child(even) .card-thumb-wrap {
    transform: rotate(2deg);
}

.card-thumb-wrap a {
    display: block;
}

.card-thumb-wrap img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    filter: sepia(0.12) saturate(0.95);
}

.card-no {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    padding-bottom: 0.1rem;
    font-family: var(--f-head);
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1;
    color: var(--ink);
    border-bottom: 5px double var(--ink);
}

.card-no::before {
    content: counter(cardno);
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 1.1rem 1.3rem 1.3rem;
}

.card-flag {
    align-self: flex-start;
    margin-bottom: 0.5rem;
    padding: 0.1rem 0.5rem;
    font-family: var(--f-head);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--paper-light);
    background: var(--seal);
}

.card-title {
    margin: 0 0 0.5rem;
    font-size: 1.35rem;
    line-height: 1.2;
}

.card-title a {
    color: var(--ink);
    text-decoration: none;
}

.card-title a:hover {
    color: var(--seal);
    text-decoration: underline;
}

.card-excerpt {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #3A362E;
}

.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}

.card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 0.9rem;
}

.card-date {
    font-family: var(--f-head);
    font-size: 0.85rem;
    color: var(--muted);
}

/* Section 04 — anatomy */
.fs-anatomy {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 160' fill='none' stroke='%238C7B54' stroke-opacity='.16' stroke-width='1.4'%3E%3Cpath d='M10 10h140v60H10zM150 10h80v100h-80zM10 70h90v80H10zM100 70h50v80h-50zM60 70v-12M150 50h12'/%3E%3C/svg%3E"),
        repeating-linear-gradient(180deg, transparent 0 33px, rgba(216, 203, 170, 0.9) 33px 34px);
    background-repeat: no-repeat, repeat;
    background-position: right 6% bottom 40px, 0 0;
    background-size: 260px auto, auto;
}

.anatomy-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 2.6rem;
    align-items: center;
}

.anatomy-plan {
    margin: 0;
    min-width: 0;
}

.anatomy-canvas {
    position: relative;
    aspect-ratio: 1000 / 420;
}

.anatomy-img {
    position: absolute;
    left: 18%;
    top: 12.1%;
    width: 64%;
    height: auto;
    display: block;
}

.anatomy-arrows {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.anatomy-arrows path {
    fill: none;
    stroke: var(--ink);
    stroke-width: 2.4;
    stroke-linecap: round;
}

.anatomy-label {
    position: absolute;
    font-family: var(--f-hand);
    font-size: clamp(1.15rem, 2.3vw, 2rem);
    line-height: 1;
    color: var(--ink);
    white-space: nowrap;
}

.anatomy-label .pin {
    display: none;
}

.anatomy-label--a {
    left: 1%;
    top: 19%;
}

.anatomy-label--b {
    left: 0;
    top: 66%;
}

.anatomy-label--c {
    right: 0;
    top: 13%;
}

.anatomy-label--d {
    right: 3%;
    top: 66%;
}

.anatomy-caption {
    margin-top: 0.8rem;
    font-size: 0.9rem;
    font-style: italic;
    text-align: center;
    color: var(--muted);
}

.anatomy-notes {
    position: relative;
    min-width: 0;
    padding: 0.4rem 0 3.2rem 1.3rem;
    border-left: 1px solid var(--line);
}

.glossary {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.5;
}

.glossary dt {
    margin-top: 0.9rem;
    font-family: var(--f-head);
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
}

.glossary dt:first-child {
    margin-top: 0;
}

.glossary dt .pin {
    display: none;
    width: 1.3rem;
    height: 1.3rem;
    margin-right: 0.3rem;
    font-size: 0.72rem;
    box-shadow: none;
}

.glossary dd {
    margin: 0.2rem 0 0;
    color: #3A362E;
}

.paper-stamp--archive {
    position: absolute;
    left: 1.3rem;
    bottom: 0;
    color: var(--ink);
    transform: rotate(-5deg);
}

/* Section 05 — seals */
.seals-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: center;
}

.wax {
    position: relative;
    justify-self: center;
    width: 100%;
    max-width: 230px;
    margin: 0;
    transition: transform 0.3s ease;
}

.wax:hover {
    transform: rotate(-6deg) scale(1.03);
}

.wax-img {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.45));
}

.wax--mirror .wax-img {
    transform: scaleX(-1) rotate(-14deg);
}

.wax-mark {
    position: absolute;
    left: 50%;
    top: 48%;
    width: 36%;
    height: auto;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.35));
}

.seal-quote {
    margin: 0;
    text-align: center;
}

.seal-quote p {
    margin: 0;
    font-family: var(--f-body);
    font-size: clamp(1.6rem, 3.3vw, 2.6rem);
    line-height: 1.25;
    color: var(--cream);
}

.seal-quote footer {
    margin-top: 0.6rem;
}

.seal-quote cite {
    font-family: var(--f-hand);
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    font-style: normal;
    color: var(--cream);
}

/* ---------- Inner pages ---------- */
.page-shell {
    padding-bottom: 4.5rem;
}

.breadcrumbs {
    padding: 1.5rem 0 0.4rem;
    font-family: var(--f-head);
    font-size: 0.92rem;
    color: var(--muted);
}

.breadcrumbs a {
    color: var(--seal);
    text-decoration: none;
    border-bottom: 1px solid rgba(179, 64, 42, 0.4);
}

.breadcrumbs a:hover {
    border-bottom-color: var(--seal);
}

.crumb-sep {
    margin: 0 0.35rem;
    color: var(--line);
}

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 6%;
    align-items: start;
    margin-top: 1.4rem;
}

.layout-single {
    display: block;
    margin-top: 1.4rem;
}

.layout-single > .content-area {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}

.content-area {
    min-width: 0;
}

.page-head,
.entry-head {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 7px double var(--ink);
}

.page-title {
    margin: 0.2rem 0 0;
    font-size: clamp(1.9rem, 4vw, 2.9rem);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.entry-cat {
    color: var(--seal);
}

.entry-cat:hover {
    text-decoration: underline;
}

.entry-meta {
    margin: 0.6rem 0 0;
    font-family: var(--f-head);
    font-size: 0.95rem;
    color: var(--muted);
}

.archive-desc,
.page-intro {
    margin-top: 0.9rem;
    color: var(--muted);
}

.entry-thumb {
    margin: 0 0 2rem;
    padding: 8px;
    background: var(--paper-light);
    border: 1.5px solid var(--line);
    box-shadow: 4px 5px 0 rgba(140, 123, 84, 0.3);
}

.entry-thumb img {
    display: block;
    width: 100%;
    height: auto;
}

.entry-content {
    font-size: 1.08rem;
}

.entry-content > *:first-child {
    margin-top: 0;
}

.entry-content h2 {
    font-size: 1.8rem;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid var(--paper-rule);
}

.entry-content h3 {
    font-size: 1.4rem;
}

.entry-content ul,
.entry-content ol {
    margin: 0 0 1.2em;
    padding-left: 1.5em;
}

.entry-content li {
    margin-bottom: 0.4em;
}

.entry-content ul li::marker {
    color: var(--seal);
}

.entry-content ol li::marker {
    font-family: var(--f-head);
    font-weight: 700;
    color: var(--seal);
}

.entry-content blockquote {
    margin: 1.8em 0;
    padding: 1.2rem 1.5rem 1.2rem 1.6rem;
    font-style: italic;
    background: var(--paper-card);
    border-left: 5px solid var(--seal);
    box-shadow: 3px 4px 0 rgba(140, 123, 84, 0.25);
}

.entry-content blockquote p:last-child {
    margin-bottom: 0;
}

.entry-content table {
    width: 100%;
    margin: 1.5em 0;
    border-collapse: collapse;
    border: 1.5px solid var(--line);
    font-size: 0.95rem;
    background: rgba(246, 240, 226, 0.6);
}

.entry-content th,
.entry-content td {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--line);
    text-align: left;
}

.entry-content th {
    font-family: var(--f-head);
    color: var(--cream);
    background: var(--ink);
}

.entry-content figure {
    margin: 1.6em 0;
}

.entry-content figcaption {
    margin-top: 0.4rem;
    font-size: 0.88rem;
    color: var(--muted);
}

.entry-content img {
    display: block;
}

.entry-content pre {
    overflow-x: auto;
    padding: 1rem 1.2rem;
    background: var(--ink);
    color: var(--cream);
    font-size: 0.9rem;
}

.entry-content hr {
    height: 7px;
    margin: 2.2em 0;
    border: 0;
    border-top: 2px solid var(--line);
    border-bottom: 2px solid var(--line);
}

.entry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2rem;
}

.entry-tags a {
    padding: 0.2rem 0.6rem;
    font-family: var(--f-head);
    font-size: 0.88rem;
    color: var(--ink);
    text-decoration: none;
    border: 1px solid var(--line);
}

.entry-tags a:hover {
    color: var(--paper-light);
    background: var(--ink);
}

.page-links {
    margin-top: 1.5rem;
    font-family: var(--f-head);
}

/* ---------- Sidebar ---------- */
.sidebar {
    min-width: 0;
    padding: 1.5rem 1.4rem;
    color: var(--text);
    background: var(--paper-side);
    border: 1.5px solid var(--line);
    box-shadow: 4px 5px 0 rgba(140, 123, 84, 0.3);
}

.sidebar .widget + .widget {
    margin-top: 2rem;
}

.sidebar .widget-title {
    margin: 0 0 0.9rem;
    padding-bottom: 0.35rem;
    font-size: 1.15rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink);
    border-bottom: 5px double var(--ink);
}

.sidebar ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sidebar li {
    padding: 0.55rem 0;
    border-bottom: 1px dashed var(--line);
    font-size: 0.97rem;
    line-height: 1.4;
    color: var(--text);
}

.sidebar a {
    color: var(--ink);
    text-decoration: none;
}

.sidebar a:hover {
    color: var(--seal);
    text-decoration: underline;
}

.sidebar .post-date {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
}

/* ---------- Pagination ---------- */
.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2.8rem;
}

.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.7rem;
    height: 2.7rem;
    padding: 0 0.8rem;
    font-family: var(--f-head);
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
    background: rgba(246, 240, 226, 0.6);
    border: 2px solid var(--line);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.pager a.page-numbers:hover {
    color: var(--paper-light);
    background: var(--seal);
    border-color: var(--seal);
}

.pager .page-numbers.current {
    color: var(--cream);
    background: var(--ink);
    border-color: var(--ink);
}

.pager .page-numbers.dots {
    min-width: auto;
    padding: 0 0.3rem;
    background: none;
    border: 0;
}

/* ---------- Search form ---------- */
.search-form {
    display: flex;
    gap: 0.5rem;
    max-width: 520px;
    margin: 1.2rem 0;
}

.search-field {
    flex: 1;
    min-width: 0;
    padding: 0.7rem 0.9rem;
    font: inherit;
    font-size: 1rem;
    color: var(--text);
    background: var(--paper-light);
    border: 1.5px solid var(--line);
    border-radius: 0;
}

.search-submit {
    padding: 0.7rem 1.2rem;
    font-family: var(--f-head);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cream);
    background: var(--ink);
    border: 0;
    cursor: pointer;
}

.search-submit:hover {
    background: var(--seal);
}

/* ---------- 404 ---------- */
.notfound {
    padding: 2rem 0 1rem;
}

.notfound-code {
    display: block;
    font-family: var(--f-head);
    font-size: clamp(5rem, 14vw, 9rem);
    font-weight: 700;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 2px var(--seal);
    transform: rotate(-3deg);
    transform-origin: left;
}

/* ---------- Comments ---------- */
.comments {
    margin-top: 3.2rem;
    padding-top: 1.5rem;
    border-top: 7px double var(--ink);
}

.comments-title,
.comment-reply-title {
    margin: 0 0 1.2rem;
    font-size: 1.5rem;
    text-transform: uppercase;
}

.comment-list,
.comment-list .children {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment-list .children {
    margin-left: 1.8rem;
}

.note-body {
    margin-bottom: 1.2rem;
    padding: 1rem 1.2rem;
    background: rgba(246, 240, 226, 0.7);
    border: 1px solid var(--line);
}

.note-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-bottom: 0.5rem;
}

.note-head img {
    display: block;
    border-radius: 50%;
}

.note-author {
    font-family: var(--f-head);
    font-weight: 700;
    color: var(--ink);
}

.note-date {
    font-family: var(--f-head);
    font-size: 0.85rem;
    color: var(--muted);
}

.note-pending {
    font-style: italic;
    color: var(--seal);
}

.note-reply a {
    font-family: var(--f-head);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.comment-respond {
    margin-top: 2rem;
}

.comment-form p {
    margin-bottom: 1rem;
}

.comment-form label {
    display: block;
    margin-bottom: 0.3rem;
    font-family: var(--f-head);
    font-weight: 700;
    color: var(--ink);
}

.comment-form .comment-form-cookies-consent label {
    display: inline;
    font-family: var(--f-body);
    font-weight: 400;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.65rem 0.8rem;
    font: inherit;
    font-size: 1rem;
    color: var(--text);
    background: var(--paper-light);
    border: 1.5px solid var(--line);
    border-radius: 0;
}

.comment-notes,
.logged-in-as {
    font-size: 0.92rem;
    color: var(--muted);
}

/* ---------- Footer ---------- */
.colophon {
    color: var(--cream);
    background-color: var(--ink);
    background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.015) 0 1px, transparent 1px 4px);
    border-top: 1px solid rgba(201, 162, 39, 0.45);
}

.colophon-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.6rem;
    padding: 3.2rem 0 2.4rem;
}

.colophon-col {
    min-width: 0;
}

.colophon .widget-title {
    margin: 0 0 0.8rem;
    font-size: 1.4rem;
    color: var(--cream);
}

.colophon .widget,
.colophon .widget p,
.colophon .textwidget {
    font-size: 0.97rem;
    line-height: 1.6;
    color: rgba(237, 228, 206, 0.86);
}

.colophon a {
    color: var(--cream);
    text-decoration-color: rgba(201, 162, 39, 0.6);
}

.colophon a:hover {
    color: var(--gold);
}

.colophon ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.colophon li {
    margin-bottom: 0.45rem;
}

.colophon .menu a {
    font-family: var(--f-head);
    font-size: 1.02rem;
    text-decoration: none;
}

.colophon-copy {
    margin: 0;
    padding: 1.2rem 0 1.6rem;
    font-family: var(--f-head);
    font-size: 0.88rem;
    text-align: center;
    color: rgba(237, 228, 206, 0.75);
    border-top: 1px solid rgba(201, 162, 39, 0.45);
}

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

.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    max-width: 760px;
    margin: 0 auto;
    padding: 1rem 1.3rem;
    color: var(--cream);
    background: var(--ink);
    border: 1px solid var(--gold);
    outline: 1px solid rgba(201, 162, 39, 0.4);
    outline-offset: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.cookie-banner-text {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.5;
}

.cookie-banner .stamp-btn {
    flex: 0 0 auto;
    color: var(--gold);
    border-color: var(--gold);
}

.cookie-banner .stamp-btn:hover {
    color: var(--ink);
    background: var(--gold);
}

/* ---------- Wide screens: margin decorations ---------- */
@media (min-width: 1360px) {
    .fs-margin {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        position: absolute;
        top: 2.2rem;
        bottom: 2rem;
        left: 0;
        width: calc((100% - var(--gutter-front)) / 2 - 26px);
        padding: 0 10px;
        text-align: center;
    }

    .fs-regno {
        font-family: var(--f-head);
        font-size: 0.85rem;
        color: var(--muted);
        border-bottom: 1px solid var(--seal);
    }

    .fs-regno b {
        font-size: 1.1rem;
        font-weight: 400;
        color: var(--seal);
    }

    .fs-vertical {
        writing-mode: vertical-rl;
        transform: rotate(180deg);
        font-family: var(--f-head);
        font-size: 0.95rem;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--ink);
    }

    .fs-margin-note {
        font-family: var(--f-hand);
        font-size: 1.05rem;
        line-height: 1.15;
        color: var(--ink);
        transform: rotate(-6deg);
    }

    .fs-latest .shell--front::before,
    .fs-anatomy .shell--front::before {
        content: "";
        position: absolute;
        top: 0;
        right: calc(100% + 30px);
        width: 140px;
        height: 455px;
        background: url("images/margin-plan.png") no-repeat right top / contain;
        pointer-events: none;
    }

    .fs-anatomy .shell--front::before {
        top: 1rem;
        width: 112px;
        height: 260px;
        background-image: url("images/margin-compass.png");
    }

    .fs-latest::after,
    .fs-anatomy::after {
        display: block;
    }
}

/* ---------- Tablet ---------- */
@media (max-width: 960px) {
    .masthead-row {
        flex-wrap: wrap;
        padding: 1.6rem 0;
    }

    .brand {
        flex: 1 1 calc(100% - 140px);
    }

    .brand-logo {
        width: 76px;
        height: 76px;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .primary-nav {
        display: none;
        flex-basis: 100%;
        max-width: none;
        padding-top: 1rem;
        border-top: 1px solid rgba(201, 162, 39, 0.4);
    }

    .primary-nav.is-open {
        display: block;
    }

    .mast-menu a {
        display: inline-block;
        padding: 0.3rem 0;
    }

    .route {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
        gap: 1.6rem;
    }

    .route-stamp:not(:last-child)::after {
        content: none;
    }

    .route-foot {
        flex-direction: column;
        gap: 1.6rem;
    }

    .paper-stamp--checked {
        position: static;
    }

    .market-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .market-scale {
        display: none;
    }

    .anatomy-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .anatomy-notes {
        padding: 1.2rem 0 0;
        border-left: 0;
        border-top: 1px solid var(--line);
    }

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

    .glossary dt {
        grid-column: auto;
    }

    .paper-stamp--archive {
        position: static;
        margin-top: 1.4rem;
    }

    .layout-with-sidebar {
        grid-template-columns: minmax(0, 1fr);
        gap: 2.5rem;
    }

    .layout-single > .content-area {
        width: 100%;
    }

    .colophon-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .colophon-col--1 {
        grid-column: 1 / -1;
    }
}

/* ---------- Mobile: plan with pins ---------- */
@media (max-width: 700px) {
    .anatomy-canvas {
        aspect-ratio: 1220 / 606;
    }

    .anatomy-img {
        left: 0;
        top: 0;
        width: 100%;
    }

    .anatomy-arrows {
        display: none;
    }

    .anatomy-label {
        font-size: 0;
        transform: translate(-50%, -50%);
    }

    .anatomy-label .pin {
        display: inline-flex;
        font-size: 0.8rem;
    }

    .anatomy-label--a {
        left: 20%;
        top: 35%;
        right: auto;
    }

    .anatomy-label--b {
        left: 41%;
        top: 93%;
        right: auto;
    }

    .anatomy-label--c {
        left: 57%;
        top: 22%;
        right: auto;
    }

    .anatomy-label--d {
        left: 95%;
        top: 72%;
        right: auto;
    }

    .glossary {
        display: block;
    }

    .glossary dt .pin {
        display: inline-flex;
    }

    .seals-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "quote quote"
            "left right";
        gap: 1.6rem;
    }

    .seal-quote {
        grid-area: quote;
    }

    .seals-row .wax:first-child {
        grid-area: left;
    }

    .seals-row .wax--mirror {
        grid-area: right;
    }

    .wax {
        max-width: 160px;
    }
}

@media (max-width: 600px) {
    body {
        font-size: 1rem;
    }

    .shell--front {
        width: var(--shell);
    }

    .fs {
        padding: 2.6rem 0 2.8rem;
    }

    .fs-paper::before {
        content: none;
    }

    .sec-title {
        gap: 0.9rem;
    }

    .paper-stamp--corner {
        display: none;
    }

    .brand {
        gap: 0.9rem;
        flex-basis: 100%;
        align-items: flex-start;
    }

    .registry {
        min-width: 0;
        border: 0;
    }

    .registry thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .registry,
    .registry tbody,
    .registry tr,
    .registry th,
    .registry td {
        display: block;
        width: 100%;
    }

    .registry tr {
        margin-bottom: 1rem;
        border: 1px solid rgba(201, 162, 39, 0.45);
    }

    .registry tbody th {
        padding: 0.6rem 0.9rem;
        border: 0;
        border-bottom: 2px solid var(--gold);
    }

    .registry td {
        border: 0;
        border-bottom: 1px solid rgba(201, 162, 39, 0.25);
    }

    .registry td:last-child {
        border-bottom: 0;
    }

    .registry caption {
        display: block;
        width: 100%;
        padding: 0 0 0.9rem;
    }

    .registry td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.2rem;
        font-family: var(--f-head);
        font-size: 0.85rem;
        color: var(--gold);
    }

    .brand-logo {
        width: 60px;
        height: 60px;
    }

    .brand-desc {
        font-size: 0.82rem;
    }

    .colophon-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 2rem;
        padding: 2.4rem 0 1.8rem;
    }

    .cookie-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 1.1rem;
    }

    .search-form {
        flex-direction: column;
    }

    .comment-list .children {
        margin-left: 0.8rem;
    }
}

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