/*
Theme Name: Ridge Board
Description: A theme for a site of roofing guides for homeowners, sorted into topics. The guides link to one another: the guide that links to the most others is read as the guide map, and the topics it lists group every other guide under a topic with its main guide; a guide is found by its address or, when the site gave it another address, by its title. The front page draws a house with a tiled roof beside the title, lists the topics in a numbered strip, then gives every topic a band of its own: its main guide with the opening of that guide, and every guide in the topic. A guide opens under a path line to its topic, reads in two columns with the guides of its topic beside it, and steps to the guide before and after it in its topic.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ridge-board
*/

:root {
	--rdb-ground: #fef2ec;
	--rdb-paper: #fcfff3;
	--rdb-field: #ecdfd3;
	--rdb-sky: #dbe8ef;
	--rdb-wall: #efe3cc;
	--rdb-ink: #2a231e;
	--rdb-ink-soft: #5b5148;
	--rdb-link: #1d5c86;
	--rdb-link-hover: #9a3412;
	--rdb-clay: #a3441d;
	--rdb-on-clay: #ffffff;
	--rdb-slate: #2c3a44;
	--rdb-on-slate: #fef2ec;
	--rdb-roofline: #d9774f;
	--rdb-rule: #ddd0bd;
	--rdb-rule-strong: #7a6e62;
	--rdb-focus: #a3441d;
	--rdb-head: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
	--rdb-text: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
	--rdb-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme:dark) {
	:root {
		--rdb-ground: #180c06;
		--rdb-paper: #201612;
		--rdb-field: #29231c;
		--rdb-sky: #233039;
		--rdb-wall: #3a3226;
		--rdb-ink: #f1e3da;
		--rdb-ink-soft: #c2b6a6;
		--rdb-link: #8cc6ef;
		--rdb-link-hover: #f4a37c;
		--rdb-clay: #e07a52;
		--rdb-on-clay: #1a1410;
		--rdb-slate: #06111b;
		--rdb-on-slate: #f1e3da;
		--rdb-roofline: #e07a52;
		--rdb-rule: #3a332b;
		--rdb-rule-strong: #9a8e80;
		--rdb-focus: #f4a37c;
	}
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body { margin: 0; background: var(--rdb-ground); color: var(--rdb-ink); font: 1.0625rem/1.65 var(--rdb-text); overflow-wrap: break-word; }
img, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: var(--rdb-link); text-underline-offset: 3px; }
a:hover { color: var(--rdb-link-hover); }
:focus-visible { outline: 3px solid var(--rdb-focus); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--rdb-head); font-weight: 700; line-height: 1.18; text-wrap: balance; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); border: 0; white-space: nowrap; }
.rdb-skipper:focus { position: fixed; top: 8px; left: 8px; z-index: 10; width: auto; height: auto; margin: 0; padding: 10px 14px; clip-path: none; background: var(--rdb-paper); color: var(--rdb-link); }
.rdb-lane { width: min(100% - 32px, 76rem); margin-inline: auto; }

/* The top bar */
.rdb-capstrip { background: var(--rdb-slate); color: var(--rdb-on-slate); border-bottom: 4px solid var(--rdb-roofline); }
.rdb-capstrip a { color: var(--rdb-on-slate); }
.rdb-capstrip-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 24px; min-height: 64px; padding-block: 6px; }
.rdb-housemark { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font: 700 1.25rem/1.2 var(--rdb-head); text-decoration: none; }
.rdb-housemark-pic { width: 36px; height: 28px; }
.rdb-housemark-roof { fill: var(--rdb-roofline); }
.rdb-housemark-chim { fill: var(--rdb-roofline); }
.rdb-housemark-wall { fill: var(--rdb-on-slate); }
.rdb-housemark-door { fill: var(--rdb-slate); }
.rdb-capstrip-menu ul, .rdb-groundline-menu ul { display: flex; flex-wrap: wrap; gap: 0 20px; margin: 0; padding: 0; list-style: none; }
.rdb-capstrip-menu a, .rdb-groundline-menu a { display: inline-flex; align-items: center; min-height: 44px; }

/* The front page: the house and the topic strip */
.rdb-gableview { padding-block: 34px 30px; background: linear-gradient(180deg, var(--rdb-sky), var(--rdb-ground)); }
.rdb-gableview-in { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: center; }
.rdb-gableview-h { margin: 0; max-width: 18ch; font-size: clamp(2rem, 1.35rem + 2.6vw, 3.375rem); }
.rdb-gableview-say { margin: 14px 0 0; max-width: 42rem; font-size: 1.125rem; color: var(--rdb-ink-soft); }
.rdb-gableview-count { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; font: 600 0.9375rem/1.2 var(--rdb-text); }
.rdb-gableview-count li { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; background: var(--rdb-paper); border: 1px solid var(--rdb-rule-strong); border-radius: 22px; }
.rdb-gableview-count a { display: inline-flex; align-items: center; min-height: 44px; }
.rdb-gableview-words .rdb-asker { margin-top: 20px; max-width: 38rem; }
.rdb-housepic { justify-self: center; width: min(100%, 26rem); }
.rdb-housepic-svg { display: block; width: 100%; height: auto; }
.rdb-hp-sky { fill: var(--rdb-sky); }
.rdb-hp-roof { fill: var(--rdb-clay); }
.rdb-hp-tiles, .rdb-hp-seams { fill: none; stroke: var(--rdb-slate); stroke-width: 2; stroke-opacity: 0.45; }
.rdb-hp-ridge, .rdb-hp-flash { fill: var(--rdb-slate); }
.rdb-hp-chimney { fill: var(--rdb-link-hover); }
.rdb-hp-gutter, .rdb-hp-spout { fill: var(--rdb-rule-strong); }
.rdb-hp-wall { fill: var(--rdb-wall); }
.rdb-hp-door { fill: var(--rdb-link); }
.rdb-hp-window { fill: var(--rdb-paper); stroke: var(--rdb-slate); stroke-width: 3; }
.rdb-hp-sash { fill: none; stroke: var(--rdb-slate); stroke-width: 2; }
.rdb-hp-ground { fill: var(--rdb-field); }
.rdb-topicstrip { margin-top: 26px; }
.rdb-topicstrip-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 0; padding: 0; list-style: none; }
.rdb-topicstrip-list a { display: flex; align-items: center; gap: 10px; min-height: 48px; height: 100%; padding: 8px 14px; background: var(--rdb-paper); border: 1px solid var(--rdb-rule); border-left: 5px solid var(--rdb-clay); border-radius: 4px; text-decoration: none; line-height: 1.3; }
.rdb-topicstrip-no { flex: none; font: 700 0.875rem/1 var(--rdb-mono); color: var(--rdb-ink-soft); }
.rdb-topicstrip-name { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* The search box */
.rdb-asker { display: flex; align-items: stretch; background: var(--rdb-paper); border: 2px solid var(--rdb-rule-strong); border-radius: 26px; overflow: hidden; }
.rdb-asker:focus-within { border-color: var(--rdb-focus); }
.rdb-asker-box { flex: 1 1 0; width: 0; min-width: 0; min-height: 50px; padding: 6px 4px 6px 20px; background: transparent; color: var(--rdb-ink); border: 0; font: inherit; }
.rdb-asker-box:focus-visible { outline: none; }
.rdb-asker-box::placeholder { color: var(--rdb-ink-soft); opacity: 1; }
.rdb-asker-go { display: inline-flex; align-items: center; gap: 8px; min-height: 50px; min-width: 50px; padding: 0 20px; background: var(--rdb-clay); color: var(--rdb-on-clay); border: 0; font: 700 1rem/1 var(--rdb-text); cursor: pointer; }
.rdb-asker-go:focus-visible { outline: 3px solid var(--rdb-slate); outline-offset: -5px; }
.rdb-asker-lens { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }

/* One band for each topic */
.rdb-bay { padding-block: 34px 36px; background: var(--rdb-paper); border-top: 1px solid var(--rdb-rule); }
.rdb-bay:nth-child(even) { background: var(--rdb-field); }
.rdb-bay-in { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.rdb-bay-no { margin: 0; font: 700 0.875rem/1.2 var(--rdb-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--rdb-clay); }
.rdb-bay-h { margin: 6px 0 0; font-size: clamp(1.625rem, 1.3rem + 1.2vw, 2.25rem); }
.rdb-bay-n { margin: 6px 0 0; font: 600 0.875rem/1.3 var(--rdb-mono); color: var(--rdb-ink-soft); }
.rdb-keyguide { margin-top: 16px; padding: 14px 16px; background: var(--rdb-ground); border: 1px solid var(--rdb-rule); border-left: 6px solid var(--rdb-clay); border-radius: 0 6px 6px 0; }
.rdb-bay:nth-child(even) .rdb-keyguide { background: var(--rdb-paper); }
.rdb-keyguide-k { margin: 0; font: 700 0.75rem/1.2 var(--rdb-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--rdb-ink-soft); }
.rdb-keyguide-name { display: block; min-height: 44px; padding-block: 6px 2px; font: 700 1.1875rem/1.3 var(--rdb-head); }
.rdb-keyguide-say { margin: 6px 0 0; font-size: 0.9688rem; color: var(--rdb-ink-soft); }
.rdb-baylist { margin: 0; padding: 0; list-style: none; }
.rdb-baylist li { break-inside: avoid; border-bottom: 1px dashed var(--rdb-rule-strong); line-height: 1.35; }
.rdb-baylist a { display: flex; align-items: center; min-height: 44px; padding-block: 8px; }
.rdb-strays { padding-block: 30px 34px; background: var(--rdb-ground); border-top: 1px solid var(--rdb-rule); }
.rdb-strays-h { margin: 0 0 10px; font-size: 1.5rem; }

/* Recently published and the other lists */
.rdb-newrow { padding-block: 34px 44px; border-top: 1px solid var(--rdb-rule); }
.rdb-newrow-h { margin: 0; font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem); }
.rdb-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 18px 0 0; padding: 0; list-style: none; }
.rdb-guidecard { display: flex; flex-direction: column; padding: 14px 16px 12px; background: var(--rdb-paper); border: 1px solid var(--rdb-rule); border-radius: 6px; }
.rdb-guidecard-topic { margin: 0; font: 700 0.75rem/1.3 var(--rdb-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--rdb-clay); }
.rdb-guidecard-name { display: block; min-height: 44px; padding-block: 6px 2px; font: 700 1.125rem/1.3 var(--rdb-head); }
.rdb-guidecard-say { margin: 4px 0 0; font-size: 0.9688rem; color: var(--rdb-ink-soft); }
.rdb-guidecard-date { margin: auto 0 0; padding-top: 8px; font: 600 0.8125rem/1.3 var(--rdb-mono); color: var(--rdb-ink-soft); }
.rdb-plainlist { padding-block: 28px 40px; }
.rdb-pagetitle { margin: 0 0 8px; font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem); }
.rdb-plainlist-back a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.rdb-plainlist .rdb-asker { margin-block: 12px 8px; max-width: 38rem; }
.rdb-nothing { margin: 16px 0; font-size: 1.125rem; }
.pagination { margin-top: 24px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 12px; background: var(--rdb-paper); border: 1px solid var(--rdb-rule-strong); border-radius: 22px; font: 600 0.9375rem/1 var(--rdb-mono); text-decoration: none; }
.pagination .page-numbers.current { background: var(--rdb-clay); color: var(--rdb-on-clay); border-color: var(--rdb-clay); }
.rdb-leaps { display: grid; gap: 6px; margin-top: 12px; }
.rdb-leaps-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.rdb-leaps-k { min-width: 9rem; font: 700 0.8125rem/1.3 var(--rdb-mono); color: var(--rdb-ink-soft); }
.rdb-leaps-go { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 10px; background: var(--rdb-paper); border: 1px solid var(--rdb-rule-strong); border-radius: 22px; font: 600 0.875rem/1 var(--rdb-mono); text-decoration: none; }
.rdb-leaps-here { background: var(--rdb-clay); color: var(--rdb-on-clay); border-color: var(--rdb-clay); }

/* One guide */
.rdb-pathline { background: var(--rdb-field); border-bottom: 1px solid var(--rdb-rule); }
.rdb-pathline-in { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; padding-block: 2px; font-weight: 600; }
.rdb-pathline a { display: inline-flex; align-items: center; min-height: 44px; }
.rdb-pathline-gap { color: var(--rdb-ink-soft); }
.rdb-titleblock { position: relative; padding-block: 26px 30px; background: var(--rdb-paper); border-bottom: 1px solid var(--rdb-rule); }
.rdb-titleblock::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 14px; background: var(--rdb-clay); clip-path: polygon(0 100%, 50% 0, 100% 100%, 100% 100%, 50% 30%, 0 100%); }
.rdb-titleblock-h { margin: 0; max-width: 32ch; font-size: clamp(1.875rem, 1.4rem + 1.9vw, 2.875rem); }
.rdb-titleblock-facts { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 0.9375rem; }
.rdb-titleblock-facts li { padding: 3px 12px; background: var(--rdb-ground); border: 1px solid var(--rdb-rule); border-radius: 16px; color: var(--rdb-ink-soft); }
.rdb-reading { display: grid; gap: 28px; padding-block: 32px 36px; }
.rdb-reading-text { min-width: 0; max-width: 44rem; }
.rdb-reading-text > :first-child { margin-top: 0; }
.rdb-reading-text p, .rdb-reading-text ul, .rdb-reading-text ol { margin-block: 0 1em; }
.rdb-reading-text li { margin-bottom: 0.35em; }
.rdb-reading-text h2 { margin: 1.7em 0 0.55em; font-size: 1.5rem; }
.rdb-reading-text h3 { margin: 1.4em 0 0.5em; font-size: 1.25rem; }
.rdb-reading-text .rdb-opener { padding: 14px 18px; background: var(--rdb-paper); border-left: 5px solid var(--rdb-clay); border-radius: 0 6px 6px 0; font-size: 1.1875rem; line-height: 1.6; }
.rdb-reading-text .rdb-cited { padding: 12px 16px 4px 34px; background: var(--rdb-field); border-radius: 6px; font-size: 0.9375rem; }
.rdb-tablepan { max-width: 100%; overflow-x: auto; margin: 0 0 1.2em; }
.rdb-tablepan:focus-visible { outline-offset: 4px; }
.rdb-reading-text table { width: 100%; margin: 0; border-collapse: collapse; font-size: 0.9688rem; line-height: 1.5; }
.rdb-reading-text figure { margin: 0 0 1.2em; }
.rdb-reading-text figure .rdb-tablepan { margin: 0; }
.rdb-reading-text th { padding: 9px 12px; background: var(--rdb-field); color: var(--rdb-ink); border-bottom: 2px solid var(--rdb-rule-strong); text-align: left; vertical-align: bottom; }
.rdb-reading-text td { padding: 9px 12px; border-bottom: 1px solid var(--rdb-rule); vertical-align: top; }
.rdb-reading-text blockquote { margin: 0 0 1em; padding-left: 16px; border-left: 3px solid var(--rdb-rule-strong); }
.rdb-reading-text code { font: 0.9em/1.4 var(--rdb-mono); }
.rdb-reading-text pre { overflow-x: auto; padding: 12px 14px; background: var(--rdb-paper); border: 1px solid var(--rdb-rule); }
.rdb-ownnote { color: var(--rdb-ink-soft); }
.rdb-pagebreaks { font-weight: 600; }
.rdb-caution { margin-top: 28px; padding: 16px 18px; background: var(--rdb-paper); border: 1px solid var(--rdb-rule); border-top: 4px solid var(--rdb-clay); border-radius: 0 0 6px 6px; color: var(--rdb-ink-soft); font-size: 0.9688rem; }
.rdb-reading-text .rdb-caution-h { margin: 0 0 6px; font-size: 1.0625rem; color: var(--rdb-ink); }
.rdb-caution p { margin: 0; }
.rdb-sideboard { display: grid; gap: 14px; align-content: start; min-width: 0; }
.rdb-sideboard-box { padding: 12px 16px 10px; background: var(--rdb-paper); border: 1px solid var(--rdb-rule); border-top: 4px solid var(--rdb-clay); border-radius: 0 0 6px 6px; }
.rdb-sideboard-h { margin: 0 0 6px; font: 700 0.9375rem/1.3 var(--rdb-head); }
.rdb-sideboard-list { margin: 0; padding: 0; list-style: none; }
.rdb-sideboard-list li { border-top: 1px solid var(--rdb-rule); line-height: 1.35; }
.rdb-sideboard-list li:first-child { border-top: 0; }
.rdb-sideboard-list a, .rdb-sideboard-here { display: flex; align-items: center; min-height: 44px; padding-block: 8px; font-size: 0.9375rem; }
.rdb-sideboard-here { padding-left: 10px; border-left: 4px solid var(--rdb-clay); font-weight: 700; }
.rdb-nextdoor { padding-block: 24px; background: var(--rdb-field); border-top: 1px solid var(--rdb-rule); }
.rdb-nextdoor-in { display: grid; gap: 10px; }
.rdb-nextdoor-go { display: grid; gap: 4px; min-height: 44px; padding: 12px 16px; background: var(--rdb-paper); border: 1px solid var(--rdb-rule-strong); border-radius: 6px; text-decoration: none; }
.rdb-nextdoor-k { font: 600 0.8125rem/1.25 var(--rdb-mono); color: var(--rdb-ink-soft); }
.rdb-nextdoor-name { line-height: 1.35; text-decoration: underline; text-underline-offset: 3px; }
.rdb-commentwrap { padding-block: 8px 32px; }

/* Pages that are not guides, and the missing page */
.rdb-plainpage { width: min(100% - 32px, 46rem); margin-inline: auto; padding-block: 28px 40px; }
.rdb-plainpage-text p { margin-block: 0 1em; }
.rdb-homeward { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

/* Comments */
.rdb-convo { max-width: 44rem; margin-top: 8px; }
.rdb-convo-h, .comment-reply-title { font-size: 1.3125rem; }
.rdb-convo-list { padding-left: 1.2em; }
.comment-form label { display: block; font-weight: 600; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; min-height: 44px; padding: 6px 10px; background: var(--rdb-paper); color: var(--rdb-ink); border: 1px solid var(--rdb-rule-strong); border-radius: 6px; font: inherit; }
.comment-form .submit { min-height: 44px; padding: 6px 20px; background: var(--rdb-clay); color: var(--rdb-on-clay); border: 0; border-radius: 22px; font: 700 1rem/1.2 var(--rdb-text); cursor: pointer; }

/* The bottom of every page */
.rdb-groundline { padding-block: 26px 28px; background: var(--rdb-slate); color: var(--rdb-on-slate); border-top: 4px solid var(--rdb-roofline); }
.rdb-groundline a { color: var(--rdb-on-slate); }
.rdb-groundline-in { display: grid; gap: 14px; }
.rdb-groundline-h { margin: 0 0 8px; font-size: 1.125rem; }
.rdb-groundline-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; margin: 0; padding: 0; list-style: none; }
.rdb-groundline-row a { display: flex; align-items: center; min-height: 44px; padding-block: 8px; font-size: 0.9375rem; line-height: 1.35; }
.rdb-groundline-year { margin: 0; font-size: 0.9375rem; }

@media (max-width: 639px) {
	.rdb-groundline-menu ul { display: grid; grid-template-columns: 1fr 1fr; }
	.rdb-reading-text table { table-layout: fixed; }
	.rdb-reading-text th, .rdb-reading-text td { padding: 8px 6px; overflow-wrap: anywhere; hyphens: auto; }
	.rdb-housepic { order: -1; width: min(100%, 20rem); }
}

@media (min-width: 640px) {
	.rdb-topicstrip-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.rdb-baylist { columns: 2; column-gap: 28px; }
	.rdb-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.rdb-groundline-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.rdb-groundline-menu ul { flex-wrap: nowrap; }
	.rdb-nextdoor-in { grid-template-columns: 1fr 1fr; }
	.rdb-nextdoor-on { grid-column: 2; }
}

@media (min-width: 900px) {
	.rdb-gableview-in { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 40px; }
	.rdb-topicstrip-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.rdb-bay-in { grid-template-columns: minmax(0, 21rem) minmax(0, 1fr); column-gap: 44px; }
}

@media (min-width: 1000px) {
	.rdb-reading { grid-template-columns: minmax(0, 44rem) minmax(17rem, 21rem); justify-content: space-between; column-gap: 48px; }
	.rdb-sideboard { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
	.rdb-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.rdb-groundline-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1240px) {
	.rdb-topicstrip-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media print {
	.rdb-capstrip, .rdb-groundline, .rdb-sideboard, .rdb-nextdoor, .rdb-convo, .pagination, .rdb-leaps, .rdb-housepic, .rdb-asker, .rdb-topicstrip { display: none; }
	.rdb-titleblock::after { display: none; }
}
