/*
Theme Name: Piping Desk
Theme URI: https://pipingdesk.com
Author: Piping Desk
Description: Blueprint-style blog theme for process piping articles on onshore and offshore oil & gas projects. Topics, Onshore/Offshore tags, difficulty levels, read time, table of contents, related posts, share buttons, author box, dark mode, reference tools (pipe schedules, flange ratings, B31.3 wall thickness) and ready-made blocks.
Version: 1.1.0
Requires at least: 6.2
Tested up to: 6.8
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: pipingdesk
Tags: blog, two-columns, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready
*/

/* ---------- Tokens (light) ---------- */
:root {
	--pd-brand: #0E2A47;        /* navy: blueprint bands, buttons, table heads */
	--pd-brand-deep: #0A1F35;
	--pd-bg: #F4F6F8;
	--pd-surface: #FFFFFF;
	--pd-surface-2: #F4F6F8;
	--pd-ink: #0E2A47;          /* body text */
	--pd-muted: #4A5A6A;
	--pd-line: #D5DCE3;
	--pd-line-soft: #E3E8ED;
	--pd-line-strong: #9FB0C1;
	--pd-link: #1F4E79;
	--pd-steel: #1F4E79;
	--pd-accent: #C2410C;
	--pd-accent-dark: #9A3412;
	--pd-accent-text: #C2410C;
	--pd-sand: #E9DFC9;
	--pd-sand-ink: #3D3320;
	--pd-sky: #C9D6E3;
	--pd-sky-ink: #0E2A47;
	--pd-peach: #F2B58A;
	--pd-zebra: #F8FAFB;
	--pd-code-bg: #E8EDF2;
	--pd-take-bg: #FBF7EE;
	--pd-take-line: #E0D3B6;
	--pd-take-ink: #6B5A33;
	--pd-on-bg: #F6F1E6;
	--pd-off-bg: #EDF2F7;
	--pd-shadow: 0 6px 20px rgba(14, 42, 71, .08);
	--pd-sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--pd-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
	--pd-wrap: 1200px;
	--pd-radius: 10px;
	color-scheme: light;
}

/* ---------- Tokens (dark) ---------- */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--pd-brand: #0E2A47; --pd-brand-deep: #07131F;
		--pd-bg: #0B1622; --pd-surface: #112233; --pd-surface-2: #0E1C2B;
		--pd-ink: #E6EDF3; --pd-muted: #A9B8C7;
		--pd-line: #23394F; --pd-line-soft: #1B2F43; --pd-line-strong: #3B5672;
		--pd-link: #8CC4F2; --pd-steel: #8CC4F2; --pd-accent-text: #F59A62;
		--pd-zebra: #0F1F30; --pd-code-bg: #1B2F43;
		--pd-take-bg: #241E12; --pd-take-line: #4A3E25; --pd-take-ink: #E2C98F;
		--pd-on-bg: #211C12; --pd-off-bg: #0F2234;
		--pd-shadow: 0 6px 20px rgba(0, 0, 0, .35);
		color-scheme: dark;
	}
}
:root[data-theme="dark"] {
	--pd-brand: #0E2A47; --pd-brand-deep: #07131F;
	--pd-bg: #0B1622; --pd-surface: #112233; --pd-surface-2: #0E1C2B;
	--pd-ink: #E6EDF3; --pd-muted: #A9B8C7;
	--pd-line: #23394F; --pd-line-soft: #1B2F43; --pd-line-strong: #3B5672;
	--pd-link: #8CC4F2; --pd-steel: #8CC4F2; --pd-accent-text: #F59A62;
	--pd-zebra: #0F1F30; --pd-code-bg: #1B2F43;
	--pd-take-bg: #241E12; --pd-take-line: #4A3E25; --pd-take-ink: #E2C98F;
	--pd-on-bg: #211C12; --pd-off-bg: #0F2234;
	--pd-shadow: 0 6px 20px rgba(0, 0, 0, .35);
	color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--pd-bg); }
body {
	margin: 0;
	font-family: var(--pd-sans);
	font-size: 17px;
	line-height: 1.6;
	color: var(--pd-ink);
	background: var(--pd-bg);
	-webkit-font-smoothing: antialiased;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}
body > * { flex-shrink: 0; }
#pd-main { flex: 1 0 auto; }
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--pd-link); }
a:hover, a:focus { color: var(--pd-accent-text); }
:focus-visible { outline: 3px solid var(--pd-accent); outline-offset: 2px; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.01em; margin: 0; }
.pd-wrap { max-width: var(--pd-wrap); margin: 0 auto; padding: 0 24px; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.screen-reader-text:focus {
	clip: auto; width: auto; height: auto; z-index: 1000; top: 8px; left: 8px;
	background: #fff; padding: 12px 16px; color: #0E2A47;
}
.pd-mono { font-family: var(--pd-mono); }
.pd-eyebrow {
	font-family: var(--pd-mono); font-size: 13px; letter-spacing: 0.08em;
	text-transform: uppercase; color: var(--pd-muted); margin: 0 0 6px;
}

/* Blueprint grid background (always navy, in both modes) */
.pd-blueprint {
	background-color: var(--pd-brand);
	background-image:
		linear-gradient(rgba(201, 214, 227, .08) 1px, transparent 1px),
		linear-gradient(90deg, rgba(201, 214, 227, .08) 1px, transparent 1px);
	background-size: 24px 24px;
	color: #fff;
}

/* ---------- Buttons & tags ---------- */
.pd-btn {
	display: inline-flex; align-items: center; gap: 8px;
	min-height: 44px; padding: 12px 20px; border-radius: 6px;
	font-family: inherit; font-weight: 600; font-size: 16px; line-height: 1.2;
	text-decoration: none; border: 1px solid transparent; cursor: pointer;
}
.pd-btn--accent { background: var(--pd-accent); color: #fff; }
.pd-btn--accent:hover, .pd-btn--accent:focus { background: var(--pd-accent-dark); color: #fff; }
.pd-btn--ghost { color: #fff; border-color: #5E7A96; background: transparent; }
.pd-btn--ghost:hover, .pd-btn--ghost:focus { color: #fff; border-color: #fff; }
.pd-btn--line { color: var(--pd-ink); border-color: var(--pd-line); background: var(--pd-surface); }
.pd-btn--line:hover, .pd-btn--line:focus { color: var(--pd-ink); border-color: var(--pd-ink); }
.pd-btn--small { min-height: 40px; padding: 10px 16px; font-size: 15px; }

.pd-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pd-tag {
	display: inline-block; font-size: 12px; font-weight: 600; line-height: 1.3;
	padding: 4px 10px; border-radius: 999px; text-decoration: none;
}
a.pd-tag:hover { filter: brightness(0.95); }
.pd-tag--onshore, a.pd-tag--onshore:hover { background: var(--pd-sand); color: var(--pd-sand-ink); }
.pd-tag--offshore, a.pd-tag--offshore:hover { background: var(--pd-sky); color: var(--pd-sky-ink); }
.pd-tag--level { border: 1px solid var(--pd-line-strong); color: var(--pd-ink); background: transparent; padding: 3px 9px; }
.pd-blueprint .pd-tag--level { border-color: #5E7A96; color: var(--pd-sky); }
.pd-topic {
	font-family: var(--pd-mono); font-size: 12px; font-weight: 600; letter-spacing: 0.05em;
	text-transform: uppercase; color: var(--pd-steel); text-decoration: none;
}
.pd-topic--block { background: var(--pd-brand); color: #fff; padding: 5px 10px; border-radius: 4px; border: 1px solid #2B4A6B; }
a.pd-topic--block:hover { color: #fff; background: #1F4E79; }

/* ---------- Header ---------- */
.pd-header { background: var(--pd-surface); border-bottom: 1px solid var(--pd-line); position: relative; z-index: 20; }
.pd-header__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 32px; padding-top: 14px; padding-bottom: 14px; }
.pd-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--pd-ink); }
.pd-brand:hover { color: var(--pd-ink); }
.pd-brand__mark { width: 36px; height: 36px; flex: none; }
.pd-brand .custom-logo { max-height: 44px; width: auto; }
.pd-brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.pd-brand__name { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.pd-brand__tag { font-family: var(--pd-mono); font-size: 11px; color: var(--pd-muted); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 3px; }
.pd-nav { flex: 1 1 360px; }
.pd-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 22px; }
.pd-nav li { position: relative; }
.pd-nav a { color: var(--pd-ink); text-decoration: none; font-weight: 500; font-size: 15px; display: inline-block; padding: 10px 0; }
.pd-nav a:hover, .pd-nav .current-menu-item > a, .pd-nav .current-cat > a { color: var(--pd-accent-text); }
.pd-nav .menu-item-has-children > a::after, .pd-nav .pd-has-sub > a::after { content: " ▾"; font-size: 12px; }
.pd-nav .sub-menu {
	display: none; position: absolute; top: 100%; left: -12px; min-width: 260px;
	background: var(--pd-surface); border: 1px solid var(--pd-line); border-radius: 8px; padding: 8px 14px;
	flex-direction: column; gap: 0; box-shadow: var(--pd-shadow);
}
.pd-nav .sub-menu a { padding: 8px 0; display: block; }
.pd-nav li:hover > .sub-menu, .pd-nav li:focus-within > .sub-menu { display: flex; }
.pd-header__actions { display: flex; gap: 10px; align-items: center; }
.pd-iconbtn {
	width: 44px; height: 44px; border: 1px solid var(--pd-line); background: var(--pd-surface); border-radius: 6px;
	display: inline-flex; align-items: center; justify-content: center; color: var(--pd-ink); cursor: pointer; padding: 0;
}
.pd-iconbtn:hover { border-color: var(--pd-ink); }
.pd-theme-toggle .pd-icon-sun { display: none; }
:root[data-theme="dark"] .pd-theme-toggle .pd-icon-sun { display: block; }
:root[data-theme="dark"] .pd-theme-toggle .pd-icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .pd-theme-toggle .pd-icon-sun { display: block; }
	:root:not([data-theme="light"]) .pd-theme-toggle .pd-icon-moon { display: none; }
}
.pd-menu-toggle { display: none; }
.pd-searchbar { border-top: 1px solid var(--pd-line); background: var(--pd-bg); }
.pd-searchbar[hidden] { display: none; }
.pd-searchbar .pd-wrap { padding-top: 16px; padding-bottom: 16px; }

.pd-searchform { display: flex; flex-wrap: wrap; gap: 10px; }
.pd-searchform input[type="search"] {
	flex: 1 1 240px; min-height: 48px; padding: 0 14px; border: 1px solid var(--pd-line);
	border-radius: 6px; font: inherit; font-size: 16px; color: var(--pd-ink); background: var(--pd-surface);
}

@media (max-width: 900px) {
	.pd-menu-toggle { display: inline-flex; }
	.pd-nav { display: none; order: 5; flex-basis: 100%; }
	.pd-nav.is-open { display: block; }
	.pd-nav ul { flex-direction: column; gap: 0; }
	.pd-nav a { padding: 12px 0; border-bottom: 1px solid var(--pd-line-soft); display: block; }
	.pd-nav .sub-menu { display: flex; position: static; border: 0; box-shadow: none; padding: 0 0 0 16px; min-width: 0; background: transparent; }
	.pd-nav .menu-item-has-children > a::after, .pd-nav .pd-has-sub > a::after { content: ""; }
	.pd-header__actions { margin-left: auto; }
	.pd-header__subscribe { display: none; }
}

/* ---------- Hero ---------- */
.pd-hero__inner { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; padding-top: 64px; padding-bottom: 72px; }
.pd-hero__text { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.pd-hero__meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-family: var(--pd-mono); font-size: 13px; letter-spacing: 0.06em; color: var(--pd-sky); text-transform: uppercase; }
.pd-hero__badge { background: var(--pd-accent); color: #fff; padding: 5px 10px; border-radius: 4px; font-weight: 600; }
.pd-hero__topic { color: var(--pd-peach); text-decoration: none; }
.pd-hero__topic:hover { color: #fff; }
.pd-hero__title { font-size: clamp(32px, 5vw, 48px); line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
.pd-hero__title a { color: #fff; text-decoration: none; }
.pd-hero__title a:hover { color: var(--pd-peach); }
.pd-hero__dek { margin: 0; font-size: 19px; line-height: 1.55; color: var(--pd-sky); max-width: 640px; }
.pd-hero__read { color: var(--pd-sky); font-size: 13px; }
.pd-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.pd-hero__figure { flex: 1 1 380px; margin: 0; min-width: 0; }
.pd-hero__figure svg { display: block; width: 100%; height: auto; }
.pd-hero__figure img { display: block; width: 100%; border-radius: 8px; border: 1px solid #2B4A6B; }
.pd-hero--empty .pd-hero__inner { padding-top: 72px; padding-bottom: 80px; }

/* ---------- Sections ---------- */
.pd-section { padding-top: 56px; padding-bottom: 8px; }
.pd-section__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.pd-section__head-right { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.pd-section__title { font-size: 30px; }
.pd-section__intro { margin: 6px 0 20px; font-size: 16px; color: var(--pd-muted); }
.pd-section__link { font-weight: 600; font-size: 15px; }

/* Environment filter */
.pd-filter { display: flex; background: var(--pd-surface); border: 1px solid var(--pd-line); border-radius: 8px; padding: 4px; gap: 4px; }
.pd-filter button {
	min-height: 44px; padding: 0 18px; border: 0; border-radius: 6px; font-family: inherit;
	font-size: 15px; font-weight: 600; cursor: pointer; background: transparent; color: var(--pd-ink);
}
.pd-filter button[aria-pressed="true"] { background: var(--pd-brand); color: #fff; }
.pd-filter button:not([aria-pressed="true"]):hover { background: var(--pd-surface-2); }

/* Post cards */
.pd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
@media (max-width: 400px) { .pd-grid { grid-template-columns: 1fr; } }
.pd-card {
	background: var(--pd-surface); border: 1px solid var(--pd-line); border-radius: var(--pd-radius);
	display: flex; flex-direction: column; overflow: hidden; position: relative;
	transition: border-color .15s, box-shadow .15s;
}
.pd-card:hover { border-color: var(--pd-line-strong); box-shadow: var(--pd-shadow); }
.pd-card[hidden] { display: none; }
.pd-card__img { aspect-ratio: 16 / 9; background: var(--pd-brand); overflow: hidden; border-bottom: 1px solid var(--pd-line); }
.pd-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-card__body { padding: 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.pd-card__title { font-size: 19px; font-weight: 600; line-height: 1.35; }
.pd-card__title a { color: var(--pd-ink); text-decoration: none; }
.pd-card__title a::after { content: ""; position: absolute; inset: 0; }
.pd-card__title a:hover { color: var(--pd-accent-text); }
.pd-card__excerpt { margin: 0; font-size: 15px; line-height: 1.5; color: var(--pd-muted); }
.pd-card__meta { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px 14px; font-family: var(--pd-mono); font-size: 12px; color: var(--pd-muted); }
.pd-card .pd-tags { position: relative; z-index: 1; }
.pd-empty { background: var(--pd-surface); border: 1px dashed var(--pd-line-strong); border-radius: var(--pd-radius); padding: 32px; text-align: center; color: var(--pd-muted); }

/* Pagination */
.pd-pagination { margin-top: 32px; }
.pd-pagination .nav-links, .pd-pagination ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.pd-pagination .page-numbers, .pd-pagination .post-page-numbers {
	min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
	padding: 0 14px; border: 1px solid var(--pd-line); border-radius: 6px; background: var(--pd-surface);
	color: var(--pd-ink); text-decoration: none; font-weight: 600;
}
.pd-pagination .current { background: var(--pd-brand); color: #fff; border-color: var(--pd-brand); }
.pd-pagination .page-numbers.dots { border: 0; background: transparent; }

/* Topics */
.pd-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pd-topiccard {
	text-decoration: none; background: var(--pd-surface); border: 1px solid var(--pd-line); border-radius: 8px;
	padding: 18px; display: flex; gap: 14px; align-items: center; color: var(--pd-ink);
}
.pd-topiccard:hover { border-color: var(--pd-ink); color: var(--pd-ink); }
.pd-topiccard__code {
	font-family: var(--pd-mono); font-weight: 600; font-size: 15px; width: 48px; height: 48px;
	border-radius: 6px; background: var(--pd-brand); color: #fff; display: flex; align-items: center; justify-content: center; flex: none;
	border: 1px solid #2B4A6B;
}
.pd-topiccard:nth-child(6n) .pd-topiccard__code { background: var(--pd-accent); border-color: var(--pd-accent); }
.pd-topiccard:nth-child(7n) .pd-topiccard__code { background: var(--pd-sand); color: var(--pd-sand-ink); border-color: var(--pd-sand); }
.pd-topiccard__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pd-topiccard__name { font-weight: 600; font-size: 16px; }
.pd-topiccard__desc { font-size: 13px; color: var(--pd-muted); line-height: 1.4; }

/* Reference teaser */
.pd-ref { background: var(--pd-surface); border: 1px solid var(--pd-line); border-radius: 12px; padding: 32px; display: flex; flex-wrap: wrap; gap: 28px; }
.pd-ref__intro { flex: 1 1 280px; display: flex; flex-direction: column; gap: 10px; }
.pd-ref__intro .pd-eyebrow { color: var(--pd-accent-text); font-weight: 600; }
.pd-ref__intro h2 { font-size: 28px; }
.pd-ref__intro p { margin: 0; color: var(--pd-muted); }
.pd-ref__tools { flex: 2 1 520px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.pd-tool {
	border: 1px solid var(--pd-line); border-radius: 8px; padding: 18px; display: flex; flex-direction: column; gap: 8px;
	background: var(--pd-surface-2); text-decoration: none; color: var(--pd-ink);
}
a.pd-tool:hover { border-color: var(--pd-ink); color: var(--pd-ink); }
.pd-tool svg { color: var(--pd-ink); }
.pd-tool__name { font-weight: 600; font-size: 16px; }
.pd-tool__desc { font-size: 14px; color: var(--pd-muted); line-height: 1.45; }
.pd-tool__soon { font-family: var(--pd-mono); font-size: 11px; letter-spacing: .06em; color: var(--pd-muted); text-transform: uppercase; }
.pd-tool__go { font-family: var(--pd-mono); font-size: 12px; color: var(--pd-accent-text); font-weight: 600; margin-top: auto; }

/* Subscribe */
.pd-subscribe { margin-top: 64px; }
.pd-subscribe__inner { display: flex; flex-wrap: wrap; gap: 32px; align-items: center; padding-top: 56px; padding-bottom: 56px; }
.pd-subscribe__text { flex: 1 1 380px; display: flex; flex-direction: column; gap: 10px; }
.pd-subscribe__text h2 { font-size: 30px; }
.pd-subscribe__text p { margin: 0; font-size: 17px; color: var(--pd-sky); }
.pd-subscribe__form { flex: 1 1 420px; }
.pd-subscribe__form input[type="email"], .pd-subscribe__form input[type="text"] {
	min-height: 48px; padding: 0 14px; border-radius: 6px; border: 1px solid #5E7A96;
	font: inherit; font-size: 16px; color: #0E2A47; background: #fff; width: 100%;
}
.pd-subscribe__form label { color: var(--pd-sky); font-weight: 600; font-size: 14px; }
.pd-subscribe__form button, .pd-subscribe__form input[type="submit"] {
	min-height: 48px; padding: 0 22px; border: 0; border-radius: 6px; background: var(--pd-accent);
	color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}

/* ---------- Footer ---------- */
.pd-section + .pd-footer, main + .pd-footer { margin-top: 64px; }
.pd-subscribe:last-child { margin-bottom: 0; }
.pd-footer { background: var(--pd-brand-deep); color: var(--pd-sky); }
.pd-footer__inner { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; padding-top: 32px; padding-bottom: 32px; font-size: 14px; }
.pd-footer__name { font-weight: 600; color: #fff; }
.pd-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.pd-footer a { color: var(--pd-sky); }
.pd-footer a:hover { color: #fff; }
.pd-footer__note { font-family: var(--pd-mono); font-size: 12px; }

/* ---------- Archive header ---------- */
.pd-archive-head { padding-top: 48px; padding-bottom: 48px; }
.pd-archive-head h1 { font-size: clamp(30px, 4vw, 42px); }
.pd-archive-head p, .pd-archive-head .pd-archive-desc { color: var(--pd-sky); font-size: 18px; max-width: 720px; margin: 12px 0 0; }
.pd-archive-head .pd-eyebrow { color: var(--pd-peach); }
.pd-envlinks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.pd-envlinks a {
	min-height: 40px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 6px;
	border: 1px solid #5E7A96; color: #fff; text-decoration: none; font-weight: 600; font-size: 15px;
}
.pd-envlinks a.is-active, .pd-envlinks a:hover { background: #fff; color: #0E2A47; border-color: #fff; }

/* ---------- Single post ---------- */
.pd-breadcrumb { font-size: 14px; color: var(--pd-muted); display: flex; flex-wrap: wrap; gap: 8px; padding-top: 32px; }
.pd-breadcrumb a { color: var(--pd-link); }
.pd-post-head { padding-top: 24px; padding-bottom: 32px; }
.pd-post-head__inner { max-width: 820px; display: flex; flex-direction: column; gap: 16px; }
.pd-post-head h1 { font-size: clamp(32px, 4.4vw, 46px); line-height: 1.12; font-weight: 700; letter-spacing: -0.02em; }
.pd-post-head__dek { margin: 0; font-size: 20px; line-height: 1.55; color: var(--pd-muted); }
.pd-post-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; font-size: 14px; color: var(--pd-muted); padding-top: 12px; border-top: 1px solid var(--pd-line); }
.pd-post-meta__author { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--pd-ink); }
.pd-post-meta__author a { color: var(--pd-ink); text-decoration: none; }
.pd-post-meta__author img { border-radius: 50%; }
.pd-post-meta .pd-mono { text-transform: uppercase; }
.pd-post-thumb { margin: 0 0 32px; }
.pd-post-thumb img { width: 100%; border-radius: var(--pd-radius); display: block; }

.pd-post-layout { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; padding-bottom: 56px; }
.pd-post-main { flex: 999 1 640px; min-width: 0; }
.pd-post-side { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 24px; }
@media (max-width: 980px) { .pd-post-side { position: static; } }
.pd-toc-mobile { display: none; margin-bottom: 28px; }
@media (max-width: 980px) {
	.pd-toc-mobile { display: block; }
	.pd-post-side .pd-toc-side { display: none; }
}
.pd-toc-mobile summary { cursor: pointer; font-family: var(--pd-mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: var(--pd-muted); min-height: 24px; }
.pd-toc-mobile ol { margin: 12px 0 0; }
.pd-sidebox { background: var(--pd-surface); border: 1px solid var(--pd-line); border-radius: var(--pd-radius); padding: 20px; }
.pd-sidebox h2 { font-family: var(--pd-mono); font-size: 13px; letter-spacing: .08em; color: var(--pd-muted); text-transform: uppercase; margin: 0 0 12px; font-weight: 600; }
.pd-sidebox ol, .pd-sidebox ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.4; }
.pd-sidebox ul.pd-related { list-style: none; padding: 0; gap: 12px; }
.pd-related a { color: var(--pd-ink); font-weight: 600; text-decoration: none; }
.pd-related a:hover { color: var(--pd-accent-text); }
.pd-related small { display: block; font-family: var(--pd-mono); font-size: 11px; color: var(--pd-muted); font-weight: 400; margin-top: 2px; text-transform: uppercase; }
.pd-sidebox--dark { background: var(--pd-brand); color: #fff; border-color: var(--pd-brand); display: flex; flex-direction: column; gap: 10px; }
.pd-sidebox--dark strong { font-size: 17px; }
.pd-sidebox--dark span { font-size: 14px; color: var(--pd-sky); }
.pd-sidebox--dark .pd-btn { justify-content: center; }

/* Share */
.pd-share { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pd-share__label { font-family: var(--pd-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--pd-muted); margin-right: 4px; }
.pd-share a, .pd-share button {
	min-height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 6px;
	border: 1px solid var(--pd-line); background: var(--pd-surface); color: var(--pd-ink); text-decoration: none;
	font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.pd-share a:hover, .pd-share button:hover { border-color: var(--pd-ink); color: var(--pd-ink); }
.pd-share svg { width: 16px; height: 16px; flex: none; }

/* Author box */
.pd-authorbox { margin-top: 32px; display: flex; gap: 18px; align-items: flex-start; background: var(--pd-surface); border: 1px solid var(--pd-line); border-radius: var(--pd-radius); padding: 22px; }
.pd-authorbox img { border-radius: 50%; flex: none; }
.pd-authorbox__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pd-authorbox__label { font-family: var(--pd-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--pd-muted); }
.pd-authorbox__name { font-weight: 700; font-size: 18px; }
.pd-authorbox__bio { margin: 0; font-size: 15px; color: var(--pd-muted); line-height: 1.55; }
.pd-authorbox__links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; font-weight: 600; }

.pd-postnav { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 32px; }
.pd-postnav a {
	text-decoration: none; border: 1px solid var(--pd-line); background: var(--pd-surface); border-radius: var(--pd-radius);
	padding: 18px; display: flex; flex-direction: column; gap: 4px; color: var(--pd-ink);
}
.pd-postnav a:hover { border-color: var(--pd-ink); color: var(--pd-ink); }
.pd-postnav__label { font-family: var(--pd-mono); font-size: 12px; color: var(--pd-muted); text-transform: uppercase; }
.pd-postnav__title { font-weight: 600; font-size: 17px; line-height: 1.4; }
.pd-postnav__next { text-align: right; }

.pd-posttags { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; }
.pd-posttags a { background: var(--pd-surface); border: 1px solid var(--pd-line); padding: 4px 10px; border-radius: 999px; text-decoration: none; color: var(--pd-ink); }

.pd-disclaimer { margin-top: 32px; font-size: 14px; color: var(--pd-muted); border-top: 1px solid var(--pd-line); padding-top: 16px; }

/* ---------- Post content ---------- */
.pd-content { font-size: 18px; line-height: 1.7; }
.pd-content > * { margin-top: 0; margin-bottom: 1.2em; }
.pd-content h2 { font-size: 28px; line-height: 1.25; margin-top: 1.6em; margin-bottom: .6em; scroll-margin-top: 24px; }
.pd-content h3 { font-size: 22px; margin-top: 1.4em; margin-bottom: .5em; scroll-margin-top: 24px; }
.pd-content h4 { font-size: 18px; margin-top: 1.2em; margin-bottom: .4em; }
.pd-content > h2:first-child, .pd-content > h3:first-child { margin-top: 0; }
.pd-content ul, .pd-content ol { padding-left: 1.3em; }
.pd-content li + li { margin-top: .35em; }
.pd-content img { border-radius: 8px; }
.pd-content figure { margin-left: 0; margin-right: 0; }
.pd-content figcaption, .pd-content .wp-element-caption { font-size: 14px; color: var(--pd-muted); margin-top: 10px; line-height: 1.5; }
.pd-content blockquote { margin-left: 0; border-left: 4px solid var(--pd-accent); padding: 4px 0 4px 20px; font-size: 20px; }
.pd-content code { font-family: var(--pd-mono); font-size: .88em; background: var(--pd-code-bg); padding: 2px 6px; border-radius: 4px; }
.pd-content pre { font-family: var(--pd-mono); font-size: 15px; background: var(--pd-brand); color: #E6EDF3; padding: 18px 20px; border-radius: 8px; overflow-x: auto; }
.pd-content pre code { background: none; padding: 0; color: inherit; }
.pd-content hr { border: 0; border-top: 1px solid var(--pd-line); margin: 2em 0; }
.pd-content .wp-block-table { overflow-x: auto; border: 1px solid var(--pd-line); border-radius: var(--pd-radius); background: var(--pd-surface); }
.pd-content table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.5; }
.pd-content .wp-block-table table { min-width: 520px; }
.pd-content th, .pd-content td { padding: 12px 16px; text-align: left; vertical-align: top; border: 0; border-bottom: 1px solid var(--pd-line-soft); }
.pd-content thead th, .pd-content thead td { background: var(--pd-brand); color: #fff; font-weight: 600; border-bottom: 0; }
.pd-content tbody tr:nth-child(even) { background: var(--pd-zebra); }
.pd-content tbody tr:last-child td, .pd-content tbody tr:last-child th { border-bottom: 0; }
.pd-content .wp-block-table thead { border-bottom: 0; }
.pd-content .wp-block-table figcaption { padding: 0 16px 12px; }

/* Blueprint panel (block style for Image and Group; diagrams) */
.is-style-blueprint, .pd-diagram {
	background-color: var(--pd-brand);
	background-image: linear-gradient(rgba(201,214,227,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(201,214,227,.08) 1px, transparent 1px);
	background-size: 24px 24px; border-radius: var(--pd-radius); padding: 24px; color: #fff;
}
.is-style-blueprint figcaption, .is-style-blueprint .wp-element-caption, .pd-diagram figcaption { color: var(--pd-sky) !important; }
.is-style-blueprint img { border-radius: 4px; }
.pd-diagram svg { display: block; width: 100%; height: auto; }

/* Key takeaways */
.pd-takeaways { background: var(--pd-take-bg); border: 1px solid var(--pd-take-line); border-radius: var(--pd-radius); padding: 24px 26px; }
.pd-content .pd-takeaways > * { margin-bottom: 0; }
.pd-takeaways h2, .pd-takeaways h3, .pd-takeaways .pd-box-title {
	font-family: var(--pd-mono) !important; font-size: 13px !important; letter-spacing: .08em; color: var(--pd-take-ink);
	text-transform: uppercase; margin: 0 0 12px !important; font-weight: 600;
}
.pd-takeaways ul { margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 17px; line-height: 1.55; }
.pd-takeaways li + li { margin-top: 0; }

/* Code reference */
.pd-coderef { background: var(--pd-surface); border: 1px solid var(--pd-line); border-radius: var(--pd-radius); padding: 22px 24px; }
.pd-content .pd-coderef > * { margin-bottom: 10px; }
.pd-content .pd-coderef > *:last-child { margin-bottom: 0; }
.pd-coderef h2, .pd-coderef h3, .pd-coderef .pd-box-title {
	font-family: var(--pd-mono) !important; font-size: 13px !important; letter-spacing: .08em; color: var(--pd-accent-text);
	text-transform: uppercase; margin: 0 0 12px !important; font-weight: 600;
}
.pd-coderef p { font-size: 16px; line-height: 1.5; color: var(--pd-muted); }
.pd-coderef p strong:first-child { display: block; font-family: var(--pd-mono); color: var(--pd-ink); }

/* Onshore / offshore callouts */
.pd-note { border-radius: var(--pd-radius); padding: 18px 22px; height: 100%; }
.pd-note--onshore { background: var(--pd-on-bg); border: 1px solid var(--pd-take-line); }
.pd-note--offshore { background: var(--pd-off-bg); border: 1px solid var(--pd-line-strong); }
.pd-content .pd-note > * { margin-bottom: 8px; font-size: 16px; line-height: 1.55; }
.pd-content .pd-note > *:last-child { margin-bottom: 0; }
.pd-note .pd-box-title { font-family: var(--pd-mono); font-size: 12px !important; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; margin: 0 0 6px !important; }
.pd-content .wp-block-columns { gap: 16px; }

/* Glossary */
.pd-content .pd-glossary-letters { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; }
.pd-content .pd-glossary-letters li + li { margin-top: 0; }
.pd-glossary-letters a { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--pd-line); border-radius: 6px; background: var(--pd-surface); text-decoration: none; font-family: var(--pd-mono); font-weight: 600; color: var(--pd-ink); }
.pd-glossary-letters a:hover { border-color: var(--pd-ink); }
.pd-content p.pd-term { margin-bottom: .8em; padding-left: 14px; border-left: 2px solid var(--pd-line); }
.pd-content p.pd-term strong:first-child { font-family: var(--pd-mono); }

/* Archive listing (shortcode) */
.pd-archive-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-top: 8px; }
.pd-archive-group { background: var(--pd-surface); border: 1px solid var(--pd-line); border-radius: var(--pd-radius); padding: 22px; }
.pd-content .pd-archive-group h2 { font-size: 20px; margin: 0 0 12px; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.pd-archive-group h2 a { color: var(--pd-ink); text-decoration: none; }
.pd-archive-group h2 small { font-family: var(--pd-mono); font-size: 12px; color: var(--pd-muted); font-weight: 400; }
.pd-content .pd-archive-group ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; font-size: 16px; line-height: 1.4; }
.pd-content .pd-archive-group li + li { margin-top: 0; }
.pd-archive-group li a { color: var(--pd-ink); text-decoration: none; font-weight: 500; }
.pd-archive-group li a:hover { color: var(--pd-accent-text); }
.pd-archive-group li span { display: block; font-family: var(--pd-mono); font-size: 12px; color: var(--pd-muted); margin-top: 2px; }

/* ---------- Reference tools ---------- */
.pd-calc { background: var(--pd-surface); border: 1px solid var(--pd-line); border-radius: 12px; padding: 24px; margin-bottom: 1.6em; }
.pd-content .pd-calc > * { margin-bottom: 0; }
.pd-calc__form { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.pd-field { display: flex; flex-direction: column; gap: 6px; }
.pd-field label { font-size: 14px; font-weight: 600; }
.pd-field small { font-size: 12px; color: var(--pd-muted); line-height: 1.4; }
.pd-field input, .pd-field select {
	min-height: 46px; padding: 0 12px; border: 1px solid var(--pd-line-strong); border-radius: 6px;
	font: inherit; font-size: 16px; color: var(--pd-ink); background: var(--pd-bg); width: 100%;
}
.pd-calc__result { margin-top: 20px; border-top: 1px solid var(--pd-line); padding-top: 20px; }
.pd-calc__stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.pd-stat { background: var(--pd-surface-2); border: 1px solid var(--pd-line); border-radius: 8px; padding: 14px 16px; }
.pd-stat__label { display: block; font-family: var(--pd-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--pd-muted); }
.pd-stat__value { display: block; font-size: 24px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.pd-stat--key { background: var(--pd-brand); border-color: var(--pd-brand); color: #fff; }
.pd-stat--key .pd-stat__label { color: var(--pd-sky); }
.pd-calc__msg { margin: 14px 0 0; font-size: 15px; color: var(--pd-muted); }
.pd-calc__msg.is-warn { color: var(--pd-accent-text); font-weight: 600; }
.pd-tablewrap { overflow-x: auto; border: 1px solid var(--pd-line); border-radius: var(--pd-radius); background: var(--pd-surface); margin-top: 20px; }
.pd-tablewrap table { min-width: 560px; font-variant-numeric: tabular-nums; }
.pd-tablewrap td, .pd-tablewrap th { white-space: nowrap; }
.pd-content tr.is-hit td, .pd-content tr.is-hit th { background: var(--pd-take-bg); font-weight: 700; }
.pd-content td.is-hit { background: var(--pd-accent) !important; color: #fff; font-weight: 700; }

/* Core alignment helpers */
.alignwide { max-width: none; }
.aligncenter { margin-left: auto; margin-right: auto; display: block; }
.alignleft { float: left; margin: 0 1.2em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.2em; }
.wp-caption { max-width: 100%; }
.sticky, .gallery-caption, .bypostauthor { /* WordPress required classes */ }

/* ---------- Comments ---------- */
.pd-comments { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--pd-line); }
.pd-comments h2, .pd-comments .comment-reply-title { font-size: 24px; margin-bottom: 20px; }
.pd-comments ol { list-style: none; padding: 0; margin: 0 0 24px; }
.pd-comments .children { list-style: none; padding-left: 24px; }
.pd-comments .comment-body { background: var(--pd-surface); border: 1px solid var(--pd-line); border-radius: var(--pd-radius); padding: 16px 18px; margin-bottom: 12px; font-size: 16px; }
.pd-comments .comment-meta { font-size: 13px; color: var(--pd-muted); }
.pd-comments .comment-author img { border-radius: 50%; vertical-align: middle; margin-right: 8px; }
.pd-comments label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.pd-comments .comment-form-cookies-consent label { display: inline; font-weight: 400; }
.pd-comments textarea, .pd-comments input[type="text"], .pd-comments input[type="email"], .pd-comments input[type="url"] {
	width: 100%; padding: 12px 14px; border: 1px solid var(--pd-line); border-radius: 6px; font: inherit; font-size: 16px; background: var(--pd-surface); color: var(--pd-ink);
}
.pd-comments .form-submit input {
	min-height: 48px; padding: 0 22px; border: 0; border-radius: 6px; background: var(--pd-accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}

/* ---------- Page ---------- */
.pd-page { max-width: 880px; padding-top: 40px; padding-bottom: 64px; }
.pd-page--wide { max-width: var(--pd-wrap); }
.pd-page__head { margin-bottom: 28px; }
.pd-page h1 { font-size: clamp(30px, 4vw, 42px); }
.pd-page__intro { font-size: 19px; color: var(--pd-muted); margin: 12px 0 0; max-width: 760px; }
.pd-404 { padding-top: 80px; padding-bottom: 96px; text-align: center; }
.pd-404 h1 { font-size: 42px; margin-bottom: 12px; }
.pd-404 .pd-searchform { max-width: 520px; margin: 24px auto 0; }

@media print {
	.pd-header, .pd-footer, .pd-post-side, .pd-share, .pd-comments, .pd-postnav, .pd-subscribe { display: none !important; }
	body { background: #fff; color: #000; }
}
