/**
 * Wiscohana Story presentation layer, owned by the child theme.
 *
 * Foundation widths are supplied by native Gutenberg constrained-layout
 * attributes in Story content. Explicit media block styles add only the
 * portable width behavior selected by an editor.
 */

.wiscohana-story {
	/*
	 * Portable fallbacks keep Story semantics readable with any theme. A
	 * presentation layer may supply the same Wiscohana token names globally.
	 */
	--wiscohana-paper: var(--wiscohana-color-paper, #f8f5ee);
	--wiscohana-paper-deep: var(--wiscohana-color-paper-deep, #eee8dc);
	--wiscohana-paper-soft: var(--wiscohana-color-paper-soft, #f3eee5);
	--wiscohana-ink: var(--wiscohana-color-ink, #292724);
	--wiscohana-muted: var(--wiscohana-color-muted, #716b64);
	--wiscohana-rule: var(--wiscohana-color-rule, #d8d0c3);
	--wiscohana-rule-strong: var(--wiscohana-color-rule-strong, #c7bcad);
	--wiscohana-sand: var(--wiscohana-color-ink, #292724);
	--wiscohana-space-xs: clamp(0.5rem, 0.4rem + 0.3vw, 0.75rem);
	--wiscohana-space-s: clamp(0.875rem, 0.7rem + 0.5vw, 1.25rem);
	--wiscohana-space-m: clamp(1.5rem, 1.2rem + 0.8vw, 2.25rem);
	--wiscohana-space-l: clamp(3rem, 2.2rem + 2vw, 5rem);
	--wiscohana-font-body: var(--wiscohana-font-narrative, "Newsreader", Georgia, serif);
	--wiscohana-font-display: var(--wiscohana-font-editorial, "Newsreader", Georgia, serif);
	--wiscohana-font-ui: var(--wiscohana-font-interface, "Source Sans 3", system-ui, sans-serif);
	/* Tested prototype values; keep adjustable as additional portrait-led Stories migrate. */
	--wiscohana-portrait-standard-max: 40rem;
	--wiscohana-portrait-emphasis-max: 46.875rem;
	--wiscohana-supporting-image-max: 46.875rem;
	--wiscohana-wide-media-max: 73.75rem;
	padding-block-end: var(--wiscohana-space-l);
	background: var(--wiscohana-paper);
	color: var(--wiscohana-ink);
	font-family: var(--wiscohana-font-body);
	font-size: clamp(1.125rem, 1.05rem + 0.25vw, 1.25rem);
	line-height: 1.68;
}

.wiscohana-story > * + * {
	margin-block-start: var(--wiscohana-space-l);
}

.wiscohana-story .wiscohana-narrative > * + * {
	margin-block-start: var(--wiscohana-space-s);
}

.wiscohana-story :is(p, li) {
	font-family: inherit;
	line-height: inherit;
}

/* Neutralize legacy inline sizing while preserving semantic emphasis inside Story lists. */
.wiscohana-story .wp-block-list li > span {
	font-family: inherit;
	font-size: inherit !important;
	line-height: inherit;
}

.wiscohana-story .wp-block-heading:not(.wiscohana-feature-title) {
	margin-block-end: var(--wiscohana-space-s);
	color: var(--wiscohana-ink);
	font-family: var(--wiscohana-font-display);
	font-size: clamp(1.875rem, 1.65rem + 0.7vw, 2.25rem);
	font-weight: 600;
	letter-spacing: -0.025em;
	line-height: 1.14;
}

/* Preserve subsection hierarchy within longer, guide-like Story narratives. */
.wiscohana-story h3.wp-block-heading:not(.wiscohana-feature-title) {
	margin-block-start: var(--wiscohana-space-m);
	margin-block-end: var(--wiscohana-space-xs);
	font-size: clamp(1.4rem, 1.28rem + 0.45vw, 1.75rem);
	font-weight: 600;
	letter-spacing: -0.018em;
	line-height: 1.2;
}

/* A quiet fourth level supports nested practical or guide subsections. */
.wiscohana-story h4.wp-block-heading:not(.wiscohana-feature-title) {
	margin-block-start: var(--wiscohana-space-s);
	margin-block-end: var(--wiscohana-space-xs);
	font-size: clamp(1.15rem, 1.08rem + 0.25vw, 1.35rem);
	font-weight: 650;
	letter-spacing: -0.01em;
	line-height: 1.3;
}

.wiscohana-story :is(.wiscohana-story-introduction, .wiscohana-feature-opening, .wiscohana-immersive-introduction) {
	margin-block-start: 0;
}

.wiscohana-story .wp-block-cover:is(.is-style-wiscohana-story-opening, .wiscohana-immersive-introduction) {
	min-height: clamp(36rem, 82svh, 58rem);
	margin-block-start: 0;
}

.wiscohana-story :is(.is-style-wiscohana-story-opening, .wiscohana-immersive-introduction) .wp-block-cover__image-background {
	object-position: 50% 50%;
}

.wiscohana-story :is(.is-style-wiscohana-story-opening, .wiscohana-immersive-introduction) .wp-block-cover__background {
	background: linear-gradient(180deg, rgba(19, 23, 24, 0.05) 28%, rgba(19, 23, 24, 0.28) 62%, rgba(19, 23, 24, 0.78) 100%) !important;
	opacity: 1 !important;
}

.wiscohana-story :is(.is-style-wiscohana-story-opening, .wiscohana-immersive-introduction) .wp-block-cover__inner-container {
	display: flex;
	width: 100%;
	min-height: inherit;
	align-items: flex-end;
}

.wiscohana-story .wiscohana-opening-copy {
	width: 100%;
	padding: clamp(2rem, 5vw, 5rem) clamp(1.5rem, 5vw, 4.5rem) clamp(3rem, 8vh, 6rem);
	color: #fff;
	text-align: center;
}

.wiscohana-story .wiscohana-story-kicker {
	margin-block-start: 0;
	margin-block-end: var(--wiscohana-space-s);
	font-family: var(--wiscohana-font-ui);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	line-height: 1.3;
	text-transform: uppercase;
}

.wiscohana-story .wiscohana-feature-title {
	max-width: 21ch;
	margin: 0 auto;
	color: #fff;
	font-family: var(--wiscohana-font-display);
	font-size: clamp(2.25rem, 4vw, 4.25rem);
	font-weight: 600;
	letter-spacing: -0.045em;
	line-height: 0.98;
	text-wrap: balance;
}

/* Below-image introductions are independent of Cover and overlay-only classes. */
.wiscohana-story :is(.wiscohana-story-introduction--below-image, .wiscohana-story-introduction--editorial) {
	margin-block-start: 0;
}

.wiscohana-story :is(.wiscohana-story-introduction--below-image, .wiscohana-story-introduction--editorial) .wiscohana-story-introduction__image {
	margin-block: 0;
}

.wiscohana-story :is(.wiscohana-story-introduction--below-image, .wiscohana-story-introduction--editorial) .wiscohana-story-introduction__copy {
	padding-block: clamp(2.75rem, 6vw, 5.25rem);
	border-block-end: 1px solid var(--wiscohana-rule);
	background: var(--wiscohana-paper);
}

.wiscohana-story .wiscohana-story-introduction__copy-inner {
	width: min(750px, calc(100% - 3rem));
	margin-inline: auto;
}

.wiscohana-story :is(.wiscohana-story-introduction--below-image, .wiscohana-story-introduction--editorial) .wiscohana-story-kicker {
	margin-block-end: var(--wiscohana-space-s);
	color: var(--wiscohana-muted);
}

.wiscohana-story :is(.wiscohana-story-introduction--below-image, .wiscohana-story-introduction--editorial) .wiscohana-story-introduction__title {
	max-width: 18ch;
	margin: 0;
	color: var(--wiscohana-ink);
	font-family: var(--wiscohana-font-display);
	font-size: clamp(2.75rem, 4.8vw, 4.75rem);
	font-weight: 600;
	letter-spacing: -0.045em;
	line-height: 0.98;
	text-wrap: balance;
}

.wiscohana-story .wiscohana-prototype-label {
	display: block;
	margin-block-end: var(--wiscohana-space-s);
	font-family: var(--wiscohana-font-ui);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	line-height: 1.3;
	text-transform: uppercase;
}

.wiscohana-story .wiscohana-feature-opening + .wiscohana-feature-intro {
	margin-block-start: 0;
}

.wiscohana-story .wiscohana-feature-intro {
	padding-block: clamp(2.75rem, 6vw, 5.25rem);
	border-block-end: 1px solid var(--wiscohana-rule);
	background: var(--wiscohana-paper);
}

.wiscohana-story .wiscohana-feature-byline {
	margin-block-end: var(--wiscohana-space-m);
	color: var(--wiscohana-muted);
	font-family: var(--wiscohana-font-ui);
	font-size: 0.8125rem;
	font-weight: 650;
	letter-spacing: 0.08em;
	line-height: 1.4;
	text-transform: uppercase;
}

.wiscohana-story .wiscohana-feature-byline::after {
	display: block;
	width: 3rem;
	margin-block-start: var(--wiscohana-space-m);
	border-block-end: 2px solid var(--wiscohana-sand);
	content: "";
}

/* The opening uses the same byline content role with a light hero treatment. */
.wiscohana-story .wiscohana-opening-copy .wiscohana-feature-byline {
	margin-block-start: var(--wiscohana-space-s);
	margin-block-end: 0;
	color: rgba(255, 255, 255, 0.9);
	text-align: center;
}

.wiscohana-story .wiscohana-opening-copy .wiscohana-feature-byline::after {
	display: none;
}

.wiscohana-story .wiscohana-story-deck {
	margin: 0;
	color: var(--wiscohana-ink);
	font-family: var(--wiscohana-font-display);
	font-size: clamp(1.25rem, 1.12rem + 0.4vw, 1.5rem);
	font-weight: 600;
	letter-spacing: -0.015em;
	line-height: 1.42;
}

/* Overlay introductions keep the complete semantic opening together on-image. */
.wiscohana-story .wiscohana-story-introduction--overlay .wiscohana-opening-copy .wiscohana-story-deck {
	max-width: 38ch;
	margin-block-start: var(--wiscohana-space-s);
	margin-inline: auto;
	color: rgba(255, 255, 255, 0.94);
	font-size: clamp(1.1875rem, 1.02rem + 0.55vw, 1.5rem);
	font-weight: 500;
	line-height: 1.42;
	text-align: center;
	text-wrap: balance;
}

.wiscohana-story :is(.wiscohana-story-introduction--below-image, .wiscohana-story-introduction--editorial) .wiscohana-story-deck {
	max-width: 40ch;
	margin-block-start: var(--wiscohana-space-m);
	font-size: clamp(1.25rem, 1.08rem + 0.55vw, 1.625rem);
	font-weight: 500;
	line-height: 1.45;
}

.wiscohana-story :is(.wiscohana-story-introduction--below-image, .wiscohana-story-introduction--editorial) .wiscohana-feature-byline {
	margin-block-start: var(--wiscohana-space-m);
	margin-block-end: 0;
}

.wiscohana-story :is(.wiscohana-story-kicker, .wiscohana-story-deck, .wiscohana-feature-byline):empty {
	display: none;
}

/* Core-owned publication meaning, rendered only by the child theme. */
.wiscohana-publication-meta,
.wiscohana-story-trust {
	width: min(calc(100% - (2 * var(--wiscohana-edge))), var(--wiscohana-width-prose, 46rem));
	margin-inline: auto;
}

.wiscohana-publication-meta {
	padding-block: var(--wiscohana-space-5, 1.5rem);
	border-block-end: 1px solid var(--wiscohana-color-rule, #d8d0c3);
	color: var(--wiscohana-color-muted, #716b64);
	font-family: var(--wiscohana-font-interface, "Source Sans 3", system-ui, sans-serif);
	font-size: .875rem;
	line-height: 1.5;
}

.wiscohana-publication-meta p { margin: 0; }
.wiscohana-publication-context { margin-block-start: .35rem !important; }
.wiscohana-story-type { font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }

.wiscohana-story-trust {
	display: grid;
	gap: var(--wiscohana-space-3, .75rem);
	margin-block: var(--wiscohana-space-7, 3rem);
	padding: var(--wiscohana-space-5, 1.5rem);
	border-inline-start: 3px solid var(--wiscohana-color-ink, #292724);
	background: var(--wiscohana-color-paper-deep, #eee8dc);
}

.wiscohana-trust-item h2 {
	margin: 0 0 .25rem;
	font-family: var(--wiscohana-font-interface, "Source Sans 3", system-ui, sans-serif);
	font-size: .875rem;
	letter-spacing: .08em;
	line-height: 1.3;
	text-transform: uppercase;
}
.wiscohana-trust-item p { margin: 0; }

.wiscohana-related-stories {
	width: 100vw;
	max-width: 100vw;
	margin-block: clamp(3rem, 7vw, 6rem) 0;
	margin-inline: calc(50% - 50vw);
	background: #181818;
}

.wiscohana-related-stories__heading {
	display: grid;
	min-height: 0;
	place-items: center;
	padding: 4rem var(--wiscohana-edge, 1.5rem);
	color: #fff;
	text-align: center;
}

.wiscohana-related-stories__heading h2 {
	margin: 0;
	color: inherit;
	font-family: var(--wiscohana-font-editorial, "Newsreader", Georgia, serif);
	font-size: 3rem;
	font-weight: 500;
	letter-spacing: -0.03em;
	line-height: 1.2;
}

.wiscohana-related-stories ol {
	background: #fff;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	padding: 0;
	margin: 0;
	list-style: none;
}

.wiscohana-related-stories[data-card-count="1"] ol { grid-template-columns: 1fr; }
.wiscohana-related-stories[data-card-count="2"] ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 47.999rem) {
 .wiscohana-related-stories__heading { padding-block:2rem; }
 .wiscohana-related-stories__heading h2 { font-size:2.25rem; }
 .wiscohana-related-stories[data-card-count] ol, .wiscohana-related-stories ol { grid-template-columns:1fr; }
}

.wiscohana-enhanced-immersion .wiscohana-story-introduction--immersive .wp-block-cover,
.wiscohana-enhanced-immersion .wiscohana-immersive-introduction .wp-block-cover {
	min-height: min(92svh, 56rem);
}

.wiscohana-story .wp-block-group.is-style-wiscohana-facts-information,
.wiscohana-story .wp-block-group.is-style-wiscohana-trail-facts,
.wiscohana-story .wp-block-group.wiscohana-context-information,
.wiscohana-story .wp-block-group.is-style-wiscohana-quick-tips {
	padding: clamp(1.35rem, 2.5vw, 2rem);
	font-family: var(--wiscohana-font-ui);
	font-size: 0.9375rem;
	line-height: 1.52;
}

.wiscohana-story .wp-block-group.is-style-wiscohana-facts-information,
.wiscohana-story .wp-block-group.is-style-wiscohana-trail-facts,
.wiscohana-story .wp-block-group.wiscohana-context-information {
	border-block: 1px solid var(--wiscohana-rule-strong);
	background: var(--wiscohana-paper-deep);
}

.wiscohana-story :is(.is-style-wiscohana-facts-information, .is-style-wiscohana-trail-facts, .wiscohana-context-information, .is-style-wiscohana-quick-tips) > .wp-block-heading {
	margin-block-end: var(--wiscohana-space-m);
	font-family: var(--wiscohana-font-ui);
	font-size: 1rem;
	font-weight: 750;
	letter-spacing: 0.1em;
	line-height: 1.3;
	text-transform: uppercase;
}

.wiscohana-story :is(.is-style-wiscohana-facts-information, .is-style-wiscohana-trail-facts, .wiscohana-context-information) > ul {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--wiscohana-space-m);
	padding: 0;
	margin-block-end: 0;
	list-style: none;
}

.wiscohana-story :is(.is-style-wiscohana-facts-information, .is-style-wiscohana-trail-facts, .wiscohana-context-information) > ul > li {
	margin: 0;
}

.wiscohana-story :is(.is-style-wiscohana-facts-information, .is-style-wiscohana-trail-facts, .wiscohana-context-information) > ul > li:last-child {
	grid-column: 1 / -1;
	padding-block-start: var(--wiscohana-space-s);
	border-block-start: 1px solid var(--wiscohana-rule);
}

.wiscohana-story :is(.is-style-wiscohana-facts-information, .is-style-wiscohana-trail-facts, .wiscohana-context-information) li > strong {
	display: block;
	margin-block-end: 0.15rem;
	color: var(--wiscohana-muted);
	font-size: 0.75rem;
	letter-spacing: 0.07em;
	text-transform: uppercase;
}

.wiscohana-story .wp-block-group.is-style-wiscohana-quick-tips {
	padding: clamp(1.1rem, 2vw, 1.65rem);
	border-block: 1px solid var(--wiscohana-rule);
	background: var(--wiscohana-paper-soft);
	font-size: 0.9rem;
}

.wiscohana-story .is-style-wiscohana-quick-tips > .wp-block-heading {
	margin-block-end: var(--wiscohana-space-s);
}

.wiscohana-story .is-style-wiscohana-quick-tips > .wp-block-heading::before {
	display: inline-block;
	width: 2.25rem;
	margin-inline-end: 0.75rem;
	border-block-start: 2px solid var(--wiscohana-sand);
	content: "";
	transform: translateY(-0.2em);
}

.wiscohana-story .is-style-wiscohana-quick-tips > ul:last-child {
	padding-inline-start: 1.15rem;
	margin-block-start: 0;
	margin-block-end: 0;
}

/* Add a restrained, reusable section-start buffer without affecting panels. */
.wiscohana-story .wiscohana-narrative:not(.is-style-wiscohana-facts-information):not(.is-style-wiscohana-trail-facts):not(.is-style-wiscohana-quick-tips) > .wp-block-heading:first-child {
	padding-block-start: var(--wiscohana-space-s);
}

.wiscohana-story .wiscohana-feature-section {
	padding-block-start: clamp(1.75rem, 3vw, 3rem);
}

.wiscohana-story .wiscohana-feature-section::before {
	display: block;
	width: 4rem;
	margin-block-end: var(--wiscohana-space-m);
	border-block-start: 2px solid var(--wiscohana-sand);
	content: "";
}

.wiscohana-story .wiscohana-feature-section__lead > * + *,
.wiscohana-story .wiscohana-feature-section__narrative > * + * {
	margin-block-start: var(--wiscohana-space-s);
}

.wiscohana-story .wiscohana-feature-section__lead > .wp-block-heading {
	max-width: 20ch;
	margin-block-end: var(--wiscohana-space-s);
	font-size: clamp(2.25rem, 1.85rem + 1.35vw, 3.25rem);
	line-height: 1.04;
	text-wrap: balance;
}

.wiscohana-story .wiscohana-feature-lede {
	max-width: 42ch;
	margin-block-end: 0;
	color: var(--wiscohana-ink);
	font-family: var(--wiscohana-font-display);
	font-size: clamp(1.25rem, 1.08rem + 0.55vw, 1.625rem);
	font-weight: 500;
	letter-spacing: -0.012em;
	line-height: 1.48;
}

/* Opening ledes use the approved Narrows measure and display typography.
 * A direct-child lede distinguishes this role from the nested section lead
 * used by the Feature Section pattern; those leads retain the style above.
 * Existing provenance and reading-system rules own the boundary spacing. */
.wiscohana-story > .wiscohana-feature-section:has(> .wiscohana-feature-lede) {
	width: min(calc(100% - 2 * clamp(1.25rem, 3.3vw, 3rem)), 54rem);
	max-width: 54rem;
	margin-inline: auto;
}

.wiscohana-story > .wiscohana-feature-section > .wiscohana-feature-lede {
	max-width: none;
	margin: 0;
	font-size: 2rem;
	font-weight: 600;
	letter-spacing: -0.015em;
	line-height: 1.4;
}

.wiscohana-story > .wiscohana-feature-section > .wiscohana-feature-lede strong {
	font-weight: inherit;
}

@media (max-width: 48rem) {
	.wiscohana-story > .wiscohana-feature-section > .wiscohana-feature-lede {
		font-size: 1.625rem;
	}
}

.wiscohana-story .wiscohana-feature-anchor {
	margin-block: clamp(2.25rem, 5vw, 4.5rem);
}

/* Quotations remain available as optional Core blocks, not required pattern content. */
.wiscohana-story .wiscohana-feature-section > .wp-block-quote,
.wiscohana-story .wiscohana-feature-section__narrative > .wp-block-quote {
	padding-inline-start: var(--wiscohana-space-m);
	margin-block: var(--wiscohana-space-m);
	border-inline-start: 2px solid var(--wiscohana-sand);
	color: var(--wiscohana-muted);
	font-size: clamp(1.25rem, 1.12rem + 0.4vw, 1.5rem);
}

.wiscohana-story .wiscohana-story-closing {
	padding-block: var(--wiscohana-space-m);
}

.wiscohana-story .wiscohana-story-closing__rule {
	width: 3rem;
	margin-inline: 0;
	margin-block-end: var(--wiscohana-space-m);
	border-block-start: 2px solid var(--wiscohana-sand);
}

.wiscohana-story .wiscohana-related-story-reference {
	padding-block: var(--wiscohana-space-m);
	border-block: 1px solid var(--wiscohana-rule);
}

.wiscohana-story .wiscohana-related-story-reference > * + * {
	margin-block-start: var(--wiscohana-space-xs);
}

.wiscohana-story .wiscohana-related-story-reference__label {
	margin: 0;
	color: var(--wiscohana-muted);
	font-family: var(--wiscohana-font-ui);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	line-height: 1.3;
	text-transform: uppercase;
}

.wiscohana-story .wiscohana-related-story-reference > .wp-block-heading {
	margin-block: 0;
	font-size: clamp(1.4rem, 1.28rem + 0.45vw, 1.75rem);
}

.wiscohana-story .wp-block-gallery:is(.wiscohana-photo-sequence, .wiscohana-media-sequence) {
	--wiscohana-photo-sequence-gap: clamp(0.75rem, 1vw, 1rem);
	align-items: flex-start;
	gap: var(--wiscohana-photo-sequence-gap);
}

/* Portraits retain their natural ratio on a consistent, centered media rail. */
.wiscohana-story .wp-block-image:is(.is-style-wiscohana-portrait-vertical, .is-style-wiscohana-intimate-portrait-media) {
	width: min(calc(100% - 3rem), var(--wiscohana-portrait-standard-max));
	max-width: var(--wiscohana-portrait-standard-max);
	margin-inline: auto;
}

.wiscohana-story .wp-block-image:is(.is-style-wiscohana-portrait-emphasis, .is-style-wiscohana-emphasized-media) {
	width: min(calc(100% - 3rem), var(--wiscohana-portrait-emphasis-max));
	max-width: var(--wiscohana-portrait-emphasis-max);
	margin-inline: auto;
}

/* A wide media rail expands beyond prose while retaining editorial page edges. */
.wiscohana-story :is(.wp-block-image, .wp-block-gallery):is(.is-style-wiscohana-wide-media-rail, .is-style-wiscohana-wide-media) {
	width: min(calc(100vw - 3rem), var(--wiscohana-wide-media-max));
	max-width: none;
	margin-inline: calc((100% - min(calc(100vw - 3rem), var(--wiscohana-wide-media-max))) / 2);
}

/* Full bleed is an explicit editor choice and remains scoped to Story images. */
.wiscohana-story .wp-block-image:is(.is-style-wiscohana-full-bleed, .is-style-wiscohana-full-bleed-media) {
	width: 100vw;
	max-width: 100vw;
	margin-inline: calc(50% - 50vw);
}

.wiscohana-story .wp-block-image:is(.is-style-wiscohana-supporting-image, .is-style-wiscohana-supporting-media) {
	width: min(100%, var(--wiscohana-supporting-image-max));
	max-width: var(--wiscohana-supporting-image-max);
	margin-inline: auto;
}

.wiscohana-story .wp-block-image:is(.is-style-wiscohana-portrait-vertical, .is-style-wiscohana-intimate-portrait-media, .is-style-wiscohana-portrait-emphasis, .is-style-wiscohana-emphasized-media, .is-style-wiscohana-wide-media-rail, .is-style-wiscohana-wide-media, .is-style-wiscohana-full-bleed, .is-style-wiscohana-full-bleed-media, .is-style-wiscohana-supporting-image, .is-style-wiscohana-supporting-media) :is(a, img) {
	display: block;
	width: 100%;
}

.wiscohana-story .wp-block-image:is(.is-style-wiscohana-portrait-vertical, .is-style-wiscohana-intimate-portrait-media, .is-style-wiscohana-portrait-emphasis, .is-style-wiscohana-emphasized-media, .is-style-wiscohana-wide-media-rail, .is-style-wiscohana-wide-media, .is-style-wiscohana-full-bleed, .is-style-wiscohana-full-bleed-media, .is-style-wiscohana-supporting-image, .is-style-wiscohana-supporting-media) img {
	height: auto;
	object-fit: contain;
}

.wiscohana-story .wp-block-gallery:is(.wiscohana-photo-sequence, .wiscohana-media-sequence) > .wp-block-image {
	margin: 0;
	background: transparent;
}

/* Keep any framing color with the photograph instead of extending it behind captions. */
.wiscohana-story .wp-block-gallery:is(.wiscohana-photo-sequence, .wiscohana-media-sequence) > .wp-block-image > :is(a, img) {
	background: var(--wiscohana-paper-deep);
}

.wiscohana-story .wp-block-gallery:is(.wiscohana-photo-sequence, .wiscohana-media-sequence) > .wp-block-image img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: contain;
}

/* Cropping is an explicit, reversible presentation choice, never the sequence default. */
.wiscohana-story .wp-block-gallery:is(.wiscohana-photo-sequence, .wiscohana-media-sequence).is-style-wiscohana-intentional-crop {
	--wiscohana-balanced-sequence-ratio: 4 / 3;
	align-items: flex-start;
}

.wiscohana-story .wp-block-gallery:is(.wiscohana-photo-sequence, .wiscohana-media-sequence).is-style-wiscohana-intentional-crop > .wp-block-image {
	align-self: flex-start;
}

.wiscohana-story .wp-block-gallery:is(.wiscohana-photo-sequence, .wiscohana-media-sequence).is-style-wiscohana-intentional-crop > .wp-block-image > a {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--wiscohana-balanced-sequence-ratio);
	overflow: hidden;
}

.wiscohana-story .wp-block-gallery:is(.wiscohana-photo-sequence, .wiscohana-media-sequence).is-style-wiscohana-intentional-crop > .wp-block-image > img {
	height: auto;
	aspect-ratio: var(--wiscohana-balanced-sequence-ratio);
	object-fit: cover;
}

.wiscohana-story .wp-block-gallery:is(.wiscohana-photo-sequence, .wiscohana-media-sequence).is-style-wiscohana-intentional-crop > .wp-block-image > a > img {
	height: 100%;
	object-fit: cover;
}

.wiscohana-story figcaption {
	max-width: 750px;
	margin-block-start: var(--wiscohana-space-xs);
	margin-inline: auto;
	color: var(--wiscohana-muted);
	font-family: var(--wiscohana-font-ui);
	font-size: 0.8125rem;
	line-height: 1.45;
}

.wiscohana-story :is(.wp-block-image, .wp-block-gallery).is-style-wiscohana-caption figcaption {
	color: var(--wiscohana-muted);
	font-family: var(--wiscohana-font-ui);
	font-size: 0.8125rem;
	font-weight: 400;
	letter-spacing: 0.01em;
	line-height: 1.45;
	text-align: start;
}

/* Sequence-level credit is an explicit exception, visually distinct from captions. */
.wiscohana-story .wp-block-paragraph.is-style-wiscohana-media-credit,
.wiscohana-story p.is-style-wiscohana-media-credit {
	max-width: 750px;
	margin-block-start: var(--wiscohana-space-xs);
	margin-inline: auto;
	color: var(--wiscohana-muted);
	font-family: var(--wiscohana-font-ui);
	font-size: 0.75rem;
	font-style: normal;
	letter-spacing: 0.04em;
	line-height: 1.45;
}

/* Override theme caption defaults so single and per-image captions use the shared token. */
.wiscohana-story .wp-block-image > figcaption {
	margin-block-start: var(--wiscohana-space-xs);
}

/* Per-image captions stay with and align to their individual photographs. */
.wiscohana-story .wp-block-gallery:is(.wiscohana-photo-sequence, .wiscohana-media-sequence) > .wp-block-image > figcaption {
	position: static;
	width: 100%;
	max-width: none;
	max-height: none;
	padding: 0;
	margin: var(--wiscohana-space-xs) 0 0;
	background: none;
	color: var(--wiscohana-muted);
	font-weight: 400;
	text-shadow: none;
	text-align: start;
}

/* A direct gallery caption describes the complete diptych or sequence. */
.wiscohana-story .wp-block-gallery:is(.wiscohana-photo-sequence, .wiscohana-media-sequence) > figcaption.blocks-gallery-caption {
	width: 100%;
	max-width: 750px;
	flex-basis: 100%;
	margin: calc(var(--wiscohana-space-xs) - var(--wiscohana-photo-sequence-gap)) auto 0;
	text-align: center;
}

@media (max-width: 700px) {
	.wiscohana-story {
		--wiscohana-space-l: clamp(2.75rem, 12vw, 3.75rem);
		font-size: 1.125rem;
		line-height: 1.66;
	}

	.wiscohana-story .wp-block-cover:is(.is-style-wiscohana-story-opening, .wiscohana-immersive-introduction) {
		min-height: min(44rem, 82svh);
	}

	.wiscohana-story .wiscohana-opening-copy {
		padding-inline: 1.5rem;
		padding-block-end: clamp(2.5rem, 8vh, 4.5rem);
	}

	.wiscohana-story .wiscohana-feature-title {
		max-width: 16ch;
		font-size: clamp(2.1rem, 9.5vw, 2.75rem);
		line-height: 1;
	}

	.wiscohana-story :is(.wiscohana-story-introduction--below-image, .wiscohana-story-introduction--editorial) .wiscohana-story-introduction__copy {
		padding-block: clamp(2.25rem, 10vw, 3.5rem);
	}

	.wiscohana-story .wp-block-heading:not(.wiscohana-feature-title) {
		font-size: clamp(1.65rem, 7vw, 1.9rem);
		line-height: 1.13;
	}

	.wiscohana-story h3.wp-block-heading:not(.wiscohana-feature-title) {
		font-size: clamp(1.35rem, 5.8vw, 1.6rem);
		line-height: 1.2;
	}

	.wiscohana-story h4.wp-block-heading:not(.wiscohana-feature-title) {
		font-size: clamp(1.15rem, 5vw, 1.35rem);
		line-height: 1.28;
	}

	.wiscohana-story :is(.wiscohana-story-introduction--below-image, .wiscohana-story-introduction--editorial) .wiscohana-story-introduction__title {
		max-width: 16ch;
		font-size: clamp(2.35rem, 11vw, 3.15rem);
		line-height: 1;
	}

	.wiscohana-story .wiscohana-feature-section__lead > .wp-block-heading {
		font-size: clamp(2rem, 9vw, 2.65rem);
		line-height: 1.06;
	}

	.wiscohana-story :is(.is-style-wiscohana-facts-information, .is-style-wiscohana-trail-facts, .wiscohana-context-information, .is-style-wiscohana-quick-tips) > .wp-block-heading {
		font-size: 0.9375rem;
		line-height: 1.3;
	}

	.wiscohana-story .wiscohana-story-deck {
		font-size: clamp(1.1875rem, 5vw, 1.375rem);
		line-height: 1.48;
	}

	.wiscohana-story :is(.is-style-wiscohana-facts-information, .is-style-wiscohana-trail-facts, .wiscohana-context-information) > ul {
		grid-template-columns: 1fr 1fr;
		gap: var(--wiscohana-space-s);
	}

	.wiscohana-story .wp-block-gallery:is(.wiscohana-photo-sequence, .wiscohana-media-sequence) > .wp-block-image {
		width: calc(50% - 0.5rem) !important;
		flex-basis: calc(50% - 0.5rem) !important;
	}

	.wiscohana-story :is(.wp-block-image, .wp-block-gallery):is(.is-style-wiscohana-wide-media-rail, .is-style-wiscohana-wide-media) {
		width: calc(100vw - 2rem);
		margin-inline: calc((100% - (100vw - 2rem)) / 2);
	}

	.wiscohana-story .wp-block-gallery.wiscohana-photo-sequence-five > .wp-block-image:last-of-type {
		width: 100% !important;
		flex-basis: 100% !important;
	}

	/* A final full-width image has no row partner to balance, so retain its natural ratio. */
	.wiscohana-story .wp-block-gallery.wiscohana-photo-sequence-five.is-style-wiscohana-intentional-crop > .wp-block-image:last-of-type > a {
		height: auto;
		aspect-ratio: auto;
		overflow: visible;
	}

	.wiscohana-story .wp-block-gallery.wiscohana-photo-sequence-five.is-style-wiscohana-intentional-crop > .wp-block-image:last-of-type img {
		height: auto;
		aspect-ratio: attr(width type(<number>)) / attr(height type(<number>));
		contain: none !important;
		contain-intrinsic-size: none;
		object-fit: contain;
	}
}

@media (max-width: 600px) {
	/* Preserve sequence order and caption readability instead of forcing a diptych. */
	.wiscohana-story .wp-block-gallery:is(.wiscohana-photo-sequence, .wiscohana-media-sequence) > .wp-block-image {
		width: 100% !important;
		flex-basis: 100% !important;
	}
}

@media (max-width: 420px) {
	.wiscohana-story :is(.is-style-wiscohana-facts-information, .is-style-wiscohana-trail-facts, .wiscohana-context-information) > ul {
		grid-template-columns: 1fr;
	}

	.wiscohana-story :is(.is-style-wiscohana-facts-information, .is-style-wiscohana-trail-facts, .wiscohana-context-information) > ul > li:last-child {
		grid-column: auto;
	}
}
