/* ==========================================================================
   BRAT Diet Care - Site chrome and block content
   ==========================================================================

   Everything on this file is driven by the CSS custom properties that
   inc/style-vars.php prints into <head> on every page, so Appearance ->
   BRAT Diet Care -> Colours & layout restyles the blog and the pages without
   touching a template. The fallbacks are the planner palette, so the styles
   still read correctly if the variables are ever missing.

   planner.css is a compiled Tailwind bundle and is never edited by hand; this
   file is the hand-written half of the front end.
   --------------------------------------------------------------------------- */

:root {
	--brat-page: var(--brat-bg, #fbf9f4);
	--brat-card: var(--brat-surface, #ffffff);
	--brat-card-2: var(--brat-surface-2, #f5f5f4);
	--brat-line: var(--brat-border, #e7e5e4);
	--brat-ink: var(--brat-text, #1c1917);
	--brat-ink-soft: var(--brat-text-soft, #57534e);
	--brat-ink-mute: var(--brat-text-muted, #78716c);
	--brat-accent: var(--brat-accent, #059669);
	--brat-accent-dark: var(--brat-accent-hover, #047857);
	--brat-accent-ink: var(--brat-accent-ink, #ffffff);
	--brat-accent-tint: var(--brat-accent-soft, #ecfdf5);
	--brat-accent-line: var(--brat-accent-soft-2, #d1fae5);
	--brat-accent-text: var(--brat-accent-text, #047857);
	--brat-info: var(--brat-info, #0284c7);
	--brat-info-tint: var(--brat-info-soft, #eff6ff);
	--brat-warn: var(--brat-warn, #b45309);
	--brat-warn-tint: var(--brat-warn-soft, #fffbeb);
	--brat-danger: var(--brat-danger, #be123c);
	--brat-danger-tint: var(--brat-danger-soft, #fff1f2);
	--brat-r: var(--brat-radius, 24px);
	--brat-r-sm: var(--brat-radius-sm, 14px);
	--brat-r-pill: var(--brat-radius-pill, 34px);
	--brat-elev: var(--brat-shadow, 0 1px 2px rgba(28, 25, 23, 0.05), 0 14px 30px -20px rgba(28, 25, 23, 0.28));
	--brat-wrap: var(--brat-width, 900px);
	--brat-gap: var(--brat-gap, 1.25rem);
	--brat-pad: var(--brat-pad, 1.5rem);
	--brat-fs: var(--brat-font, 15.5px);
	--brat-speed: 0.18s;
}

html.dark {
	--brat-accent-tint: var(--brat-accent-soft, #022c22);
	--brat-accent-line: var(--brat-accent-soft-2, #064e3b);
	--brat-accent-text: var(--brat-accent-text, #34d399);
	--brat-info-tint: var(--brat-info-soft, #0c2233);
	--brat-warn-tint: var(--brat-warn-soft, #2a1c07);
	--brat-danger-tint: var(--brat-danger-soft, #2c0a16);

	/* Theme JSON presets and typography overrides for full dark mode legibility */
	--wp--preset--color--ink: #ffffff !important;
	--wp--preset--color--soft: #e7e5e4 !important;
	--wp--preset--color--mute: #b8b3aa !important;
	--wp--preset--color--paper: var(--brat-bg, #0d1513) !important;
	--wp--preset--color--card: var(--brat-surface, #2f3d3a) !important;
	--wp--preset--color--sand: var(--brat-surface-2, #3b4a46) !important;
	--wp--preset--color--line: var(--brat-border, #4b5b57) !important;
}

/* --------------------------------------------------------------------------
   Reset-ish baseline for the non-planner templates
   The planner ships its own Tailwind reset, so this block is scoped with
   body.brat-site and never leaks into the tool.
   -------------------------------------------------------------------------- */

body.brat-site {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--brat-page);
	color: var(--brat-ink);
	font-size: var(--brat-fs);
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-wrap: break-word;
}

body.brat-site *,
body.brat-site *::before,
body.brat-site *::after {
	box-sizing: border-box;
}

body.brat-site img,
body.brat-site svg,
body.brat-site video {
	max-width: 100%;
	height: auto;
}

body.brat-site :focus-visible {
	outline: 2px solid var(--brat-accent);
	outline-offset: 2px;
	border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */

.brat-site-bar {
	position: sticky;
	top: 0;
	z-index: 40;
	background: color-mix(in srgb, var(--brat-page) 88%, transparent);
	backdrop-filter: saturate(180%) blur(12px);
	-webkit-backdrop-filter: saturate(180%) blur(12px);
	border-bottom: 1px solid var(--brat-line);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
	.brat-site-bar {
		background: var(--brat-page);
	}
}

/* Suppress duplicate header and footer inside client-side #root container */
#root > div > header,
#root > div > footer {
	display: none !important;
}

.brat-site-bar__inner {
	max-width: 1120px;
	margin: 0 auto;
	padding: 0.7rem clamp(1rem, 4vw, 2rem);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 60px;
}

.brat-site-brand {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	text-decoration: none;
	color: inherit;
	min-width: 0;
}

.brat-site-brand__logo {
	width: 38px;
	height: 38px;
	flex: 0 0 auto;
	object-fit: contain;
	border-radius: 10px;
	transition: transform 0.2s ease;
}

.brat-site-brand:hover .brat-site-brand__logo {
	transform: scale(1.05);
}

.brat-site-brand__text {
	min-width: 0;
	line-height: 1.15;
}

.brat-site-title {
	display: block;
	font-size: 1.02rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--brat-ink);
}

.brat-site-title__accent {
	color: var(--brat-accent);
	font-weight: 600;
}

.brat-site-subtitle {
	margin: 0.15rem 0 0;
	font-size: 0.68rem;
	font-weight: 500;
	color: var(--brat-ink-mute);
}

.brat-site-badge {
	margin-left: 0.45rem;
	font-size: 0.6rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 0.15rem 0.4rem;
	border-radius: 5px;
	background: var(--brat-accent-tint);
	color: var(--brat-accent-text);
	vertical-align: 2px;
}

.brat-site-nav__list {
	display: flex;
	align-items: center;
	gap: 0.15rem;
	margin: 0;
	padding: 0;
	list-style: none;
	flex-wrap: wrap;
}

.brat-site-nav__list li {
	position: relative;
}

.brat-site-nav__list a {
	display: inline-block;
	padding: 0.45rem 0.7rem;
	border-radius: var(--brat-r-pill);
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--brat-ink-soft);
	text-decoration: none;
	white-space: nowrap;
	transition: background var(--brat-speed) ease, color var(--brat-speed) ease;
}

.brat-site-nav__list a:hover,
.brat-site-nav__list a:focus-visible {
	background: var(--brat-accent-tint);
	color: var(--brat-accent-text);
}

/* Menus and single posts both mark the current item, so the visitor can see
   where they are without opening the menu on a phone. */
.brat-site-nav__list .current-menu-item > a,
.brat-site-nav__list .current_page_item > a,
.brat-site-nav__list .current-menu-ancestor > a {
	background: var(--brat-accent-tint);
	color: var(--brat-accent-text);
}

/* Sub menus stay simple: a quiet stacked panel. */
.brat-site-nav__list .sub-menu {
	position: absolute;
	top: calc(100% + 0.35rem);
	left: 0;
	z-index: 50;
	min-width: 190px;
	margin: 0;
	padding: 0.3rem;
	list-style: none;
	background: var(--brat-card);
	border: 1px solid var(--brat-line);
	border-radius: var(--brat-r-sm);
	box-shadow: var(--brat-elev);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-4px);
	transition: opacity var(--brat-speed) ease, transform var(--brat-speed) ease, visibility var(--brat-speed);
}

.brat-site-nav__list li:hover > .sub-menu,
.brat-site-nav__list li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.brat-site-nav__list .sub-menu a {
	display: block;
	width: 100%;
	text-align: left;
	white-space: normal;
}

.brat-site-toggle {
	display: none;
	align-items: center;
	gap: 0.4rem;
	padding: 0.45rem 0.75rem;
	font: inherit;
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--brat-ink);
	background: var(--brat-card);
	border: 1px solid var(--brat-line);
	border-radius: var(--brat-r-pill);
	cursor: pointer;
}

.brat-site-nav-wrap {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.brat-site-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.brat-action-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.42rem 0.85rem;
	font-family: inherit;
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--brat-ink);
	background: var(--brat-card);
	border: 1px solid var(--brat-line);
	border-radius: var(--brat-r-pill);
	cursor: pointer;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	transition: all 0.2s ease;
}

.brat-action-btn:hover {
	border-color: var(--brat-accent);
	color: var(--brat-accent);
}

html.dark .brat-action-btn {
	border-color: #292524;
	background: #1c1917;
	color: #d6d3d1;
}

html.dark .brat-action-btn:hover {
	border-color: var(--brat-accent);
	color: var(--brat-accent);
}

.brat-theme-toggle {
	width: 36px;
	height: 36px;
	min-width: 36px;
	padding: 0;
	border-radius: 9999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--brat-line);
	background: var(--brat-card);
	color: var(--brat-ink-soft);
	cursor: pointer;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	transition: all 0.2s ease;
}

.brat-theme-toggle:hover {
	border-color: var(--brat-accent);
	color: var(--brat-accent);
}

.brat-theme-toggle__icon {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	transition: transform 0.3s ease;
}

.brat-theme-toggle__icon--sun {
	display: none;
	color: #fbbf24;
	transform: rotate(0deg);
}

.brat-theme-toggle:hover .brat-theme-toggle__icon--sun {
	transform: rotate(90deg);
}

.brat-theme-toggle__icon--moon {
	display: inline-block;
	color: #57534e;
	transform: rotate(-12deg);
}

.brat-theme-toggle:hover .brat-theme-toggle__icon--moon {
	transform: rotate(0deg);
}

html.dark .brat-theme-toggle__icon--sun {
	display: inline-block;
}

html.dark .brat-theme-toggle__icon--moon {
	display: none;
}

html.dark .brat-theme-toggle {
	border-color: #292524;
	background: #1c1917;
	color: #d6d3d1;
}

html.dark .brat-theme-toggle:hover {
	border-color: var(--brat-accent);
	color: var(--brat-accent);
}

.brat-site-nav {
	display: block;
}

@media (max-width: 780px) {
	/*
	 * The collapse is opt-in from JavaScript. Without it the toggle button
	 * stays hidden and the menu simply stays open, so a phone with scripts
	 * blocked still gets the navigation.
	 */
	.brat-js .brat-site-toggle {
		display: inline-flex;
	}

	.brat-js .brat-site-nav {
		position: absolute;
		left: 0;
		right: 0;
		top: 100%;
		display: none;
		padding: 0.5rem clamp(1rem, 4vw, 2rem) 1rem;
		background: var(--brat-card);
		border-bottom: 1px solid var(--brat-line);
		box-shadow: var(--brat-elev);
	}

	.brat-js .brat-site-bar[data-nav-open="true"] .brat-site-nav {
		display: block;
	}

	.brat-site-nav__list {
		flex-direction: column;
		align-items: stretch;
		gap: 0.1rem;
	}

	.brat-site-nav__list a {
		display: block;
		padding: 0.6rem 0.7rem;
		border-radius: var(--brat-r-sm);
		white-space: normal;
	}

	.brat-site-nav__list .sub-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		border: 0;
		box-shadow: none;
		padding: 0 0 0 0.8rem;
	}
}

/* --------------------------------------------------------------------------
   Main column
   -------------------------------------------------------------------------- */

.brat-site-main {
	flex: 1 0 auto;
	display: flex;
	flex-direction: column;
}

.brat-site-content {
	width: 100%;
	max-width: 1120px;
	margin: 0 auto;
	padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem) clamp(3rem, 7vw, 5rem);
}

/* Pages are narrower than the blog: they are read, not scanned. */
body.brat-page .brat-site-content {
	max-width: var(--brat-wrap, 900px);
}

/* An article is a single column of prose, not a dashboard of cards. */
body.brat-single .brat-site-content {
	max-width: var(--brat-wrap, 900px);
}

/*
 * The content wrapper the templates print. It carries no styling of its own in
 * most places - the prose rules do the work - but it is the anchor for the
 * full-bleed blocks and the print rules, so it is named here rather than left
 * to be an unstyled hook.
 */
.brat-entry {
	min-width: 0;
}

.brat-entry--prose {
	display: block;
}

/*
 * The core hooks the templates print. They travel with the theme's own classes
 * on the same elements, so nothing depends on them - but they are what a plugin,
 * a child theme or a block looks for, so they are styled rather than left as
 * dead names.
 */
.entry-content {
	min-width: 0;
}

.entry-title {
	margin: 0 0 0.85rem;
	font-size: clamp(1.9rem, 5.2vw, 3rem);
	font-weight: 800;
	line-height: 1.08;
	letter-spacing: -0.035em;
	color: var(--brat-ink);
	text-wrap: balance;
}

/*
 * z-index only, deliberately. This rule sits below .brat-site-bar in the file,
 * so adding a `position` here would win on source order and quietly un-stick the
 * site header.
 */
.site-header {
	z-index: 40;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
	border-top: 1px solid var(--brat-line);
	background: color-mix(in srgb, var(--brat-card) 55%, var(--brat-page));
	color: var(--brat-ink-mute);
	font-size: 0.8rem;
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
	.site-footer {
		background: var(--brat-card);
	}
}

.site-footer__inner {
	max-width: 1120px;
	margin: 0 auto;
	padding: 1.5rem clamp(1rem, 4vw, 2rem);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1.5rem;
}

.site-footer__left {
	flex: 1 1 340px;
	min-width: 0;
}

.site-footer__right {
	flex: 0 0 auto;
	margin-left: auto;
}

.brat-footer__line {
	margin: 0;
}

.brat-footer__line--muted {
	color: var(--brat-ink-mute);
}

.brat-footer__disclaimer {
	max-width: 62ch;
}

.brat-footer__desc {
	max-width: 62ch;
	font-weight: 500;
}

.site-footer .brat-site-nav__list a {
	padding: 0.3rem 0.55rem;
	font-size: 0.8rem;
}

@media (max-width: 640px) {
	.site-footer__inner {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* --------------------------------------------------------------------------
   Shared building blocks
   -------------------------------------------------------------------------- */

.brat-container {
	width: 100%;
	max-width: var(--brat-wrap, 900px);
	margin-inline: auto;
}

.brat-container--wide {
	max-width: 1120px;
}

.brat-card {
	background: var(--brat-card);
	border: 1px solid var(--brat-line);
	border-radius: var(--brat-r);
	box-shadow: var(--brat-elev);
}

.brat-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.28rem 0.7rem;
	border-radius: var(--brat-r-pill);
	background: var(--brat-accent-tint);
	color: var(--brat-accent-text);
	border: 1px solid var(--brat-accent-line);
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	line-height: 1.5;
}

.brat-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.6rem 1.15rem;
	border-radius: var(--brat-r-pill);
	border: 1px solid var(--brat-line);
	background: var(--brat-card);
	color: var(--brat-ink);
	font: inherit;
	font-size: 0.85rem;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition: transform var(--brat-speed) ease, border-color var(--brat-speed) ease, background var(--brat-speed) ease, color var(--brat-speed) ease;
}

.brat-btn:hover {
	border-color: var(--brat-accent);
	color: var(--brat-accent-text);
	background: var(--brat-accent-tint);
	transform: translateY(-1px);
}

.brat-btn--primary {
	background: var(--brat-accent);
	border-color: var(--brat-accent);
	color: var(--brat-accent-ink);
}

.brat-btn--primary:hover {
	background: var(--brat-accent-dark);
	border-color: var(--brat-accent-dark);
	color: var(--brat-accent-ink);
}

.brat-btn-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
}

/* Screen-reader text, but visible when focused (skip link). */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.screen-reader-text:focus {
	position: fixed !important;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 999;
	width: auto;
	height: auto;
	clip: auto;
	clip-path: none;
	padding: 0.6rem 1rem;
	background: var(--brat-card);
	border: 2px solid var(--brat-accent);
	border-radius: var(--brat-r-sm);
	font-weight: 700;
}

/* --------------------------------------------------------------------------
   Block content - the rules that make a post look designed
   Scoped to .brat-prose so the planner and the tool chrome are untouched.
   -------------------------------------------------------------------------- */

.brat-prose {
	font-size: 1.06em;
	line-height: 1.78;
	color: var(--brat-ink);
}

.brat-prose > * {
	margin-block: 0 1.15em;
}

.brat-prose > *:last-child {
	margin-bottom: 0;
}

.brat-prose h1,
.brat-prose h2,
.brat-prose h3,
.brat-prose h4,
.brat-prose h5,
.brat-prose h6 {
	margin: 1.9em 0 0.6em;
	line-height: 1.22;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--brat-ink);
	text-wrap: balance;
}

.brat-prose > h1:first-child,
.brat-prose > h2:first-child,
.brat-prose > h3:first-child {
	margin-top: 0;
}

.brat-prose h1 {
	font-size: 1.95em;
}
.brat-prose h2 {
	font-size: 1.5em;
}
.brat-prose h3 {
	font-size: 1.24em;
}
.brat-prose h4 {
	font-size: 1.08em;
}
.brat-prose h5,
.brat-prose h6 {
	font-size: 0.95em;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--brat-ink-soft);
}

/* A hairline under H2 gives long articles a scannable rhythm without
   shouting in the accent colour. */
.brat-prose h2 {
	padding-bottom: 0.35em;
	border-bottom: 1px solid var(--brat-line);
}

.brat-prose p {
	color: var(--brat-ink-soft);
}

.brat-prose strong {
	color: var(--brat-ink);
	font-weight: 700;
}

/*
 * No underline on a link at rest, anywhere.
 *
 * theme.json sets this for the block editor and for the blocks core outputs, but
 * a link in ordinary post text - typed straight into the editor rather than
 * dropped in as a paragraph block - is not a block, so it needs saying here as
 * well or the browser's default underline comes back. Colour carries the
 * affordance; hover brings the underline back so a link is still obvious.
 */
a,
a:visited,
a:hover,
a:focus,
a:focus-visible,
a:active,
body.brat-site a,
body.brat-site a:visited,
body.brat-site a:hover,
body.brat-site a:focus,
body.brat-site a:focus-visible,
body.brat-site a:active {
	text-decoration: none !important;
}

.brat-prose a {
	text-decoration: none !important;
}

.brat-prose a:visited,
.brat-prose a:hover,
.brat-prose a:focus,
.brat-prose a:focus-visible,
.brat-prose a:active {
	text-decoration: none !important;
}

.brat-prose a {
	color: var(--brat-accent-text);
	transition: color var(--brat-speed) ease;
}

.brat-prose a:hover {
	color: var(--brat-accent);
}

.brat-prose ul,
.brat-prose ol {
	margin: 0 0 1.15em;
	padding-left: 1.35em;
	color: var(--brat-ink-soft);
}

.brat-prose li {
	margin-bottom: 0.45em;
}

.brat-prose li::marker {
	color: var(--brat-accent);
	font-weight: 700;
}

.brat-prose ul ul,
.brat-prose ol ol,
.brat-prose ul ol,
.brat-prose ol ul {
	margin-top: 0.45em;
	margin-bottom: 0.2em;
}

.brat-prose dl {
	margin: 0 0 1.15em;
}

.brat-prose dt {
	font-weight: 700;
	color: var(--brat-ink);
}

.brat-prose dd {
	margin: 0 0 0.6em 1.25em;
	color: var(--brat-ink-soft);
}

.brat-prose blockquote,
.brat-prose .wp-block-quote {
	margin: 1.6em 0;
	padding: 1rem 1.25rem;
	border-left: 3px solid var(--brat-accent);
	border-radius: 0 var(--brat-r-sm) var(--brat-r-sm) 0;
	background: var(--brat-accent-tint);
	color: var(--brat-ink-soft);
	font-style: normal;
}

.brat-prose blockquote p:last-child,
.brat-prose .wp-block-quote p:last-child {
	margin-bottom: 0;
}

.brat-prose blockquote cite,
.brat-prose .wp-block-quote cite {
	display: block;
	margin-top: 0.6rem;
	font-size: 0.85em;
	font-style: normal;
	color: var(--brat-ink-mute);
}

.brat-prose .wp-block-quote cite::before {
	content: "— ";
}

.brat-prose .wp-block-pullquote {
	margin: 2em 0;
	padding: 1.5em 1.25em;
	border-top: 3px solid var(--brat-accent);
	border-bottom: 3px solid var(--brat-accent);
	text-align: center;
}

.brat-prose .wp-block-pullquote blockquote {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
}

.brat-prose .wp-block-pullquote p {
	font-size: 1.2em;
	font-weight: 700;
	color: var(--brat-ink);
}

.brat-prose code,
.brat-prose .wp-block-code code {
	padding: 0.15em 0.4em;
	border-radius: 5px;
	background: var(--brat-card-2);
	border: 1px solid var(--brat-line);
	font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
	font-size: 0.88em;
	color: var(--brat-ink);
}

.brat-prose .wp-block-code {
	margin: 1.6em 0;
	padding: 1.1rem 1.25rem;
	background: var(--brat-card-2);
	border: 1px solid var(--brat-line);
	border-radius: var(--brat-r-sm);
	overflow-x: auto;
}

.brat-prose .wp-block-code code {
	padding: 0;
	border: 0;
	background: none;
	font-size: 0.85em;
	line-height: 1.6;
}

.brat-prose pre {
	margin: 1.6em 0;
	padding: 1.1rem 1.25rem;
	background: #1c1917;
	color: #f5f5f4;
	border-radius: var(--brat-r-sm);
	overflow-x: auto;
	font-size: 0.85em;
	line-height: 1.6;
}

.brat-prose pre code {
	background: none;
	border: 0;
	padding: 0;
	color: inherit;
}

.brat-prose hr,
.brat-prose .wp-block-separator {
	margin: 2.2em auto;
	border: 0;
	border-top: 1px solid var(--brat-line);
}

.brat-prose .wp-block-separator.is-style-wide {
	max-width: none;
}

.brat-prose .wp-block-separator.is-style-dots {
	border: 0;
	border-top: 3px dotted var(--brat-line);
	height: 0;
}

.brat-prose img {
	border-radius: var(--brat-r-sm);
	box-shadow: 0 1px 2px rgba(28, 25, 23, 0.06);
}

.brat-prose figure {
	margin: 1.8em 0;
}

.brat-prose figcaption,
.brat-prose .wp-block-image figcaption {
	margin-top: 0.6rem;
	font-size: 0.82em;
	line-height: 1.5;
	color: var(--brat-ink-mute);
	text-align: center;
}

.brat-prose .wp-block-image figcaption a {
	color: inherit;
}

.brat-prose .wp-block-image.alignwide,
.brat-prose .wp-block-image.alignfull,
.brat-prose .alignwide,
.brat-prose .alignfull {
	margin-inline: auto;
}

.brat-prose .wp-block-table {
	overflow-x: auto;
}

.brat-prose table,
.brat-prose .wp-block-table table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.94em;
}

.brat-prose th,
.brat-prose td {
	padding: 0.6rem 0.85rem;
	border: 1px solid var(--brat-line);
	text-align: left;
	vertical-align: top;
}

.brat-prose thead th,
.brat-prose .wp-block-table thead th {
	background: var(--brat-card-2);
	font-weight: 700;
	color: var(--brat-ink);
}

.brat-prose .wp-block-button {
	margin: 1.6em 0;
}

.brat-prose .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.7rem 1.4rem;
	border-radius: var(--brat-r-pill);
	background: var(--brat-accent);
	color: var(--brat-accent-ink);
	font-weight: 700;
	font-size: 0.92em;
	text-decoration: none;
	box-shadow: var(--brat-elev);
	transition: background var(--brat-speed) ease, transform var(--brat-speed) ease;
}

.brat-prose .wp-block-button__link:hover {
	background: var(--brat-accent-dark);
	color: var(--brat-accent-ink);
	transform: translateY(-1px);
}

.brat-prose .is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--brat-accent-text);
	box-shadow: inset 0 0 0 2px var(--brat-accent);
}

.brat-prose .is-style-outline .wp-block-button__link:hover {
	background: var(--brat-accent-tint);
	color: var(--brat-accent-text);
}

.brat-prose .wp-block-columns {
	margin: 1.8em 0;
	gap: var(--brat-gap);
}

.brat-prose .wp-block-column {
	min-width: 0;
}

.brat-prose .wp-block-group {
	border-radius: var(--brat-r-sm);
}

.brat-prose .is-style-tinted-background {
	padding: var(--brat-pad);
	background: var(--brat-accent-tint);
}

.brat-prose .wp-block-cover,
.brat-prose .wp-block-cover-image {
	border-radius: var(--brat-r-sm);
	box-shadow: none;
}

.brat-prose .wp-block-cover .wp-block-cover-text,
.brat-prose .wp-block-cover-image .wp-block-cover-image-text,
.brat-prose .wp-block-cover-image .wp-block-cover-text {
	padding: var(--brat-pad);
	color: #fff;
	font-weight: 700;
}

.brat-prose .wp-block-gallery {
	margin: 1.8em 0;
	gap: 0.6rem;
}

.brat-prose .wp-block-gallery figure {
	margin: 0;
}

.brat-prose .wp-block-gallery img {
	border-radius: var(--brat-r-sm);
}

.brat-prose .wp-block-embed {
	margin: 1.8em 0;
}

.brat-prose .wp-block-embed iframe,
.brat-prose .wp-block-video video {
	width: 100%;
	border-radius: var(--brat-r-sm);
	box-shadow: var(--brat-elev);
}

.brat-prose .wp-block-embed figcaption {
	margin-top: 0.5rem;
}

.brat-prose .wp-block-audio audio {
	width: 100%;
}

.brat-prose .wp-block-file {
	margin: 1.4em 0;
}

.brat-prose .wp-block-file a {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-weight: 600;
}

.brat-prose .wp-block-details {
	margin: 1.4em 0;
	padding: 0.8rem 1rem;
	border: 1px solid var(--brat-line);
	border-radius: var(--brat-r-sm);
	background: var(--brat-card);
}

.brat-prose .wp-block-details summary {
	cursor: pointer;
	font-weight: 700;
	color: var(--brat-ink);
}

.brat-prose .wp-block-details > *:not(summary) {
	margin-top: 0.75em;
}

.brat-prose .wp-block-verse {
	margin: 1.4em 0;
	font-style: italic;
	color: var(--brat-ink-soft);
}

.brat-prose .wp-block-verse cite {
	font-style: normal;
	font-size: 0.85em;
	color: var(--brat-ink-mute);
}

/* Search highlight from the core search block. */
.brat-prose mark,
.brat-prose ins {
	background: color-mix(in srgb, var(--brat-accent) 22%, transparent);
	color: inherit;
	padding: 0 0.15em;
	border-radius: 3px;
}

/* Alignment helpers, in case a theme or plugin emits them directly. */
.brat-prose .alignleft {
	float: left;
	margin: 0.35em 1.4em 1em 0;
}

.brat-prose .alignright {
	float: right;
	margin: 0.35em 0 1em 1.4em;
}

.brat-prose .aligncenter {
	display: block;
	margin-inline: auto;
}

.brat-prose .aligncenter img {
	margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Full-bleed: only the post body column is centred, so a wide block can
   break out to the edges of the page without breaking the text column.
   -------------------------------------------------------------------------- */

.brat-entry--prose {
	position: relative;
}

@media (min-width: 1100px) {
	.brat-entry--prose .brat-prose {
		width: min(var(--brat-wrap, 900px), 100%);
		margin-inline: auto;
	}

	.brat-entry--prose .brat-prose > .alignwide {
		width: calc(100% + clamp(4rem, 10vw, 9rem));
		max-width: none;
		margin-left: calc(-1 * clamp(2rem, 5vw, 4.5rem));
	}

	.brat-entry--prose .brat-prose > .alignfull {
		width: 100vw;
		max-width: 100vw;
		margin-left: calc(50% - 50vw);
		margin-right: calc(50% - 50vw);
	}

	.brat-entry--prose .brat-prose > .alignfull img {
		border-radius: 0;
		box-shadow: none;
	}
}

/* --------------------------------------------------------------------------
   Pagination, links to posts, sticky marker
   -------------------------------------------------------------------------- */

.page-links,
.brat-post-pages {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
	margin: 1.5rem 0 0;
	font-size: 0.85rem;
}

.page-links > * {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.2rem;
	height: 2.2rem;
	padding: 0 0.6rem;
	border: 1px solid var(--brat-line);
	border-radius: var(--brat-r-sm);
	background: var(--brat-card);
	color: var(--brat-ink-soft);
	text-decoration: none;
	font-weight: 700;
	transition: border-color var(--brat-speed) ease, color var(--brat-speed) ease;
}

.page-links .current {
	background: var(--brat-accent);
	border-color: var(--brat-accent);
	color: var(--brat-accent-ink);
}

.post-navigation .nav-links {
	display: grid;
	gap: 0.75rem;
}

.posts-navigation .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.75rem;
}

/* --------------------------------------------------------------------------
   404
   -------------------------------------------------------------------------- */

.brat-404 {
	text-align: center;
	padding: clamp(2rem, 8vw, 5rem) 0;
}

.brat-404__code {
	font-size: clamp(3.5rem, 12vw, 6rem);
	font-weight: 800;
	letter-spacing: -0.04em;
	line-height: 1;
	color: var(--brat-accent);
	margin: 0;
}

.brat-404__lead {
	max-width: 46ch;
	margin: 1rem auto 0;
	color: var(--brat-ink-soft);
}

/* --------------------------------------------------------------------------
   Dark mode for the editor palette

   theme.json lists one set of swatches, which is what the colour picker shows.
   Five of them are light and five are dark, so a block coloured "Body text"
   would be invisible once the visitor switches the site to dark mode. These
   rules re-point the same classes at their dark equivalents, which is what
   makes "pick a colour in Gutenberg" survive the theme's own dark mode.
   -------------------------------------------------------------------------- */

html.dark .has-paper-color {
	color: var(--brat-text, #f5f5f4);
}

html.dark .has-paper-background-color {
	background-color: var(--brat-bg, #0d1513);
}

html.dark .has-card-color {
	color: var(--brat-text, #f5f5f4);
}

html.dark .has-card-background-color,
html.dark .has-sand-background-color,
html.dark .has-brand-soft-background-color {
	background-color: var(--brat-surface, #1c1917);
}

html.dark .has-sand-color,
html.dark .has-line-color,
html.dark .has-mute-color {
	color: var(--brat-text-muted, #a8a29e);
}

html.dark .has-line-background-color {
	background-color: var(--brat-border, #33302e);
}

html.dark .has-soft-color {
	color: var(--brat-text-soft, #d6d3d1);
}

html.dark .has-soft-background-color {
	background-color: var(--brat-surface-2, #292524);
}

html.dark .has-ink-color,
html.dark .has-brand-deep-color {
	color: var(--brat-text, #f5f5f4);
}

html.dark .has-ink-background-color,
html.dark .has-brand-deep-background-color {
	background-color: var(--brat-surface, #1c1917);
}

html.dark .has-brand-color {
	color: var(--brat-accent, #34d399);
}

html.dark .has-brand-background-color {
	background-color: var(--brat-accent, #34d399);
	color: var(--brat-bg, #0d1513);
}

html.dark .has-info-color {
	color: #38bdf8;
}

html.dark .has-warn-color {
	color: #fbbf24;
}

html.dark .has-danger-color {
	color: #fb7185;
}

html.dark .has-info-background-color {
	background-color: #0c2233;
	color: #e0f2fe;
}

html.dark .has-warn-background-color {
	background-color: #2a1c07;
	color: #fef3c7;
}

html.dark .has-danger-background-color {
	background-color: #2c0a16;
	color: #ffe4e6;
}

html.dark .has-brand-soft-color {
	color: var(--brat-accent, #34d399);
}

/* The gradients from theme.json need the same treatment. */
html.dark .has-brand-fade-gradient-background {
	background: linear-gradient(140deg, #022c22 0%, #292524 100%);
}

html.dark .has-brand-soft-gradient-background {
	background: linear-gradient(180deg, #022c22 0%, #1c1917 100%);
}

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */

@media print {
	body.brat-site {
		background: #fff;
		color: #000;
		font-size: 11.5pt;
	}

	.brat-site-bar,
	.site-footer,
	.brat-post-nav,
	.brat-share,
	.brat-related,
	.brat-comments,
	.brat-post-actions,
	.brat-post-hero__cta,
	.brat-pagination {
		display: none !important;
	}

	.brat-site-content {
		max-width: none;
		padding: 0;
	}

	.brat-card {
		border: 0;
		box-shadow: none;
	}

	.brat-prose a {
		color: #000;
		text-decoration: none !important;
	}

	.brat-prose img {
		max-width: 100% !important;
		box-shadow: none;
	}

	.brat-post-hero {
		background: none;
		padding: 0 0 1rem;
	}

	.brat-post-title {
		color: #000;
	}

	a[href]::after {
		content: " (" attr(href) ")";
		font-size: 0.8em;
		word-break: break-all;
	}

	.brat-site-nav a[href]::after,
	.brat-post-title a[href]::after {
		content: "";
	}
}