/*
 * O18 detail page layout: Event details ED 2949:3018 and Success story
 * SS 2957:3928 (templates/single-meckup_event.html, single-meckup_story.html,
 * patterns section-event-intro, section-event-details, section-story-details).
 *
 * - The template's main (class meckup-single) starts with the A3 back link at
 *   y 257; the eyebrow follows 133 below the link's top.
 * - meckup-detail-grid: main column 750 | sidebar 420 inside the 1272 wide
 *   area (gap 102; ED's sidebar is 3 px further left, Q31). Stacks below 1100
 *   (interim, R-CMP-1): narrower, the 420 sidebar drops under ~300 px and its
 *   cards wrap ("December 2026" on 2 lines up to 1089, the apply button at 900).
 * - Main column: sections 148 apart; inside a section 36 between blocks
 *   (heading → text, lead-in → list → lead-in).
 * - Sidebar: cards 78 apart (80); quote card → partners 56.
 * Components: M11 agenda (meckup-agenda), M12 apply card (meckup-apply-card),
 * M13 partner panel (meckup-partner-panel), M19 quote card (meckup-quote-card).
 */

/* Template frame ---------------------------------------------------------- */

/* Back link → eyebrow: 103 px (100). */
.meckup-single__head .is-style-back + *,
.meckup-single > .meckup-single__head + .wp-block-post-content {
	margin-block-start: calc(var(--wp--preset--spacing--70) + var(--wp--preset--spacing--40));
}

/* Story title: 694 wide (3 lines); media card 76 (80) below it. */
.meckup-single__head .wp-block-post-title {
	max-width: 43.375rem;
}

.meckup-single__head .wp-block-post-featured-image {
	margin-block-start: calc(var(--wp--preset--spacing--70) - 0.25rem);
}

/* Story body starts 148 below the media card. */
.meckup-single > .meckup-single__head + .wp-block-post-content:has(> .meckup-story-details:first-child) {
	margin-block-start: var(--meckup-section-gap);
}

/* Two columns ------------------------------------------------------------- */

.meckup-detail-grid.is-layout-grid {
	grid-template-columns: minmax(0, 750fr) minmax(0, 420fr);
	column-gap: 8.02%;
	row-gap: var(--meckup-section-gap);
	align-items: start;
}

/* Stacked: one column, no wider than the desktop main column (750), so body
 * lines stay at their desktop length; the sidebar cards follow at that width. */
@media (max-width: 1099px) {
	.meckup-detail-grid.is-layout-grid {
		grid-template-columns: minmax(0, 46.875rem);
	}
}

/* Event intro: the illustration (420 × 360 frame, image 358 centred) lines up
 * with the eyebrow. The next section is 148 below the text, not the image. */
.meckup-event-intro > .wp-block-post-featured-image {
	justify-self: center;
	width: min(100%, 22.375rem);
}

@media (min-width: 1100px) {
	.meckup-event-intro > .wp-block-post-featured-image {
		margin-block-end: calc(-1 * var(--wp--preset--spacing--40));
	}
}

@media (max-width: 1099px) {
	.meckup-event-intro > .wp-block-post-featured-image {
		justify-self: start;
		width: min(60%, 14rem);
	}
}

.meckup-event-intro > .wp-block-group > .wp-block-post-title + p {
	margin-block-start: calc(3 * var(--wp--preset--spacing--30));
}

/* Main column and its sections. */
:root .meckup-detail-main > * + * {
	margin-block-start: var(--meckup-section-gap);
}

:root .meckup-detail-main > * > * + * {
	margin-block-start: calc(3 * var(--wp--preset--spacing--30));
}

/* Sidebar. */
:root .meckup-detail-sidebar > * + * {
	margin-block-start: var(--wp--preset--spacing--70);
}

.meckup-detail-sidebar > .meckup-quote-card + * {
	margin-block-start: calc(var(--wp--preset--spacing--50) + 2 * var(--wp--preset--spacing--30));
}

/*
 * MF-D3, event pages stacked: the M10 info card (dates, venue, format) moves up
 * between "About this event" and "What you'll do"; the other sidebar cards
 * still follow the main column. The two columns dissolve into the grid
 * (display: contents) so their children can be reordered; the markup and the
 * desktop sidebar don't change. Spacing comes from margins only (row gap 0).
 */
@media (max-width: 1099px) {
	.meckup-event-details.is-layout-grid {
		row-gap: 0;
	}

	.meckup-event-details > .meckup-detail-main,
	.meckup-event-details > .meckup-detail-sidebar {
		display: contents;
	}

	.meckup-event-details > .meckup-detail-main > :first-child {
		order: 1;
	}

	.meckup-event-details > .meckup-detail-sidebar > .meckup-info-card {
		order: 2;
		margin-block-start: var(--meckup-section-gap);
	}

	.meckup-event-details > .meckup-detail-main > :not(:first-child) {
		order: 3;
	}

	.meckup-event-details > .meckup-detail-sidebar > :not(.meckup-info-card) {
		order: 4;
	}

	/* The first card after the main column: a section gap, as before. */
	.meckup-event-details > .meckup-detail-sidebar > .meckup-info-card + *,
	.meckup-event-details > .meckup-detail-sidebar > :first-child:not(.meckup-info-card) {
		margin-block-start: var(--meckup-section-gap);
	}
}

/* M11 agenda: items 46 apart, 12 inside. ---------------------------------- */

:root .meckup-agenda > * + * {
	margin-block-start: calc(var(--wp--preset--spacing--60) - 0.25rem);
}

:root .meckup-agenda-item > * + * {
	margin-block-start: var(--wp--preset--spacing--30);
}

/* The day label's line box is 30 px here (lh normal), 24 on the track cards. */
.meckup-agenda-item > p.is-style-label {
	line-height: var(--wp--custom--line-height--normal);
}

/* M12 apply card: title 28 / 700 → 24 → body → 36 → button. --------------- */

:root .meckup-apply-card > * + * {
	margin-block-start: calc(2 * var(--wp--preset--spacing--30));
}

.meckup-apply-card > .wp-block-buttons {
	margin-block-start: calc(3 * var(--wp--preset--spacing--30));
}

/* The only underlined link in Figma: white, underlined (Q27). */
.meckup-apply-card p a {
	color: inherit;
	text-decoration: underline;
}

/* M13 partner panel: label → logo 62, logo → logo or label 80, logos centred. */
:root .meckup-partner-panel > * + * {
	margin-block-start: var(--wp--preset--spacing--70);
}

.meckup-partner-panel.meckup-partner-panel > p + * {
	margin-block-start: calc(var(--wp--preset--spacing--60) + var(--wp--preset--spacing--30));
}

.meckup-partner-panel .wp-block-image img {
	border-radius: 0;
}

/* M19 quote card: quote → 24 → avatar row. */
:root .meckup-quote-card > * + * {
	margin-block-start: calc(2 * var(--wp--preset--spacing--30));
}
