/* ── Core-block bridge ───────────────────────────────────────────────────────
   The design system was authored against its own markup (.o365-card, .o365-prose,
   .o365-posthero…). WordPress emits core block markup (.wp-block-post-title,
   .wp-block-post-featured-image…). This file maps one onto the other so the
   templates can be built from core blocks alone.

   Nothing here introduces a new design decision. If a value appears in this
   file that is not in the design system, that is a bug.

   Loaded AFTER o365.css, so it wins on equal specificity.
   ─────────────────────────────────────────────────────────────────────────── */

/* ── Layout plumbing ─────────────────────────────────────────────────────── */

/* WordPress root padding is a fixed value from theme.json; the design wants the
   fluid gutter. Redefine the variable rather than fight every consumer of it. */
:root,
body {
	--wp--style--root--padding-left: var(--gutter);
	--wp--style--root--padding-right: var(--gutter);
}

.wp-site-blocks > * {
	margin-block-start: 0;
	margin-block-end: 0;
}

/* The page column. `.o365-guide` already supplies max-width + gutter, so cancel
   WordPress's own global padding where the two would stack. */
.o365-main {
	padding-block: var(--space-lg) var(--space-xl);
}
.o365-main.has-global-padding {
	padding-inline: var(--gutter);
}
.o365-main.has-global-padding > .alignfull {
	margin-inline: calc(var(--gutter) * -1);
	width: auto;
	max-width: none;
}

/* Sticky site chrome. Class-based first, element-based as the safety net in case
   the template-part wrapper drops the class. */
header.wp-block-template-part,
.o365-header {
	position: sticky;
	top: 0;
	z-index: 40;
	background: var(--understory);
	color: var(--i-text-primary);
}

/* Tag bar rides in the header part but only belongs on feed templates. */
.o365-tagbar {
	display: none;
}
body.home .o365-tagbar,
body.blog .o365-tagbar,
body.archive .o365-tagbar,
body.search .o365-tagbar {
	display: block;
}

/* Current-section underline without per-template header parts. */
body.home .o365-nav a[data-nav="blog"],
body.blog .o365-nav a[data-nav="blog"],
body.single-post .o365-nav a[data-nav="blog"],
body.archive .o365-nav a[data-nav="blog"],
body.page-template-guide .o365-nav a[data-nav="guides"],
body.page-template-guide-index .o365-nav a[data-nav="guides"] {
	border-bottom-color: var(--spruce-400);
}

/* ── Long-form body ──────────────────────────────────────────────────────────
   `.o365-prose` is applied to core/post-content. Core's flow layout sets
   margin-block-start on every child from --wp--style--block-gap; the design's
   rhythm has to win. Same specificity, later file — but bump it anyway so
   source order is not the only thing holding this together. */

.wp-site-blocks .o365-prose > * {
	margin-block-start: var(--flow-paragraph);
	margin-block-end: 0;
	margin-inline: 0;
}
.wp-site-blocks .o365-prose > :first-child {
	margin-block-start: 0;
}
.wp-site-blocks .o365-prose > h2,
.wp-site-blocks .o365-prose > .wp-block-heading:is(h2) {
	font-size: var(--text-x-large);
	margin-block-start: var(--flow-h2);
	margin-block-end: var(--flow-heading-after);
	padding-top: 0.55em;
	border-top: var(--hairline);
}
.wp-site-blocks .o365-prose > h3,
.wp-site-blocks .o365-prose > .wp-block-heading:is(h3) {
	font-size: var(--text-large);
	font-weight: var(--weight-bold);
	margin-block-start: var(--flow-h3);
	margin-block-end: var(--flow-heading-after);
}
.wp-site-blocks .o365-prose > :is(h2, h3) + * {
	margin-block-start: 0;
}
.wp-site-blocks .o365-prose > :is(figure, .wp-block-image, .wp-block-gallery, .alignwide, .alignfull) {
	margin-block-start: var(--flow-figure);
	margin-block-end: var(--flow-figure);
}
.wp-site-blocks .o365-prose > :is(blockquote, .wp-block-quote, .wp-block-pullquote, .o365-pullquote, .wp-block-details, hr, .wp-block-separator) {
	margin-block-start: var(--flow-block);
	margin-block-end: var(--flow-block);
}

/* Imported Squarespace content is classic HTML, so figures and captions arrive
   as bare elements as well as blocks. Cover both. */
.o365-prose :is(figcaption, .wp-element-caption) {
	font-family: var(--font-mono);
	font-size: var(--text-x-small);
	line-height: 1.45;
	color: var(--text-secondary);
	margin-top: var(--space-2xs);
	max-width: var(--measure-narrow);
	text-align: left;
}
.o365-prose :is(img, .wp-block-image img) {
	border-radius: var(--radius-photo);
}
.o365-prose .wp-block-image {
	margin-left: 0;
	margin-right: 0;
}

/* The Squarespace importer wrapped each text block in `<div
   class="sqs-html-content">`, so in an imported post the paragraphs and
   headings are *grandchildren* of .o365-prose, not children. Every flow rule
   above is a `>` rule, and o365.css resets `p` to `margin: 0` — so imported
   posts rendered as one unbroken slab of text with no rule above their h2s,
   while natively-authored posts were fine. Re-apply the same rhythm one level
   down. Keep these selectors in step with the `.o365-prose > …` rules above.

   Deliberately scoped to .sqs-html-content rather than made a blanket
   descendant selector: `.o365-prose h2` would also rewrite headings inside
   pattern markup and guide entries, which set their own spacing. */
.o365-prose .sqs-html-content > * + * {
	margin-block-start: var(--flow-paragraph);
}
.o365-prose .sqs-html-content > :is(h2, .wp-block-heading:is(h2)) {
	font-size: var(--text-x-large);
	margin-block-start: var(--flow-h2);
	margin-block-end: var(--flow-heading-after);
	padding-top: 0.55em;
	border-top: var(--hairline);
}
.o365-prose .sqs-html-content > :is(h3, .wp-block-heading:is(h3)) {
	font-size: var(--text-large);
	font-weight: var(--weight-bold);
	margin-block-start: var(--flow-h3);
	margin-block-end: var(--flow-heading-after);
}
.o365-prose .sqs-html-content > :is(h2, h3) + * {
	margin-block-start: 0;
}
.o365-prose .sqs-html-content > :is(figure, .wp-block-image, .wp-block-gallery) {
	margin-block-start: var(--flow-figure);
	margin-block-end: var(--flow-figure);
}
.o365-prose .sqs-html-content > :is(blockquote, .wp-block-quote, .wp-block-pullquote, .o365-pullquote, hr, .wp-block-separator) {
	margin-block-start: var(--flow-block);
	margin-block-end: var(--flow-block);
}
.o365-prose .sqs-html-content > :is(ul, ol) {
	padding-left: 1.15em;
}
/* A wrapper that opens with a heading still needs the heading's own top
   margin, which `* + *` cannot give a first child. */
.o365-prose .sqs-html-content:first-child > :first-child {
	margin-block-start: 0;
}

/* ── Post card (core/query + core/post-template) ─────────────────────────── */

.o365-card.wp-block-post,
.wp-block-post.o365-card {
	list-style: none;
}
.o365-card > * {
	margin-block: 0;
}
.o365-card .o365-card__media {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: var(--radius-photo);
	aspect-ratio: 3 / 2;
	/* Also the no-featured-image plate: a striped spruce field, revealed only
	   when core renders no <img>. Not a stock photo, not the logo. */
	background:
		repeating-linear-gradient(135deg, transparent 0 9px, rgba(196, 201, 153, 0.1) 9px 10px),
		var(--spruce-800);
}
.o365-card .o365-card__media .wp-block-post-featured-image {
	margin: 0;
	height: 100%;
}
.o365-card .o365-card__media .wp-block-post-featured-image :is(a, img) {
	display: block;
	width: 100%;
	height: 100%;
}
.o365-card .o365-card__media img {
	object-fit: cover;
	border-radius: 0;
	transition: transform 380ms var(--easing);
}
.o365-card:hover .o365-card__media img {
	transform: scale(1.028);
}

/* Tag chips over the photograph — the one use of blur in the system. */
.o365-card .o365-card__tags {
	position: absolute;
	left: var(--space-2xs);
	bottom: var(--space-2xs);
	right: var(--space-2xs);
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3xs);
	z-index: 1;
}
.o365-card .o365-card__tags a {
	display: inline-flex;
	align-items: center;
	font-family: var(--font-mono);
	font-size: 0.6875rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: var(--tracking-eyebrow);
	line-height: 1;
	padding: 0.42em 0.85em 0.38em;
	border-radius: var(--radius-pill);
	text-decoration: none;
	background: rgba(22, 32, 26, 0.82);
	color: var(--lichen-300);
	backdrop-filter: blur(3px);
}
.o365-card .o365-card__tags a:hover {
	background: var(--spruce-800);
	color: var(--lichen-200);
}
/* The wp-block-post-terms separator is a bare text node; hide it. */
.o365-card .o365-card__tags .wp-block-post-terms__separator {
	display: none;
}

/* When there is no featured image the plate carries the tag name at size,
   exactly as .o365-card__plate specifies. */
.o365-card .o365-card__media:not(:has(img)) {
	display: flex;
	align-items: flex-end;
	padding: var(--space-sm);
}
.o365-card .o365-card__media:not(:has(img)) .o365-card__tags {
	position: static;
	backdrop-filter: none;
}
.o365-card .o365-card__media:not(:has(img)) .o365-card__tags a {
	background: transparent;
	backdrop-filter: none;
	padding: 0;
	font-size: clamp(1.1rem, 2.6vw, 1.6rem);
	letter-spacing: 0.06em;
	line-height: 1.1;
	color: var(--lichen-300);
	text-wrap: balance;
}

.o365-card .o365-card__body {
	display: flex;
	flex-direction: column;
	gap: var(--space-3xs);
	margin-block-start: var(--space-xs);
}
.o365-card .o365-card__body > * {
	margin-block: 0;
}
.o365-card .o365-card__title {
	font-size: var(--text-large);
	font-weight: var(--weight-display);
	letter-spacing: var(--tracking-tight);
	line-height: 1.14;
	text-wrap: balance;
	color: var(--text-primary);
	transition: color var(--duration) var(--easing);
}
.o365-card .o365-card__title a {
	color: inherit;
	text-decoration: none;
}
.o365-card:hover .o365-card__title,
.o365-card:hover .o365-card__title a {
	color: var(--accent-text-strong);
}
.o365-card .o365-card__excerpt {
	font-size: var(--text-small);
	color: var(--text-secondary);
	line-height: 1.55;
}
.o365-card .o365-card__excerpt p {
	margin: 0;
}
.o365-card .o365-card__excerpt .wp-block-post-excerpt__more-text {
	display: none;
}
.o365-card .o365-card__meta {
	font-family: var(--font-mono);
	font-size: var(--text-x-small);
	color: var(--text-secondary);
}

/* Feature card — first in the feed. */
@media (min-width: 48rem) {
	.o365-card--feature {
		display: grid;
		grid-template-columns: 1.35fr 1fr;
		align-items: center;
		gap: var(--space-md);
	}
	.o365-card--feature .o365-card__media {
		aspect-ratio: 16 / 10;
	}
	.o365-card--feature .o365-card__body {
		gap: var(--space-2xs);
		margin-block-start: 0;
	}
	.o365-card--feature .o365-card__title {
		font-size: var(--text-x-large);
	}
	.o365-card--feature .o365-card__excerpt {
		font-size: var(--text-medium);
		line-height: var(--leading-body);
	}
}
@media (min-width: 64rem) {
	.o365-card--feature .o365-card__title {
		font-size: var(--text-xx-large);
	}
}

/* Compact card — the related row under a post. */
.o365-card--compact {
	display: grid;
	grid-template-columns: 5.5rem 1fr;
	gap: var(--space-xs);
	align-items: start;
}
.o365-card--compact .o365-card__media {
	aspect-ratio: 1 / 1;
}
.o365-card--compact .o365-card__body {
	margin-block-start: 0;
}
.o365-card--compact .o365-card__title {
	font-size: var(--text-small);
	font-weight: var(--weight-bold);
	line-height: 1.3;
}
.o365-card--compact .o365-card__tags {
	display: none;
}

/* Core's flow layout puts margin-block-start on every child except the first
   (`:root :where(.is-layout-flow) > *`). post-template always carries
   is-layout-flow, so when we make it a grid that stray margin pushes every
   card down except the first one in the list — the first card floats above
   its own row, and the extra margin also inflates the row gap. Zero it on any
   post-template we lay out as a grid; `gap` is what should space these. */
.o365-feed.wp-block-post-template > *,
.o365-relatedgrid.wp-block-post-template > * {
	margin-block: 0;
}

/* Feed grid — core/post-template emits a <ul>, so strip list affordances. */
.o365-feed.wp-block-post-template,
.wp-block-post-template.o365-feed {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: var(--space-lg) var(--space-md);
	grid-template-columns: 1fr;
}
@media (min-width: 40rem) {
	.o365-feed.wp-block-post-template {
		grid-template-columns: repeat(2, 1fr);
	}
}
@media (min-width: 64rem) {
	.o365-feed.wp-block-post-template {
		grid-template-columns: repeat(3, 1fr);
	}
}
.o365-feed-feature.wp-block-post-template {
	list-style: none;
	padding: 0;
	margin: 0 0 var(--space-lg);
}
.o365-relatedgrid.wp-block-post-template {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: var(--space-sm);
	grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}

/* Pagination */
.wp-block-query-pagination {
	margin-top: var(--space-xl);
	justify-content: center;
	gap: var(--space-sm);
	font-family: var(--font-mono);
	font-size: var(--text-x-small);
	text-transform: uppercase;
	letter-spacing: 0.1em;
}
.wp-block-query-pagination a {
	text-decoration: none;
	color: var(--accent-text);
}
.wp-block-query-pagination a:hover {
	color: var(--accent-text-strong);
}
.wp-block-query-no-results {
	font-family: var(--font-mono);
	font-size: var(--text-x-small);
	color: var(--text-secondary);
}

/* ── Post hero ───────────────────────────────────────────────────────────── */

.o365-posthero > * {
	margin-block: 0;
}
.o365-posthero__head {
	display: flex;
	flex-direction: column;
	gap: var(--space-xs);
	max-width: var(--measure);
}
.o365-posthero__head > * {
	margin-block: 0;
}
.o365-posthero__title {
	font-size: var(--text-xx-large);
	font-weight: var(--weight-display);
	letter-spacing: -0.025em;
	line-height: var(--leading-tight);
	text-wrap: balance;
}
.o365-posthero__meta {
	font-family: var(--font-mono);
	font-size: var(--text-x-small);
	color: var(--text-secondary);
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em 1em;
	align-items: center;
	padding-top: var(--space-xs);
	border-top: var(--hairline);
}
.o365-posthero__meta > * {
	margin-block: 0;
}
.o365-posthero__meta p:empty,
.o365-guidehero__stats p:empty {
	display: none;
}
/* core/post-author-name renders the display name only; the label is the
   theme's, so it lives here rather than in the template. */
.o365-posthero__meta .o365-byline::before {
	content: "By ";
}
.o365-posthero__figure {
	margin: 0;
	margin-block-start: var(--space-md);
}
.o365-posthero__figure .wp-block-post-featured-image {
	margin: 0;
}
.o365-posthero__figure img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: var(--radius-photo-bleed);
}
.o365-posthero__figure figcaption {
	font-family: var(--font-mono);
	font-size: var(--text-x-small);
	color: var(--text-secondary);
	margin-top: var(--space-2xs);
	text-align: left;
}
/* No featured image: the plate, not a stock photo. */
.o365-posthero__figure:not(:has(img)) {
	aspect-ratio: 21 / 9;
	background:
		repeating-linear-gradient(135deg, transparent 0 11px, rgba(196, 201, 153, 0.1) 11px 12px),
		var(--spruce-800);
}

/* Tag chips wherever core/post-terms renders outside a card. */
.o365-termchips {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2xs);
	align-items: center;
}
.o365-termchips a {
	display: inline-flex;
	align-items: center;
	font-family: var(--font-mono);
	font-size: 0.6875rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: var(--tracking-eyebrow);
	line-height: 1;
	padding: 0.42em 0.85em 0.38em;
	border-radius: var(--radius-pill);
	text-decoration: none;
	background: var(--lichen-200);
	color: var(--lichen-900);
	transition: background var(--duration) var(--easing);
}
.o365-termchips a:hover {
	background: var(--lichen-300);
	color: var(--lichen-900);
}
.o365-termchips .wp-block-post-terms__separator {
	display: none;
}

/* ── Guide hero (core/group + core/post-featured-image) ──────────────────── */

.o365-guidehero {
	position: relative;
	display: flex;
	align-items: flex-end;
	overflow: hidden;
	min-height: min(78vh, 44rem);
	background: var(--understory);
	border-radius: var(--radius-photo-bleed);
}
.o365-guidehero .o365-guidehero__bg {
	position: absolute;
	inset: 0;
	margin: 0;
}
.o365-guidehero .o365-guidehero__bg img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
}
.o365-guidehero::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--scrim);
	pointer-events: none;
}
.o365-guidehero .o365-guidehero__inner {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: var(--wide-width);
	margin-inline: auto;
	padding: var(--space-lg) var(--gutter);
	color: var(--i-text-primary);
	display: flex;
	flex-direction: column;
	gap: var(--space-xs);
	align-items: flex-start;
}
.o365-guidehero .o365-guidehero__inner > * {
	margin-block: 0;
}
.o365-guidehero__name {
	font-size: var(--text-display);
	font-weight: var(--weight-display);
	letter-spacing: var(--tracking-display);
	line-height: 0.94;
	color: var(--i-text-primary);
}
.o365-guidehero__intro {
	font-size: var(--text-large);
	line-height: var(--leading-snug);
	max-width: 34ch;
	color: var(--i-text-primary);
}
.o365-guidehero__intro p {
	margin: 0;
}
.o365-guidehero__stats {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em 1.4em;
	font-family: var(--font-mono);
	font-size: var(--text-x-small);
	color: var(--i-text-secondary);
	padding-top: var(--space-xs);
	border-top: 1px solid rgba(237, 239, 231, 0.28);
	width: 100%;
}
.o365-guidehero__stats > * {
	margin-block: 0;
}
.o365-guidehero .o365-eyebrow {
	color: var(--lichen-300);
}

/* ── Guide page column ───────────────────────────────────────────────────── */

.o365-guide--split > * {
	margin-block: 0;
	min-width: 0;
}

/* core/details as the overflow control */
.o365-more.wp-block-details {
	padding-block: 0;
}
.o365-more.wp-block-details > summary {
	cursor: pointer;
	list-style: none;
	padding: var(--space-xs) 0;
	font-family: var(--font-mono);
	font-size: var(--text-x-small);
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--accent-text);
}
.o365-more.wp-block-details > summary::-webkit-details-marker {
	display: none;
}

/* Galleries inside a guide follow the photoset shapes. */
.o365-photoset.wp-block-gallery {
	gap: var(--space-2xs);
}
.o365-photoset.wp-block-gallery figure.wp-block-image img {
	aspect-ratio: 4 / 5;
	object-fit: cover;
	width: 100%;
	height: 100%;
	border-radius: var(--radius-photo);
}
.o365-photoset--one.wp-block-gallery figure.wp-block-image img {
	aspect-ratio: 3 / 2;
}

/* ── Subscribe ───────────────────────────────────────────────────────────── */

.o365-subscribe > * {
	margin-block: 0;
}
.o365-subscribe--inline.wp-block-group {
	margin-block: var(--flow-block);
}

/* ── Archive / search headers ────────────────────────────────────────────── */

.o365-archivehead {
	display: flex;
	flex-direction: column;
	gap: var(--space-xs);
	max-width: var(--measure);
	margin-bottom: var(--space-lg);
}
.o365-archivehead > * {
	margin-block: 0;
}
.o365-archivehead .wp-block-query-title,
.o365-pagetitle {
	font-size: var(--text-xx-large);
	letter-spacing: -0.025em;
	line-height: var(--leading-tight);
	text-wrap: balance;
}
.o365-archivehead .wp-block-term-description p {
	margin: 0;
	font-size: var(--text-large);
	line-height: var(--leading-snug);
	color: var(--text-secondary);
}

/* ── Comments, search form, misc core bits ───────────────────────────────── */

.wp-block-search__input,
input[type="email"],
input[type="text"],
input[type="search"] {
	font-family: var(--font-body);
	font-size: var(--text-small);
	padding: 0.85rem 1.1rem;
	border-radius: var(--radius-pill);
	border: 1px solid var(--border-hairline);
	background: var(--surface-page);
	color: var(--text-primary);
}
.wp-block-search__button {
	border-radius: var(--radius-pill);
	border: 0;
	background: var(--accent);
	color: var(--bone);
	font-weight: var(--weight-bold);
	padding: 0.85rem 1.5rem;
}

/* The theme ships no box-shadow. Neutralise any core default that adds one. */
.wp-site-blocks :is(.wp-block-image, .wp-block-cover, .wp-block-group) {
	box-shadow: none;
}

/* Skip link */
.skip-link:focus {
	background: var(--understory);
	color: var(--i-text-primary);
}

/* ── Guide directory columns (core/columns) ──────────────────────────────────
   The design's `.o365-guide--split` grid assumes the index and the entries are
   siblings in one template. Core has no per-page sidebar slot, so the directory
   is authored as a two-column block instead. Same result, same tokens. */

.o365-guide-columns.wp-block-columns {
	gap: var(--space-xl);
	align-items: flex-start;
}
.o365-guide-columns > .wp-block-column {
	min-width: 0;
}
@media (min-width: 64rem) {
	.o365-guide-columns > .wp-block-column:first-child {
		position: sticky;
		top: calc(var(--header-h) + var(--space-md));
	}
	.o365-guide-columns .o365-guideindex {
		position: static;
		border: 0;
		background: transparent;
	}
	.o365-guide-columns .o365-guideindex__label {
		display: block;
		font-family: var(--font-mono);
		font-size: var(--text-x-small);
		text-transform: uppercase;
		letter-spacing: var(--tracking-eyebrow);
		color: var(--accent-2);
		margin-bottom: var(--space-xs);
	}
	.o365-guide-columns .o365-guideindex__rail {
		flex-direction: column;
		overflow: visible;
		padding: 0;
		gap: 0;
	}
	.o365-guide-columns .o365-guideindex__rail a {
		display: flex;
		justify-content: space-between;
		gap: var(--space-xs);
		padding: 0.55rem 0;
		border-bottom: var(--hairline);
		border-radius: 0;
		background: transparent;
		color: var(--text-secondary);
		font-family: var(--font-mono);
		font-size: var(--text-x-small);
		text-transform: uppercase;
		letter-spacing: 0.08em;
		text-decoration: none;
	}
	.o365-guide-columns .o365-guideindex__rail a:hover {
		color: var(--accent-text);
	}
	.o365-guide-columns .o365-guideindex__rail a b {
		color: var(--text-quiet);
		font-weight: 400;
	}
}

/* Entries authored as core/group need their own margins cancelled — the
   .o365-entry rules in the design system already carry the rhythm. */
.o365-entry.wp-block-group > * {
	margin-block: 0;
}
.o365-entry .o365-entry__locator span + span::before {
	content: "";
}
.o365-entry .o365-entry__body,
.o365-entry .o365-resources,
.o365-entry .o365-photoset {
	margin-block-start: var(--space-sm);
}

/* Accessibility helper — core only ships this in admin CSS. */
.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

/* ── Generated adventure guide (see inc/guide-transform.php) ─────────────────
   The 47 imported guides are rebuilt at render time into the design system's
   guide shape. These rules are the same ones `.o365-guide--split` applies in
   the source system, keyed to the generated wrapper instead of a block. */

body.page-template-guide .wp-site-blocks .o365-prose {
	max-width: var(--wide-width);
}
.o365-guide-columns--generated {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-md);
	align-items: start;
}
.o365-guide-columns--generated > * {
	min-width: 0;
	margin-block: 0;
}
.o365-guide-intro {
	max-width: var(--measure);
	margin-bottom: var(--space-md);
}
.o365-guide-intro > * + * {
	margin-top: var(--flow-paragraph);
}
.o365-guide-intro h3 {
	font-size: var(--text-large);
	font-weight: var(--weight-bold);
	margin-top: var(--flow-h3);
}

/* Mobile: the index is a sticky snapping chip rail under the header. */
.o365-guide-columns--generated .o365-guideindex {
	position: sticky;
	top: var(--header-h);
	z-index: 20;
	background: var(--surface-page);
	border-bottom: var(--hairline);
	margin-inline: calc(var(--gutter) * -1);
}

@media (min-width: 64rem) {
	.o365-guide-columns--generated {
		grid-template-columns: 15rem 1fr;
		gap: var(--space-xl);
	}
	.o365-guide-columns--generated > .o365-guide-columns__index {
		position: sticky;
		top: calc(var(--header-h) + var(--space-md));
		max-height: calc(100vh - var(--header-h) - var(--space-lg));
		overflow-y: auto;
		scrollbar-width: thin;
	}
	.o365-guide-columns--generated .o365-guideindex {
		position: static;
		border: 0;
		background: transparent;
		margin-inline: 0;
	}
	.o365-guide-columns--generated .o365-guideindex__label {
		display: block;
		font-family: var(--font-mono);
		font-size: var(--text-x-small);
		text-transform: uppercase;
		letter-spacing: var(--tracking-eyebrow);
		color: var(--accent-2);
		margin-bottom: var(--space-xs);
	}
	.o365-guide-columns--generated .o365-guideindex__rail {
		flex-direction: column;
		overflow: visible;
		padding: 0;
		gap: 0;
	}
	.o365-guide-columns--generated .o365-guideindex__rail a {
		display: flex;
		justify-content: space-between;
		gap: var(--space-xs);
		padding: 0.55rem 0;
		border-bottom: var(--hairline);
		border-radius: 0;
		background: transparent;
		color: var(--text-secondary);
		font-family: var(--font-mono);
		font-size: var(--text-x-small);
		text-transform: uppercase;
		letter-spacing: 0.08em;
		text-decoration: none;
	}
	.o365-guide-columns--generated .o365-guideindex__rail a:hover {
		color: var(--accent-text);
		background: transparent;
	}
	.o365-guide-columns--generated .o365-guideindex__rail a b {
		color: var(--text-quiet);
		font-weight: 400;
		margin-left: 0;
	}
}

/* Entries as generated (plain elements, not blocks). */
.o365-guide-columns__body > .o365-entry:first-of-type {
	padding-top: 0;
}
.o365-entry__locator span + span::before {
	content: "";
}
.o365-entry .o365-photoset--one img {
	max-height: 30rem;
	object-fit: cover;
}
.o365-entry .o365-entry__body {
	margin-top: var(--space-sm);
}
.o365-entry .o365-entry__body p + p {
	margin-top: var(--flow-paragraph);
}
.o365-resources a[data-type="article"] b {
	color: var(--text-secondary);
}

/* ── Guides index (see o365_guide_index_transform) ──────────────────────── */

body.page-template-guide-index .wp-site-blocks .o365-prose,
body.page-adventure-guides-overview .wp-site-blocks .o365-prose {
	max-width: var(--wide-width);
}
.o365-prose > .o365-guidegrid,
.o365-prose > .o365-guidelist {
	margin-block: var(--space-md) var(--space-xl);
	max-width: var(--wide-width);
}
.o365-prose > .o365-eyebrow {
	margin-block-start: var(--space-lg);
	margin-block-end: var(--space-xs);
}
.o365-guidecard .o365-guidecard__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
}
.o365-guidecard .o365-guidecard__media {
	display: block;
}
.o365-guidelist a b {
	white-space: nowrap;
}

/* `.o365-guide` already supplies the page gutter; a constrained post-content
   inside it also carries WordPress's global padding, so the reading column
   sat one gutter in from the title. Cancel the inner one. */
.o365-main > .o365-prose.has-global-padding {
	padding-inline: 0;
}

/* Core's constrained layout centres every child with `margin-left:auto
   !important`. The design is flush left, so this has to answer in kind —
   the only !important in the theme, and only because core used one first. */
.wp-site-blocks .o365-prose > * {
	margin-left: 0 !important;
	margin-right: 0 !important;
}

/* Index hero — shorter than a guide hero; it introduces rather than immerses. */
.o365-guidehero--index {
	min-height: min(52vh, 30rem);
}

/* The gallery is the page. Highlights run larger than the full A–Z grid. */
.o365-guidegrid--feature {
	grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 48rem) {
	.o365-guidegrid--feature {
		grid-template-columns: repeat(3, 1fr);
	}
}
@media (min-width: 64rem) {
	.o365-guidegrid--feature {
		grid-template-columns: repeat(3, 1fr);
	}
	.o365-guidegrid--feature .o365-guidecard__name {
		font-size: var(--text-x-large);
	}
}
.o365-guidelist__label {
	padding-top: var(--space-lg);
	border-top: var(--hairline);
}

/* Featured guides carousel — overflow-x + scroll-snap, the same mechanics the
   design system's photo strip uses. No JavaScript, no plugin. */
.o365-guidegrid--carousel {
	display: flex;
	gap: var(--space-sm);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 0;
	padding-bottom: var(--space-xs);
	margin-block: var(--space-md) var(--space-xl);
	max-width: var(--wide-width);
	scrollbar-width: thin;
	scrollbar-color: var(--border-hairline) transparent;
	-webkit-overflow-scrolling: touch;
}
.o365-guidegrid--carousel > .o365-guidecard {
	flex: 0 0 78%;
	scroll-snap-align: start;
}
@media (min-width: 48rem) {
	.o365-guidegrid--carousel > .o365-guidecard {
		flex: 0 0 46%;
	}
}
@media (min-width: 64rem) {
	.o365-guidegrid--carousel > .o365-guidecard {
		flex: 0 0 31%;
	}
	.o365-guidegrid--carousel .o365-guidecard__name {
		font-size: var(--text-x-large);
	}
}
.o365-guidegrid--carousel:focus-visible {
	outline: 2px solid var(--focus-ring);
	outline-offset: 4px;
}
.o365-guidegrid--carousel::-webkit-scrollbar {
	height: 6px;
}
.o365-guidegrid--carousel::-webkit-scrollbar-thumb {
	background: var(--border-hairline);
	border-radius: var(--radius-pill);
}

/* A guide's own writing, now sitting under its entries. */
.o365-guide-notes {
	margin-top: var(--space-xl);
	padding-top: var(--space-md);
	border-top: var(--hairline);
	color: var(--text-secondary);
	font-size: var(--text-small);
}
.o365-guide-notes .o365-eyebrow {
	margin-bottom: var(--space-xs);
}
.o365-guide-notes > * + * {
	margin-top: var(--flow-paragraph);
}

/* ── Subscribe hero — the /sign-up/ page ─────────────────────────────────────
   The centred sibling of the guide hero, rebuilt from the Squarespace
   original: full-bleed photograph, narrow centred column, title and blurb
   over the image with the Substack card beneath. Two deliberate departures
   from the Squarespace source: the scrim is flat rather than bottom-weighted,
   because the content sits mid-frame rather than at the bottom edge; and it
   is heavier than Squarespace's 15% so the white type clears AA over bright
   sky. Focal point (45% 61%) is carried over from the original's
   mediaFocalPoint so the summit stays in frame as the crop narrows.
   ─────────────────────────────────────────────────────────────────────────── */
.o365-subhero {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	min-height: min(92vh, 52rem);
	background: var(--understory);
}
.o365-subhero .o365-subhero__bg {
	position: absolute;
	inset: 0;
	margin: 0;
}
.o365-subhero .o365-subhero__bg img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 45% 61%;
	border-radius: 0;
}
.o365-subhero::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(22, 32, 26, 0.46);
	pointer-events: none;
}
.o365-subhero .o365-subhero__inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-md);
	width: 100%;
	max-width: 46rem;
	margin-inline: auto;
	padding: var(--space-xl) var(--gutter);
	color: var(--i-text-primary);
	text-align: center;
}
.o365-subhero .o365-subhero__inner > * {
	margin-block: 0;
}
.o365-subhero__title {
	font-size: var(--text-display);
	font-weight: var(--weight-display);
	letter-spacing: var(--tracking-display);
	line-height: 0.98;
	color: var(--i-text-primary);
	max-width: 18ch;
}
.o365-subhero__body {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-md);
	width: 100%;
}
.o365-subhero__body > * {
	margin-block: 0;
}
.o365-subhero__body p {
	font-size: var(--text-large);
	line-height: var(--leading-snug);
	max-width: 54ch;
	text-align: left;
	color: var(--i-text-primary);
}
.o365-subhero__embed {
	width: 100%;
	max-width: 480px;
	border-radius: var(--radius-md);
	overflow: hidden;
	box-shadow: 0 18px 48px rgba(11, 17, 13, 0.42);
}
.o365-subhero__embed iframe {
	display: block;
	width: 100%;
	height: 320px;
	border: 0;
	background: #fff;
}
@media (max-width: 40rem) {
	.o365-subhero {
		min-height: 0;
	}
	.o365-subhero .o365-subhero__inner {
		padding-block: var(--space-lg);
		gap: var(--space-sm);
	}
	.o365-subhero__body p {
		font-size: 1.0625rem;
	}
}

/* The subscribe page already carries the call to action in its hero. Showing
   the footer band underneath it would be the same ask twice in one screen. */
.page-template-sign-up .o365-subscribe--band {
	display: none;
}
