/*
Theme Name: dds_davidgoodwinhomes.com
Theme URI: https://davidgoodwinhomes.com/
Author: David Goodwin
Description: Field-journal theme for a practical home buying resource in India: grid paper, ink rules, red-pencil stamps and a builder's cutaway on the front page.
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: dgwhome
*/

/* ---------- Fonts ---------- */
@font-face { font-family: "Oswald"; src: url("fonts/oswald-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Oswald"; src: url("fonts/oswald-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Oswald"; src: url("fonts/oswald-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: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("fonts/caveat-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("fonts/caveat-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
    --paper: #EDE4D3;
    --paper-light: #F4EDE0;
    --paper-deep: #E3D7C0;
    --grid: #C9BBA0;
    --ink: #1F2A2E;
    --muted: #6E6455;
    --red: #C0392B;
    --red-dark: #9E2D21;
    --green: #2E5D4B;
    --green-deep: #234A3B;
    --graphite: #232B2D;
    --on-dark: #EDE4D3;
    --on-dark-muted: #B9AF9C;
    --f-head: "Oswald", "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
    --f-body: "PT Serif", Georgia, "Times New Roman", serif;
    --f-mono: "IBM Plex Mono", "Courier New", Consolas, monospace;
    --f-hand: "Caveat", "Segoe Print", "Comic Sans MS", cursive;
    --gridline: rgba(201, 187, 160, 0.55);
}

/* ---------- Hidden-state rules (must precede component blocks) ---------- */
.cookie-banner[hidden] { display: none !important; }
[hidden] { display: none !important; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    font-family: var(--f-body);
    font-size: 1.0625rem;
    line-height: 1.7;
    background-color: var(--paper);
    background-image:
        linear-gradient(90deg, transparent calc(50% - 1px), rgba(110, 100, 85, 0.07) calc(50% - 1px), rgba(255, 255, 255, 0.35) 50%, transparent calc(50% + 2px)),
        linear-gradient(var(--gridline) 1px, transparent 1px),
        linear-gradient(90deg, var(--gridline) 1px, transparent 1px);
    background-size: 100% 100%, 22px 22px, 22px 22px;
    background-position: 0 0, -1px -1px, -1px -1px;
    overflow-wrap: break-word;
}

p { margin: 0 0 1.1em; }
h1, h2, h3, h4, h5, h6 {
    font-family: var(--f-head);
    font-weight: 600;
    line-height: 1.15;
    margin: 1.6em 0 0.6em;
    color: var(--ink);
    hyphens: auto;
    overflow-wrap: break-word;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.2rem; }
img { max-width: 100%; height: auto; }
a { color: var(--ink); text-decoration-color: var(--red); text-underline-offset: 3px; }
a:hover { color: var(--red); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 2px;
}

.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}
.skip-link {
    position: absolute;
    left: 1rem; top: -60px;
    z-index: 100;
    padding: 0.5rem 1rem;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--f-mono);
}
.skip-link:focus { top: 1rem; color: var(--paper); }

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

/* ---------- Buttons & links ---------- */
.stamp-btn, .stamp-link {
    display: inline-block;
    padding: 0.55em 1.15em 0.5em;
    border: 3px solid var(--red);
    border-radius: 0;
    background: transparent;
    color: var(--red);
    font-family: var(--f-head);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    line-height: 1.2;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(192, 57, 43, 0.25);
    transition: background-color .15s ease, color .15s ease, transform .15s ease;
}
.stamp-btn:hover, .stamp-link:hover, .stamp-btn:focus-visible, .stamp-link:focus-visible {
    background: var(--red);
    color: var(--paper-light);
    transform: translate(-2px, -2px);
    box-shadow: 3px 3px 0 var(--ink);
}
.ink-link {
    font-family: var(--f-head);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid var(--ink);
    padding-bottom: 2px;
    position: relative;
    padding-right: 12px;
}
.ink-link::after {
    content: "";
    position: absolute;
    right: 0; bottom: -3px;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--red);
}
.ink-link:hover { border-bottom-color: var(--red); }

/* ---------- Header ---------- */
.masthead { padding-top: 1.8rem; }
.masthead-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem 2.5rem;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--ink);
    flex: 1 1 420px;
    min-width: 0;
    max-width: 680px;
}
.brand:hover { color: var(--ink); }
.brand-mark { flex: 0 0 auto; line-height: 0; color: var(--ink); }
.brand-svg { width: 74px; height: 74px; display: block; }
.brand-logo { display: block; max-width: 90px; max-height: 80px; width: auto; height: auto; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
    font-family: var(--f-head);
    font-weight: 600;
    font-size: clamp(1.05rem, 1.6vw, 1.3rem);
    line-height: 1.25;
    letter-spacing: 0.01em;
}
.brand-desc {
    margin-top: 0.3rem;
    font-family: var(--f-body);
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.topnav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 2rem;
}
.topnav-list a {
    display: inline-block;
    padding: 0.3rem 0 0.25rem;
    font-family: var(--f-head);
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink);
    border-bottom: 2px solid transparent;
}
.topnav-list a:hover { color: var(--red); border-bottom-color: var(--red); }
.topnav-list .current-menu-item > a,
.topnav-list .current_page_item > a { border-bottom-color: var(--ink); }
.topnav-list .sub-menu { list-style: none; margin: 0; padding: 0.3rem 0 0 1rem; }

.nav-toggle {
    display: none;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.9rem;
    border: 2px solid var(--ink);
    background: var(--paper-light);
    color: var(--ink);
    font-family: var(--f-head);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block;
    width: 20px; height: 2px;
    background: currentColor;
    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; }

.masthead-rule {
    margin-top: 1.4rem;
    height: 9px;
    border-top: 4px solid var(--ink);
    border-bottom: 1.5px solid var(--ink);
}

/* ---------- Front page frame ---------- */
.front-main { width: 85%; max-width: 1180px; margin-inline: auto; padding-bottom: 3.5rem; }
.fs { padding: 3rem 0 1.5rem; }

.sec-head {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    margin: 0 0 1.8rem;
    position: relative;
    padding-bottom: 0.7rem;
}
.sec-head::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 120px; height: 4px;
    background: var(--red);
    border-radius: 2px 6px 3px 5px;
    transform: rotate(-0.6deg);
}
.sec-num {
    font-family: var(--f-head);
    font-weight: 700;
    font-size: clamp(2rem, 4.4vw, 3.4rem);
    line-height: 1;
    color: var(--ink);
}
.sec-num::after {
    content: "";
    display: inline-block;
    width: 8px; height: 8px;
    margin-left: 4px;
    background: var(--red);
    vertical-align: top;
}
.sec-title {
    margin: 0;
    font-family: var(--f-head);
    font-weight: 700;
    font-size: clamp(2rem, 4.4vw, 3.4rem);
    line-height: 1.02;
    text-transform: uppercase;
    letter-spacing: 0.005em;
    min-width: 0;
}

/* ----- 01 Inspection: cutaway + checklist ----- */
.inspect-grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
    gap: 2rem 2.5rem;
    align-items: center;
}
.cutaway {
    position: relative;
    margin: 0;
    container-type: inline-size;
}
.cutaway img { display: block; width: 100%; height: auto; }
.cut-label {
    position: absolute;
    transform: translateY(-50%);
    font-family: var(--f-head);
    font-weight: 600;
    font-size: clamp(10px, 2.9cqw, 24px);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1;
    white-space: nowrap;
    color: var(--ink);
    background: rgba(237, 228, 211, 0.85);
    padding: 0.15em 0.25em;
}
.lbl-roof { right: 77.6%; top: 6.4%; }
.lbl-vent { left: 75%; top: 6.4%; }
.lbl-damp { right: 85.3%; top: 50.3%; }
.lbl-win { left: 87.2%; top: 47.4%; }
.lbl-found { left: 80.8%; top: 88%; }

.handlist { list-style: none; margin: 0 0 1.3rem; padding: 0; }
.handlist li {
    position: relative;
    padding: 0.15rem 0 0.15rem 2.6rem;
    font-family: var(--f-hand);
    font-weight: 500;
    font-size: 1.75rem;
    line-height: 1.35;
    transform: rotate(-0.8deg);
}
.handlist li::before {
    content: "";
    position: absolute;
    left: 0; top: 0.5em;
    width: 22px; height: 22px;
    border: 2px solid var(--ink);
    background: var(--paper-light);
}
.handlist li::after {
    content: "";
    position: absolute;
    left: 5px; top: 0.28em;
    width: 11px; height: 20px;
    border-right: 3.5px solid var(--red);
    border-bottom: 3.5px solid var(--red);
    transform: rotate(40deg);
}
.inspect-note { font-size: 0.97rem; color: var(--muted); margin-bottom: 1.4rem; }

/* ----- 02 Money: graphite plate with ruler ----- */
.fs-money {
    margin-block: 2.5rem 1rem;
    margin-inline: -4%;
    padding: 2.8rem 3.2rem 2.6rem;
    background-color: var(--graphite);
    background-image:
        linear-gradient(rgba(237, 228, 211, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(237, 228, 211, 0.04) 1px, transparent 1px);
    background-size: 22px 22px;
    border-radius: 4px;
    color: var(--on-dark);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2), 0 14px 30px -18px rgba(0, 0, 0, 0.55);
}
.money-top {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1.2rem 1.4rem;
    align-items: stretch;
}
.sec-head-light { grid-column: 1 / span 2; margin: 0; align-self: start; }
.sec-head-light .sec-num, .sec-head-light .sec-title { color: #E4CFA6; }
.sec-head-light .sec-num::after { background: var(--red); }
.title-break { display: block; }
.money-note {
    position: relative;
    padding: 1rem 1.1rem 1.05rem;
    background-color: var(--paper-light);
    background-image: repeating-linear-gradient(transparent 0, transparent 21px, rgba(201, 187, 160, 0.7) 21px, rgba(201, 187, 160, 0.7) 22px);
    background-position: 0 2.6rem;
    color: var(--ink);
    border-radius: 2px;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
    min-width: 0;
}
.money-note::after {
    content: "";
    position: absolute;
    left: 50%; bottom: -11px;
    margin-left: -11px;
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-top: 11px solid var(--paper-light);
}
.mn-3 { grid-column: 3; }
.mn-4 { grid-column: 4; }
.mn-5 { grid-column: 5; }
.money-note-title {
    margin: 0 0 0.5rem;
    padding-left: 0.9rem;
    position: relative;
    font-family: var(--f-head);
    font-weight: 600;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.money-note-title::before {
    content: "";
    position: absolute;
    left: -1.1rem; top: 0.42em;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 12px solid var(--red);
}
.money-note p {
    margin: 0;
    font-family: var(--f-mono);
    font-size: 0.76rem;
    line-height: 22px;
    background: none;
}

.ruler { position: relative; margin-top: 2.2rem; padding-top: 34px; }
.ruler-axis {
    position: absolute;
    left: 0; right: 0; top: 34px;
    height: 2px;
    background: var(--on-dark);
}
.ruler-axis::before {
    content: "";
    position: absolute;
    left: 6%; right: 2%; bottom: 2px;
    height: 12px;
    background-image: repeating-linear-gradient(90deg, var(--on-dark-muted) 0 1px, transparent 1px 12px);
}
.ruler-axis::after {
    content: "";
    position: absolute;
    right: -2px; top: -6px;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 13px solid var(--on-dark);
}
.ruler-marks {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}
.ruler-marks li {
    position: relative;
    text-align: center;
    padding: 1.2rem 0.4rem 0;
    font-family: var(--f-head);
    font-weight: 500;
    font-size: 1.15rem;
    line-height: 1.2;
    color: #E4CFA6;
    min-width: 0;
}
.ruler-marks li::before {
    content: "";
    position: absolute;
    left: 50%; top: -34px;
    width: 2px; height: 34px;
    margin-left: -1px;
    background: var(--on-dark);
}
.ruler-marks li::after {
    content: "";
    position: absolute;
    left: 50%; top: 4px;
    width: 3px; height: 10px;
    margin-left: -1.5px;
    background: var(--red);
}

/* ----- Latest posts / cards ----- */
.fs-latest .sec-head { margin-bottom: 1.6rem; }
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.2rem;
}
.card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 14px;
    background: var(--paper-light);
    border: 1px solid rgba(110, 100, 85, 0.35);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 8px 14px -10px rgba(31, 42, 46, 0.45);
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 rgba(31, 42, 46, 0.18); }
.card-thumb-wrap { position: relative; overflow: hidden; background: var(--paper-deep); }
.card-thumb-wrap a { display: block; }
.card-thumb-wrap img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 1;
    object-fit: cover;
    filter: sepia(0.08) contrast(1.02);
}
.card-frame {
    position: absolute;
    inset: 10px;
    pointer-events: none;
    background:
        linear-gradient(var(--red), var(--red)) left top / 26px 3px no-repeat,
        linear-gradient(var(--red), var(--red)) left top / 3px 26px no-repeat,
        linear-gradient(var(--red), var(--red)) right top / 26px 3px no-repeat,
        linear-gradient(var(--red), var(--red)) right top / 3px 26px no-repeat,
        linear-gradient(var(--red), var(--red)) left bottom / 26px 3px no-repeat,
        linear-gradient(var(--red), var(--red)) left bottom / 3px 26px no-repeat,
        linear-gradient(var(--red), var(--red)) right bottom / 26px 3px no-repeat,
        linear-gradient(var(--red), var(--red)) right bottom / 3px 26px no-repeat;
}
.card-dim {
    position: absolute;
    left: 22%; right: 22%; bottom: 18px;
    height: 1px;
    background: rgba(255, 255, 255, 0.9);
    pointer-events: none;
}
.card-dim::before, .card-dim::after {
    content: "";
    position: absolute;
    top: -5px;
    width: 1px; height: 11px;
    background: rgba(255, 255, 255, 0.9);
}
.card-dim::before { left: 0; }
.card-dim::after { right: 0; }
.card-dim span {
    position: absolute;
    left: 50%; top: -9px;
    transform: translateX(-50%);
    padding: 0 6px;
    font-family: var(--f-mono);
    font-size: 0.68rem;
    line-height: 18px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(31, 42, 46, 0.55);
    white-space: nowrap;
}
.card-body { flex: 1; display: flex; flex-direction: column; padding: 1rem 0.2rem 0.2rem; min-width: 0; }
.card-title {
    margin: 0 0 0.45rem;
    font-family: var(--f-head);
    font-weight: 600;
    font-size: 1.4rem;
    line-height: 1.15;
    text-transform: uppercase;
}
.card-title a { text-decoration: none; color: var(--ink); }
.card-title a:hover { color: var(--red); }
.card-excerpt {
    flex: 1;
    font-family: var(--f-mono);
    font-size: 0.82rem;
    line-height: 1.6;
    color: #3B4448;
}
.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.6rem;
    margin-top: 0.8rem;
}
.card-date { font-family: var(--f-mono); font-size: 0.85rem; color: var(--muted); }
.card .stamp-link { font-size: 0.82rem; padding: 0.35em 0.75em 0.3em; transform: rotate(-4deg); }
.card .stamp-link:hover { transform: rotate(-4deg) translate(-2px, -2px); }
.latest-more { margin: 1.8rem 0 0; text-align: right; }
.empty-note { font-family: var(--f-mono); color: var(--muted); padding: 1.2rem 1.4rem; border: 1px dashed var(--muted); }

/* ----- 03 Moving route + facts ----- */
.fs-move {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 250px);
    gap: 2rem 2.4rem;
    align-items: start;
}
.route {
    position: relative;
    aspect-ratio: 1000 / 260;
    container-type: inline-size;
    margin-top: 0.4rem;
}
.route-path { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.route-steps { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.route-step { position: absolute; left: var(--x); top: 0; bottom: 0; width: 0; }
.route-dot {
    position: absolute;
    left: 0; top: var(--y);
    width: 2.1cqw; height: 2.1cqw;
    min-width: 12px; min-height: 12px;
    border-radius: 50%;
    background: var(--red);
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 3px var(--paper);
}
.route-name {
    position: absolute;
    left: 0;
    transform: translateX(-50%);
    font-family: var(--f-head);
    font-weight: 600;
    font-size: clamp(12px, 3.1cqw, 30px);
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}
.route-ic {
    position: absolute;
    left: 0;
    display: block;
    width: auto;
    height: 7.2cqw;
    max-width: none;
    transform: translateX(-50%);
}
.route-ic-wide { height: 6.8cqw; }
.is-up .route-name { bottom: calc(100% - var(--y) + 3.2cqw); }
.is-up .route-ic { top: calc(var(--y) + 3.6cqw); }
.is-down .route-name { top: calc(var(--y) + 3.2cqw); }
.is-down .route-ic { bottom: calc(100% - var(--y) + 3.6cqw); }

.facts {
    border-left: 3px solid var(--ink);
    padding: 0.2rem 0 0.4rem 1.6rem;
    margin-top: 0.4rem;
}
.facts-title {
    margin: 0 0 1rem;
    font-family: var(--f-head);
    font-weight: 700;
    font-size: 2rem;
    text-transform: uppercase;
}
.facts-list { margin: 0; }
.fact { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1rem; }
.fact dt {
    font-family: var(--f-head);
    font-weight: 700;
    font-size: 2.6rem;
    line-height: 1;
    min-width: 4.4rem;
    white-space: nowrap;
}
.fact dd {
    margin: 0;
    font-family: var(--f-mono);
    font-size: 0.85rem;
    line-height: 1.35;
    min-width: 0;
}

/* ----- 04 Handbook table ----- */
.handbook-wrap { overflow-x: auto; }
.handbook {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid var(--ink);
    background: rgba(244, 237, 224, 0.55);
}
.handbook th, .handbook td {
    border: 1.5px solid var(--ink);
    padding: 0.75rem 0.9rem;
    text-align: left;
    vertical-align: top;
}
.handbook thead th {
    font-family: var(--f-mono);
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    background: rgba(201, 187, 160, 0.35);
}
.handbook tbody th {
    font-family: var(--f-head);
    font-weight: 600;
    font-size: 1.5rem;
    text-transform: uppercase;
    white-space: nowrap;
}
.handbook td { font-family: var(--f-mono); font-size: 0.84rem; line-height: 1.5; }
.handbook .hb-no { width: 3.2rem; font-family: var(--f-mono); color: var(--red); font-weight: 500; text-align: center; }

/* ---------- Inner pages ---------- */
.inner-main { padding: 1.6rem 0 3.5rem; }
.crumbs {
    margin: 0 0 1.8rem;
    font-family: var(--f-mono);
    font-size: 0.82rem;
    color: var(--muted);
}
.crumbs a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--red); }
.crumbs a:hover { color: var(--red); }
.crumbs-sep { color: var(--red); margin: 0 0.3rem; }
.crumbs-now { color: var(--muted); }

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

.page-head, .entry-head { margin-bottom: 1.6rem; padding-bottom: 0.8rem; border-bottom: 3px solid var(--ink); position: relative; }
.page-head::after, .entry-head::after {
    content: "";
    position: absolute;
    left: 0; bottom: -7px;
    width: 90px; height: 4px;
    background: var(--red);
}
.page-title {
    margin: 0;
    font-family: var(--f-head);
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.08;
    text-transform: uppercase;
}
.page-lead { margin: 0.7rem 0 0; color: var(--muted); }
.entry-meta { margin: 0.6rem 0 0; font-family: var(--f-mono); font-size: 0.85rem; color: var(--muted); }
.entry-meta a { color: var(--red); }
.entry-meta-sep { margin: 0 0.4rem; }
.entry-thumb { margin: 0 0 1.8rem; border: 1px solid var(--muted); padding: 8px; background: var(--paper-light); }
.entry-thumb img { display: block; width: 100%; height: auto; }

.card-grid-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.8rem; }
.layout-single .card-grid-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.entry-content { font-size: 1.07rem; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content h2 { text-transform: uppercase; padding-bottom: 0.3rem; border-bottom: 2px solid var(--red); display: inline-block; }
.entry-content h3 { text-transform: uppercase; }
.entry-content a { color: var(--green); text-decoration-color: var(--red); }
.entry-content a:hover { color: var(--red); }
.entry-content ul, .entry-content ol { padding-left: 1.4rem; margin: 0 0 1.2em; }
.entry-content li { margin-bottom: 0.35em; }
.entry-content ul li::marker { color: var(--red); }
.entry-content ol li::marker { color: var(--red); font-family: var(--f-mono); }
.entry-content blockquote {
    margin: 1.8rem 0;
    padding: 1.3rem 1.6rem 1.2rem;
    background: var(--graphite);
    color: var(--on-dark);
    border-left: 6px solid var(--red);
    font-style: italic;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content blockquote cite { display: block; margin-top: 0.6rem; font-family: var(--f-mono); font-size: 0.82rem; font-style: normal; color: var(--on-dark-muted); }
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.6rem 0; border: 2px solid var(--ink); font-size: 0.95rem; }
.entry-content th, .entry-content td { border: 1px solid var(--ink); padding: 0.6rem 0.75rem; text-align: left; }
.entry-content th { font-family: var(--f-head); font-weight: 600; text-transform: uppercase; background: rgba(201, 187, 160, 0.4); }
.entry-content img { display: block; height: auto; }
.entry-content figure { margin: 1.6rem 0; }
.entry-content figcaption { font-family: var(--f-mono); font-size: 0.8rem; color: var(--muted); margin-top: 0.4rem; }
.entry-content pre { overflow-x: auto; padding: 1rem 1.2rem; background: var(--paper-deep); border: 1px solid var(--grid); font-family: var(--f-mono); font-size: 0.85rem; }
.entry-content code { font-family: var(--f-mono); font-size: 0.9em; }
.entry-content hr { border: 0; border-top: 2px dashed var(--grid); margin: 2rem 0; }
.alignleft { float: left; margin: 0.3rem 1.4rem 1rem 0; }
.alignright { float: right; margin: 0.3rem 0 1rem 1.4rem; }
.aligncenter { margin-left: auto; margin-right: auto; }
.wp-caption-text { font-family: var(--f-mono); font-size: 0.8rem; color: var(--muted); }
.entry-tags { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.entry-tags a { font-family: var(--f-mono); font-size: 0.82rem; text-decoration: none; padding: 0.2rem 0.6rem; border: 1px solid var(--ink); }
.entry-tags a:hover { background: var(--ink); color: var(--paper); }
.page-links { margin-top: 1.4rem; font-family: var(--f-mono); }

/* ---------- Pagination ---------- */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2.6rem;
    align-items: center;
}
.pager .page-numbers {
    display: inline-block;
    min-width: 2.6rem;
    padding: 0.45rem 0.8rem;
    text-align: center;
    font-family: var(--f-head);
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink);
    border: 2px solid var(--ink);
    background: var(--paper-light);
}
.pager a.page-numbers:hover { border-color: var(--red); color: var(--red); }
.pager .page-numbers.current { background: var(--red); border-color: var(--red); color: var(--paper-light); }
.pager .page-numbers.dots { border: 0; background: none; min-width: 0; }

/* ---------- Sidebar ---------- */
.sidebar {
    min-width: 0;
    padding: 1.4rem 1.4rem 0.6rem;
    background-color: var(--paper-deep);
    background-image:
        linear-gradient(rgba(201, 187, 160, 0.7) 1px, transparent 1px),
        linear-gradient(90deg, rgba(201, 187, 160, 0.7) 1px, transparent 1px);
    background-size: 11px 11px;
    border: 2px solid var(--ink);
    box-shadow: 6px 6px 0 rgba(31, 42, 46, 0.12);
    color: var(--ink);
}
.sidebar .wdg { margin-bottom: 1.6rem; }
.sidebar .wdg-title {
    margin: 0 0 0.8rem;
    padding: 0.35rem 0.7rem;
    font-family: var(--f-head);
    font-weight: 600;
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--paper-light);
    background: var(--green);
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: 0.55rem 0; border-bottom: 1px dashed rgba(31, 42, 46, 0.45); color: var(--ink); }
.sidebar li a { color: var(--ink); text-decoration: none; font-weight: 700; line-height: 1.35; }
.sidebar li a:hover { color: var(--red); }
.sidebar .post-date { display: block; font-family: var(--f-mono); font-size: 0.78rem; color: var(--muted); }
.sidebar p, .sidebar .textwidget { color: var(--ink); font-size: 0.95rem; }
.sidebar a { color: var(--ink); }
.sidebar .search-form { flex-wrap: wrap; }

/* ---------- Search form ---------- */
.search-form { display: flex; gap: 0.6rem; margin: 1.2rem 0; max-width: 560px; }
.search-field {
    flex: 1 1 200px;
    min-width: 0;
    padding: 0.65rem 0.8rem;
    border: 2px solid var(--ink);
    border-radius: 0;
    background: var(--paper-light);
    color: var(--ink);
    font-family: var(--f-mono);
    font-size: 0.95rem;
}

/* ---------- 404 ---------- */
.lost { padding: 1rem 0 2rem; }
.lost-code {
    margin: 0;
    font-family: var(--f-head);
    font-weight: 700;
    font-size: clamp(5rem, 14vw, 9rem);
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 2px var(--red);
}
.lost-text { margin-top: 1rem; max-width: 640px; }
.lost-home { margin-top: 1.4rem; }

/* ---------- Comments ---------- */
.notes { margin-top: 3rem; padding-top: 1.6rem; border-top: 3px solid var(--ink); }
.notes-title { margin-top: 0; text-transform: uppercase; }
.notes-list, .notes-list .children { list-style: none; margin: 0; padding: 0; }
.notes-list .children { padding-left: 1.6rem; border-left: 2px dashed var(--grid); }
.note-card { margin: 0 0 1.2rem; padding: 1rem 1.2rem; background: var(--paper-light); border: 1px solid rgba(110, 100, 85, 0.4); }
.note-head { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.note-head img { border-radius: 0; display: block; }
.note-author { font-family: var(--f-head); font-weight: 600; text-transform: uppercase; }
.note-date { font-family: var(--f-mono); font-size: 0.8rem; color: var(--muted); }
.note-wait { font-family: var(--f-mono); font-size: 0.82rem; color: var(--red); }
.note-body p:last-child { margin-bottom: 0.4rem; }
.note-reply a { font-family: var(--f-head); text-transform: uppercase; font-size: 0.9rem; color: var(--red); text-decoration: none; }
.comment-respond { margin-top: 2rem; padding: 1.4rem 1.5rem; border: 2px solid var(--ink); background: rgba(244, 237, 224, 0.75); }
.comment-reply-title { margin-top: 0; text-transform: uppercase; }
.comment-reply-title small { margin-left: 0.6rem; font-family: var(--f-mono); font-size: 0.8rem; }
.comment-form label { display: block; font-family: var(--f-mono); font-size: 0.82rem; margin-bottom: 0.25rem; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 2px solid var(--ink);
    border-radius: 0;
    background: var(--paper-light);
    color: var(--ink);
    font-family: var(--f-body);
    font-size: 1rem;
}
.comment-form-cookies-consent { display: flex; gap: 0.5rem; align-items: flex-start; }
.comment-form-cookies-consent label { display: inline; }
.comment-form .submit {
    padding: 0.6rem 1.3rem;
    border: 3px solid var(--red);
    background: transparent;
    color: var(--red);
    font-family: var(--f-head);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
}
.comment-form .submit:hover { background: var(--red); color: var(--paper-light); }

/* ---------- Footer ---------- */
.foot {
    margin-top: 1rem;
    padding: 3rem 0 1.6rem;
    background-color: var(--green);
    background-image:
        linear-gradient(rgba(237, 228, 211, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(237, 228, 211, 0.05) 1px, transparent 1px);
    background-size: 22px 22px;
    color: var(--on-dark);
}
.foot-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem 3rem;
}
.foot-col { min-width: 0; color: var(--on-dark); }
.foot .wdg { margin-bottom: 1.2rem; }
.foot .wdg-title {
    margin: 0 0 0.9rem;
    font-family: var(--f-head);
    font-weight: 600;
    font-size: 1.6rem;
    text-transform: uppercase;
    color: #E4CFA6;
}
.foot p, .foot .textwidget, .foot li {
    font-family: var(--f-mono);
    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--on-dark);
}
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 0.4rem; }
.foot a { color: #E4CFA6; text-decoration: underline; text-decoration-color: rgba(228, 207, 166, 0.6); text-underline-offset: 4px; }
.foot a:hover { color: #FFFFFF; text-decoration-color: var(--red); }
.foot .post-date { color: var(--on-dark-muted); }
.foot-base { margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid rgba(237, 228, 211, 0.25); }
.foot-copy { margin: 0; text-align: center; font-family: var(--f-mono); font-size: 0.82rem; color: var(--on-dark); }

/* ---------- Cookie banner ---------- */
.cookie-banner {
    position: fixed;
    left: 1rem; right: 1rem; bottom: 1rem;
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 1rem 1.5rem;
    max-width: 860px;
    margin-inline: auto;
    padding: 1.1rem 1.4rem;
    background: var(--graphite);
    color: var(--on-dark);
    border: 2px solid var(--red);
    box-shadow: 6px 6px 0 rgba(31, 42, 46, 0.35);
}
.cookie-text { margin: 0; flex: 1; min-width: 0; font-family: var(--f-mono); font-size: 0.82rem; line-height: 1.5; }
.cookie-accept { flex: 0 0 auto; color: #F1B3AA; border-color: var(--red); }
.cookie-accept:hover { color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .front-main { width: 92%; }
    .inspect-grid { grid-template-columns: minmax(0, 1fr); }
    .inspect-side { max-width: 560px; }
    .fs-money { margin-inline: 0; padding: 2.2rem 1.8rem; }
    .money-top { grid-template-columns: minmax(0, 1fr); }
    .sec-head-light { grid-column: auto; }
    .mn-3, .mn-4, .mn-5 { grid-column: auto; }
    .money-note::after { display: none; }
    .ruler { padding-top: 0; margin-top: 1.8rem; }
    .ruler-axis { display: none; }
    .ruler-marks { grid-template-columns: minmax(0, 1fr); border-left: 2px solid var(--on-dark); margin-left: 6px; }
    .ruler-marks li { text-align: left; padding: 0.55rem 0 0.55rem 1.4rem; }
    .ruler-marks li::before { left: 0; top: 50%; width: 14px; height: 2px; margin: 0; }
    .ruler-marks li::after { left: -5px; top: 50%; width: 8px; height: 8px; margin: -4px 0 0; border-radius: 50%; }
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fs-move { grid-template-columns: minmax(0, 1fr); }
    .facts { border-left: 0; border-top: 3px solid var(--ink); padding: 1.2rem 0 0; }
    .facts-list { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; }
    .layout-with-sidebar { grid-template-columns: minmax(0, 1fr); gap: 2.4rem; }
    .layout-single { width: 100%; }
    .layout-single .card-grid-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .foot-col-3 { grid-column: 1 / -1; }
    .topnav-list { gap: 0.3rem 1.4rem; }
}

@media (max-width: 760px) {
    .masthead-row { flex-wrap: wrap; }
    .brand { flex: 1 1 calc(100% - 130px); }
    .nav-toggle { display: inline-flex; }
    .topnav { display: none; width: 100%; }
    .topnav.is-open { display: block; }
    .topnav-list { flex-direction: column; gap: 0; border-top: 2px solid var(--ink); }
    .topnav-list li { border-bottom: 1px dashed rgba(31, 42, 46, 0.4); }
    .topnav-list a { display: block; padding: 0.7rem 0; }
}

@media (max-width: 600px) {
    body { font-size: 1rem; }
    .fs { padding: 2.2rem 0 1rem; }
    .fs-money { padding: 1.8rem 1.3rem; }
    .brand-svg { width: 56px; height: 56px; }
    .brand-desc { -webkit-line-clamp: 3; }
    .handlist li { font-size: 1.5rem; }
    .card-grid, .card-grid-list, .layout-single .card-grid-list { grid-template-columns: minmax(0, 1fr); }

    .route { aspect-ratio: auto; container-type: normal; }
    .route-path { display: none; }
    .route-steps { position: static; border-left: 2px dashed var(--ink); margin-left: 10px; }
    .route-step {
        position: static;
        width: auto;
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 0.7rem 0 0.7rem 1.4rem;
        position: relative;
        left: auto;
        top: auto;
    }
    .route-dot { left: -1px; top: 50%; width: 16px; height: 16px; min-width: 0; min-height: 0; }
    .route-name, .is-up .route-name, .is-down .route-name { position: static; transform: none; font-size: 1.35rem; flex: 1; min-width: 0; white-space: normal; }
    .route-ic, .route-ic-wide, .is-up .route-ic, .is-down .route-ic { position: static; transform: none; height: 54px; order: 2; }

    .handbook, .handbook tbody, .handbook tr, .handbook td, .handbook tbody th { display: block; width: 100%; }
    .handbook { border: 0; background: none; }
    .handbook thead { display: none; }
    .handbook tr { position: relative; margin-bottom: 1.2rem; border: 2px solid var(--ink); background: rgba(244, 237, 224, 0.75); }
    .handbook th, .handbook td { border: 0; border-top: 1px solid rgba(31, 42, 46, 0.35); padding: 0.55rem 0.8rem; }
    .handbook .hb-no { position: absolute; right: 0; top: 0; width: auto; border: 0; padding: 0.7rem 0.8rem; }
    .handbook tbody th { font-size: 1.3rem; white-space: normal; border-top: 0; background: rgba(201, 187, 160, 0.35); }
    .handbook td[data-label]::before { content: attr(data-label); display: block; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
    .foot-cols { grid-template-columns: minmax(0, 1fr); }
    .foot-col-3 { grid-column: auto; }
    .cookie-banner { flex-direction: column; align-items: stretch; padding: 1rem 1.1rem; }
    .cookie-accept { align-self: flex-start; }
    .layout-single { width: 100%; }
    .alignleft, .alignright { float: none; margin: 1rem 0; }
}
