/* ──────────────────────────────────────────────────────────────────────────
   FAQs / Agenda block
   Left heading + intro · right accordion of question/answer cards.
   Tokens only — no raw hex.
   ────────────────────────────────────────────────────────────────────────── */

.uw-faq {
	background: var(--wp--preset--color--porcelain);
	color: var(--wp--preset--color--deep-navy);
}
.uw-faq__inner {
	position: relative;
	padding-top: clamp(56px, 7vw, 120px);
	padding-bottom: clamp(56px, 7vw, 120px);
	display: flex;
	align-items: flex-start;
	gap: clamp(2rem, 5vw, 80px);
}
/* Optional top border, matching the content width only — excludes the left/right padding. */
.uw-faq--top-border .uw-faq__inner::before {
	content: '';
	position: absolute;
	top: 0;
	left: clamp(24px, 4.94vw, 80px);
	right: clamp(24px, 4.94vw, 80px);
	height: 1px;
	background: color-mix(in srgb, var(--wp--preset--color--deep-navy) 10%, transparent);
}

.uw-faq--no-top-pad .uw-faq__inner { padding-top: 0; }
.uw-faq--no-bottom-pad .uw-faq__inner { padding-bottom: 0; }

/* ── Intro ── */
.uw-faq__intro {
	flex: 0 1 400px;
	display: flex;
	flex-direction: column;
	gap: clamp(1rem, 2vw, 24px);
}
.uw-faq__heading {
	margin: 0;
	font-family: var(--wp--preset--font-family--marr-sans-cond);
	font-weight: 600;
	font-size: clamp(40px, 4.5vw, 64px);
	line-height: 1.1;
	letter-spacing: -0.01em;
}
.uw-faq__body {
	margin: 0;
	font-family: var(--wp--preset--font-family--pp-mori);
	font-weight: 400;
	font-size: var(--wp--preset--font-size--body-small);
	line-height: 1.4;
}

/* -- Inline editing --
   Both columns are inner blocks inside ACF's single region.
   `<InnerBlocks class="uw-faq__flow">` makes ACF's own wrapper div
   `.uw-faq__flow`; it is display:contents, so the two `core/group`s inside it —
   carrying `.uw-faq__intro` and `.uw-faq__list`, the classes the two columns
   always had — are the flex children of `.uw-faq__inner` exactly as the legacy
   <div>s were. Every rule above and below keeps matching the same box and
   nothing is retargeted.

   No "hide the empty wrapper" rule here, unlike the features block: the legacy
   render emitted `.uw-faq__intro` unconditionally, so a present-but-empty
   column is exactly what it always did.

   Editor bridge. In the canvas the blocks are nested inside
   .block-editor-inner-blocks > .block-editor-block-list__layout, which would sit
   between a column and its children; on the front end they are direct children.
   display:contents makes both DOMs lay out identically. */
/* Both columns space their children with `gap`, which is what the legacy markup
   did. Core blocks arrive carrying the editor's default block margin as well, so
   without this the intro's heading-to-body distance and every gap between
   accordion rows is the gap PLUS 24px. */
.uw-faq__intro > :is(.uw-faq__heading, .uw-faq__body),
.uw-faq__list > .uw-faq__item,
.uw-faq__item > .uw-faq__a { margin-block: 0; }

.uw-faq__flow,
.uw-faq__flow > .block-editor-inner-blocks,
.uw-faq__flow > .block-editor-inner-blocks > .block-editor-block-list__layout,
.uw-faq__intro > .block-editor-inner-blocks,
.uw-faq__intro > .block-editor-inner-blocks > .block-editor-block-list__layout,
.uw-faq__list > .block-editor-inner-blocks,
.uw-faq__list > .block-editor-inner-blocks > .block-editor-block-list__layout { display: contents; }

/* An untouched template placeholder serializes as an empty element: an empty
   <h2> is a WCAG violation, and either one would still consume the column's
   `gap: clamp(1rem, 2vw, 24px)` where the legacy render emitted no element at
   all. The contenteditable guard keeps this off the editor canvas, where an
   empty block must stay visible and clickable. */
.uw-faq__heading:empty:not([contenteditable]),
.uw-faq__body:empty:not([contenteditable]) { display: none; }

/* ── Accordion list ── */
.uw-faq__list {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.uw-faq__item {
	margin: 0;
	background: var(--wp--preset--color--parchment);
	border-radius: 12px;
	padding: 0 24px;
}
.uw-faq__q {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	padding: 24px 0;
	cursor: pointer;
	list-style: none;
}
.uw-faq__q::-webkit-details-marker { display: none; }
.uw-faq__q-text {
	font-family: var(--wp--preset--font-family--pp-mori);
	font-weight: 600;
	font-size: 18px;
	letter-spacing: -0.01em;
	line-height: 1.1;
	color: var(--wp--preset--color--deep-navy);
}
.uw-faq__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 8px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--deep-navy);
	flex: none;
}
.uw-faq__toggle svg { width: 22px; height: 22px; }
.uw-faq__plus { display: block; }
.uw-faq__minus { display: none; }
.uw-faq__item[open] .uw-faq__plus { display: none; }
.uw-faq__item[open] .uw-faq__minus { display: block; }
.uw-faq__item[open] .uw-faq__toggle { background: var(--wp--preset--color--deep-navy); color: var(--wp--preset--color--white); }

.uw-faq__a {
	margin: 0;
	padding: 0 0 30px; 
	font-family: var(--wp--preset--font-family--pp-mori);
	font-weight: 400;
	font-size: var(--wp--preset--font-size--body-small);
	line-height: 1.3;
	color: var(--wp--preset--color--deep-navy);
}

/* -- Inline editing: the accordion rows --
   Each row is a `core/details`, which puts its className on the <details> only:
   its <summary> carries no class, so these rules reach it with an element
   selector, the way `.uw-faq__q` / `.uw-faq__q-text` are reached above. They are
   scoped to `.uw-faq__flow` so they cannot double up on the legacy markup, whose
   summary already carries `.uw-faq__q` and its own toggle element. */
.uw-faq__flow summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	padding: 24px 0;
	cursor: pointer;
	list-style: none;
	font-family: var(--wp--preset--font-family--pp-mori);
	font-weight: 600;
	font-size: 18px;
	letter-spacing: -0.01em;
	line-height: 1.1;
	color: var(--wp--preset--color--deep-navy);
}
.uw-faq__flow summary::-webkit-details-marker { display: none; }

/* The +/- chip is chrome, not content. In the repeater it was two inline <svg>s;
   as inner blocks an editor could select and delete them, so it is drawn on the
   summary instead. The bars are `currentColor` gradients, so the chip still
   takes its colour from a token and nothing here hardcodes a hex.

   The bar size is the SVG's, converted: that icon is 22px wide on a 24-unit
   viewBox (scale 22/24), and its path `M12 5v14M5 12h14` draws 14-unit arms with
   a 2.5-unit butt-cap stroke. So the arms are 14 x 22/24 = 12.83px and the
   stroke is 2.5 x 22/24 = 2.29px. They were 15px, which drew a plus visibly
   larger than live's - about 2px longer on each axis, and the only thing left on
   the page that a pixel comparison still saw. */
.uw-faq__flow summary::after {
	content: '';
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: 8px;
	background:
		linear-gradient(currentColor, currentColor) no-repeat center / 12.83px 2.29px,
		linear-gradient(currentColor, currentColor) no-repeat center / 2.29px 12.83px,
		var(--wp--preset--color--white);
}
.uw-faq__flow details[open] > summary::after {
	color: var(--wp--preset--color--white);
	background:
		linear-gradient(currentColor, currentColor) no-repeat center / 12.83px 2.29px,
		var(--wp--preset--color--deep-navy);
}

/* An answer left on its placeholder serializes as an empty <p> inside the
   `.uw-faq__a` group, which would still draw the box's 30px of bottom padding
   where the legacy render omitted the element entirely. The contenteditable
   guard keeps this off the editor canvas, where an empty block must stay
   visible and clickable. */
.uw-faq__a:has(> p:only-child:empty:not([contenteditable])) { display: none; }

/* ── Mobile ── */
@media (max-width: 900px) {
	.uw-faq__inner { flex-direction: column; gap: 2rem; }
	.uw-faq__intro, .uw-faq__list { flex: none; width: 100%; }
}
