/**
 * Page layout primitives
 * #content, .wrap container, column grids (.mtp-three-col, .mtp-two-col),
 * editorial intros (.page-intro), home-page structural overrides, sticky
 * footer (short pages), and small inline-image helpers used in body copy.
 */

/* Sticky footer — keep the site footer at the bottom of the viewport when
   the main column is short (404, private gate, sparse pages). #content grows
   to absorb remaining height; longer pages behave as before. */
#container {
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
}

body.admin-bar #container {
	min-height: calc(100vh - var(--wp-admin--admin-bar--height, 32px));
	min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 32px));
}

#container > #content {
	flex: 1 1 auto;
}

#content {
	padding-bottom: clamp(2rem, 6vw, 4rem);
}

#inner-content.wrap,
.wrap {
	width: min(92%, 1220px);
	max-width: 1220px;
	margin: 0 auto !important;
	padding-left: max(0px, env(safe-area-inset-left));
	padding-right: max(0px, env(safe-area-inset-right));
}

/* Front page: full-width content + wider container. */
body.home #main {
	width: 100% !important;
	max-width: 100% !important;
}

body.home #inner-content.wrap {
	max-width: 1440px;
}

/* Home: tighten the editorial opening. The hero lives inside Gutenberg's
   .entry-content and flows through .mtp-three-col, so we nudge rhythm here
   rather than rewiring the template. */
body.home .entry-content > h1,
body.home .entry-content > h2 {
	letter-spacing: -0.03em;
	line-height: 1.08;
}

body.home .entry-content > h1 {
	font-size: clamp(2.15rem, 3.5vw + 1.25rem, 3.1rem);
	margin-bottom: 0.35em;
}

body.home .entry-content > p {
	max-width: 768px;
	text-align: left;
	margin: 0 auto;
}

body.home .entry-content > hr {
	max-width: 320px;
	margin-top: clamp(2rem, 5vw, 3rem);
	margin-bottom: clamp(2rem, 5vw, 3rem);
	margin-left: 0;
	height: 1px;
	background: linear-gradient(
		90deg,
		color-mix(in srgb, var(--brand-purple) 50%, transparent),
		color-mix(in srgb, var(--brand-rule) 85%, transparent) 60%,
		transparent
	);
}

/* ---------- Home logo / hero ---------- */
/* Terminal-style "the backlog_" wordmark with a footnote-style caption
   tucked into the title's lower-left, suggesting a typewriter annotation. */
.home-logo-area {
	text-align: center;
	margin: clamp(2rem, 6vw, 4rem) 0 clamp(1.25rem, 4vw, 2.25rem);
}

.home-logo-area__title {
	margin: 0;
	font-weight: normal;
	font-size: clamp(2.25rem, 9vw, 3.9375rem); /* 36px → 63px */
	line-height: 1.05;
	letter-spacing: -0.02em;
	color: var(--brand-black);
}

/* Override base.css <code> styling — we want the monospace font but no
   pill background or padding for a terminal-prompt look. */
.home-logo-area__title code {
	background: transparent;
	padding: 0;
	border-radius: 0;
	font-family: var(--font-mono);
	font-size: inherit;
}

/* Precise gap between "the" and "backlog" that won't collapse or wrap. */
.home-logo-area__gap {
	display: inline-block;
	width: 0.16em;
}

/* Footnote caption — nestled into the lower-left of the title using em-based
   offsets so the design holds together as the title scales. The relative
   offset is reset on narrow phones (see responsive.css). */
.home-logo-area__caption {
	display: inline-block;
	position: relative;
	top: -1em;
	left: -3.1em;
	margin: 0;
	font-size: clamp(0.625rem, 0.4vw + 0.55rem, 0.75rem);
	color: var(--brand-text-muted);
}

.home-logo-area__caption sup {
	font-size: 1.1em;
	color: var(--brand-purple);
}

/* Blinking terminal cursor on "backlog_". */
.bl-cursor {
	display: inline-block;
	margin-left: 0.05em;
	color: var(--brand-purple);
	animation: bl-cursor-blink 1.1s steps(2, start) infinite;
}

@keyframes bl-cursor-blink {
	to { visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
	.bl-cursor {
		animation: none;
	}
}

/* Column grids */
body .mtp-three-col {
	display: grid !important;
	grid-template-columns: 15% 70% 15% !important;
	gap: clamp(16px, 3vw, 28px);
}

.mtp-three-col > .wp-block-column {
	margin: 0; /* prevents WP column spacing from breaking layout */
}

.mtp-two-col {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: clamp(2rem, 5vw, 3.5rem);
	padding-left: 0;
}

/* Editorial page intro — generic intro paragraph used on archives, author, etc. */
.page-intro {
	font-size: clamp(1.1rem, 1.1vw + 0.9rem, 1.3rem);
	line-height: 1.55;
	color: var(--brand-text-muted);
	font-weight: 400;
	max-width: var(--measure-prose);
	letter-spacing: -0.005em;
	text-wrap: pretty;
}

.page-intro strong,
.page-intro b {
	color: var(--brand-text);
	font-weight: 600;
}

/* Inline calendar glyph used next to dates in body copy. */
.calendar-img {
	display: inline-block;
	height: 20px;
	width: 20px;
	vertical-align: middle;
	margin-right: 5px;
}
