/* MAHAMU Our Story v6.1 - Grid & Whitespace v1.1 reference
 * Gutenberg owns page content. This stylesheet owns only the scoped editorial
 * composition and consumes the canonical Visual System v3 semantic tokens.
 */

.mahamu-story-v4 {
	color: var(--wp--custom--color--text--primary);
	background: var(--wp--custom--color--surface--canvas);
}

.mahamu-story-v4 :where(h1, h2, h3, p, figure) {
	margin-block-start: 0;
}

.mahamu-story-v4 :where(h1, h2, h3) {
	font-family: var(--wp--custom--font--family--ui);
	font-weight: var(--wp--custom--font--weight--medium);
	letter-spacing: 0;
	text-wrap: balance;
}

.mahamu-story-v4 p {
	font-family: var(--wp--custom--font--family--ui);
	font-weight: var(--wp--custom--font--weight--regular);
	line-height: 1.72;
	text-wrap: pretty;
}

/* The shared layout foundation asset owns section gutters, frame width,
 * the 12/8/4 master grid and frame-aligned dividers. This file owns only
 * Our Story composition within that system.
 */

.mahamu-story-origin,
.mahamu-story-learning,
.mahamu-story-cicada,
.mahamu-story-today {
	scroll-margin-top: 96px;
}

.mahamu-story-kicker,
.mahamu-story-chapter,
.mahamu-story-caption,
.mahamu-story-index__label,
.mahamu-story-index__item {
	font-family: var(--wp--custom--font--family--ui);
	font-weight: var(--wp--custom--font--weight--medium);
	text-transform: uppercase;
}

.mahamu-story-kicker,
.mahamu-story-chapter,
.mahamu-story-index__label {
	font-size: 12px;
	line-height: 1.4;
	letter-spacing: .1em;
	color: var(--wp--custom--color--text--secondary);
}

.mahamu-story-title {
	max-width: 22ch;
	margin-bottom: var(--wp--custom--space--lg);
	font-size: clamp(2.35rem, 4vw, 3.6rem);
	line-height: 1.1;
}

.mahamu-story-heading {
	margin-bottom: var(--wp--custom--space--lg);
	font-size: clamp(1.8rem, 2.8vw, 2.65rem);
	line-height: 1.15;
}

.mahamu-story-lead {
	max-width: 58ch;
	margin-bottom: var(--wp--custom--space--lg);
	font-size: clamp(1.08rem, 1.02rem + .24vw, 1.3rem);
	line-height: 1.68;
	color: var(--wp--custom--color--text--secondary);
}

.mahamu-story-copy {
	max-width: 62ch;
	font-size: clamp(1rem, .98rem + .08vw, 1.075rem);
}

.mahamu-story-copy + .mahamu-story-copy {
	margin-top: var(--wp--custom--space--md);
}

.mahamu-story-english {
	max-width: 48ch;
	margin: 0;
	font-size: .95rem;
	line-height: 1.55;
	color: var(--wp--custom--color--text--secondary);
}

.mahamu-story-pull {
	max-width: 28ch;
	margin: var(--wp--custom--space--xl) 0 0;
	padding-top: var(--wp--custom--space--lg);
	border-top: 1px solid var(--wp--custom--color--border--strong);
	font-size: clamp(1.35rem, 2vw, 1.8rem);
	font-weight: var(--wp--custom--font--weight--medium);
	line-height: 1.3;
}

.mahamu-story-figure {
	margin: 0;
}

.mahamu-story-figure img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mahamu-story-caption {
	margin-top: var(--wp--custom--space--sm);
	font-size: 11px;
	line-height: 1.5;
	letter-spacing: .08em;
	color: var(--wp--custom--color--text--secondary);
}

/* Hero: content-height, not viewport-height. Negative space comes from the
 * shared major-section rhythm rather than an arbitrary minimum height. */
.mahamu-story-hero__grid {
	align-items: start;
	min-height: 0;
}

.mahamu-story-hero__copy {
	align-self: start;
}

.mahamu-story-hero__copy .mahamu-story-kicker {
	margin-bottom: var(--wp--custom--space--lg);
}

.mahamu-story-hero__index {
	align-self: start;
	padding-top: 0;
	border-top: 0;
}

.mahamu-story-index__label {
	margin-bottom: var(--wp--custom--space--md);
}

.mahamu-story-index__item {
	margin: 0;
	border-top: 1px solid var(--wp--custom--color--border--soft);
	font-size: 12px;
	line-height: 1.4;
	letter-spacing: .06em;
	color: var(--wp--custom--color--text--primary);
}

.mahamu-story-index__item > a {
	display: grid;
	grid-template-columns: 2.5rem 1fr;
	gap: var(--wp--custom--space--sm);
	align-items: center;
	min-height: 44px;
	padding-block: var(--wp--custom--space--sm);
	color: inherit;
	text-decoration: none;
}

.mahamu-story-index__item > a:hover {
	color: var(--wp--custom--color--action--primary);
}

.mahamu-story-index__item > a:focus-visible {
	outline: 2px solid var(--wp--custom--color--accent--focus);
	outline-offset: 3px;
}

.mahamu-story-index__item:last-child {
	border-bottom: 1px solid var(--wp--custom--color--border--soft);
}

/* Origin and learning use the shared chapter pattern; this stylesheet owns only story typography. */

/* Cicada is documentary evidence, deliberately bounded rather than a visual
 * climax so legacy presentation is not mistaken for the current brand system. */
.mahamu-story-cicada__visual {
	grid-row: 1 / span 2;
	align-self: start;
}

.mahamu-story-cicada__visual .mahamu-story-figure {
	aspect-ratio: 4 / 3;
}

.mahamu-story-cicada__head {
	grid-row: 1;
	align-self: start;
}

.mahamu-story-cicada__body {
	grid-row: 2;
}

.mahamu-story-community {
	margin-top: var(--wp--custom--space--xxl);
}

.mahamu-story-community__intro {
	align-self: start;
}

.mahamu-story-community__intro .mahamu-story-heading {
	margin-bottom: var(--wp--custom--space--md);
	font-size: clamp(1.45rem, 2vw, 1.9rem);
}

.mahamu-story-community__gallery {
	display: grid;
	grid-template-columns: repeat(9, minmax(0, 1fr));
	gap: var(--wp--custom--space--lg);
	align-items: start;
}

.mahamu-story-community__figure:first-child {
	grid-column: 1 / span 5;
}

.mahamu-story-community__figure:nth-child(2) {
	grid-column: 6 / span 4;
}

.mahamu-story-community__figure {
	margin: 0;
}

.mahamu-story-community__figure img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: contain;
}

.mahamu-story-community__caption {
	margin: 0;
}

/* Today closes on people and continuity rather than a generic brand manifesto. */
.mahamu-story-today__copy,
.mahamu-story-today__visual {
	align-self: center;
}

.mahamu-story-today__visual .mahamu-story-figure {
	aspect-ratio: 4 / 3;
}

.mahamu-story-today__closing {
	margin-top: var(--wp--custom--space--xl);
}

.mahamu-story-actions {
	margin-top: var(--wp--custom--space--xl);
}

.mahamu-story-cta .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	min-height: var(--wp--custom--size--control-min-height);
	padding: var(--wp--custom--space--control-y) var(--wp--custom--space--control-x);
	font-family: var(--wp--custom--font--family--ui);
	font-size: 15px;
	font-weight: var(--wp--custom--font--weight--medium);
	line-height: 1.2;
	color: var(--wp--custom--color--action--primary);
	background: transparent;
	border: 1px solid var(--wp--custom--color--action--primary);
	border-radius: var(--wp--custom--radius--control);
	box-shadow: none;
	text-decoration: none;
}

.mahamu-story-cta .wp-block-button__link:hover {
	color: var(--wp--custom--color--text--on-action);
	background: var(--wp--custom--color--action--primary-hover);
	border-color: var(--wp--custom--color--action--primary-hover);
}

.mahamu-story-cta .wp-block-button__link:focus-visible {
	outline: 2px solid var(--wp--custom--color--accent--focus);
	outline-offset: 4px;
}

@media (max-width: 1024px) {
	.mahamu-story-community__gallery {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.mahamu-story-community__figure:first-child,
	.mahamu-story-community__figure:nth-child(2) {
		grid-column: auto;
	}

}

@media (max-width: 640px) {
	.mahamu-story-title {
		max-width: 100%;
		font-size: clamp(2.05rem, 9.5vw, 2.5rem);
		line-height: 1.14;
	}

	.mahamu-story-heading {
		margin-bottom: var(--wp--custom--space--md);
		font-size: clamp(1.6rem, 7vw, 1.95rem);
		line-height: 1.2;
	}

	.mahamu-story-lead,
	.mahamu-story-copy {
		font-size: 1rem;
		line-height: 1.72;
	}

	.mahamu-story-hero__grid {
		row-gap: var(--wp--custom--space--xl);
	}

	.mahamu-story-learning__pull {
		margin-top: var(--wp--custom--space--md);
	}

	.mahamu-story-cicada__visual,
	.mahamu-story-cicada__head,
	.mahamu-story-cicada__body {
		grid-row: auto;
	}

	.mahamu-story-community {
		margin-top: var(--wp--custom--space--xl);
		padding-top: var(--wp--custom--space--lg);
	}

	.mahamu-story-community__gallery {
		grid-template-columns: 1fr;
		gap: var(--wp--custom--space--lg);
	}

	.mahamu-story-community__caption {
		margin-top: 0;
	}

	.mahamu-story-cicada__visual .mahamu-story-figure,
	.mahamu-story-today__visual .mahamu-story-figure {
		aspect-ratio: 4 / 3;
	}

	.mahamu-story-today__closing {
		margin-top: var(--wp--custom--space--lg);
	}
}


/* Deployment compatibility: preserve the merged v6 About layout when source is
 * deployed before its Gutenberg markup adopts .mahamu-layout-flow. This block
 * becomes inert immediately after the v1.1 content migration. */
.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-hero__copy {
	grid-column: 1 / span 7;
}

.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-hero__index {
	grid-column: 10 / -1;
}

.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-origin__head,
.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-learning__head {
	grid-column: 1 / span 3;
}

.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-origin__body,
.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-learning__body,
.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-learning__pull {
	grid-column: 4 / span 6;
}

.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-cicada__visual {
	grid-column: 1 / span 6;
}

.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-cicada__head,
.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-cicada__body {
	grid-column: 7 / -1;
}

.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-community {
	grid-column: 1 / -1;
	display: grid;
	grid-template-columns: repeat(var(--mahamu-layout-grid-columns), minmax(0, 1fr));
	column-gap: var(--mahamu-layout-grid-gap);
	row-gap: var(--mahamu-layout-grid-gap);
	padding-top: var(--wp--custom--space--xl);
	border-top: 1px solid var(--wp--custom--color--border--soft);
}

.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-community__intro {
	grid-column: 1 / span 3;
}

.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-community__gallery,
.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-community__caption {
	grid-column: 4 / -1;
}

.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-today__copy {
	grid-column: 1 / span 6;
}

.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-today__visual {
	grid-column: 7 / -1;
}

@media (max-width: 1024px) {
	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-hero__copy {
		grid-column: 1 / span 5;
	}

	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-hero__index {
		grid-column: 6 / -1;
	}

	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-origin__head,
	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-learning__head {
		grid-column: 1 / span 3;
	}

	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-origin__body,
	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-learning__body,
	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-learning__pull {
		grid-column: 4 / -1;
	}

	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-cicada__visual {
		grid-column: 1 / span 4;
	}

	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-cicada__head,
	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-cicada__body {
		grid-column: 5 / -1;
	}

	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-community__intro {
		grid-column: 1 / span 3;
	}

	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-community__gallery,
	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-community__caption {
		grid-column: 1 / -1;
	}

	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-today__copy {
		grid-column: 1 / span 4;
	}

	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-today__visual {
		grid-column: 5 / -1;
	}
}

@media (max-width: 640px) {
	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-hero__copy,
	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-hero__index,
	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-origin__head,
	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-origin__body,
	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-learning__head,
	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-learning__body,
	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-learning__pull,
	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-cicada__visual,
	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-cicada__head,
	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-cicada__body,
	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-community,
	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-today__copy,
	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-today__visual {
		grid-column: 1 / -1;
		grid-row: auto;
	}

	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-community {
		padding-top: var(--wp--custom--space--lg);
	}

	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-community__intro,
	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-community__gallery,
	.mahamu-story-v4:not(.mahamu-layout-flow) .mahamu-story-community__caption {
		grid-column: 1 / -1;
	}
}
