/* Minimal — a flat disclosure list: hairline rows, no card, a fine Lucide mark.
   Every rule is scoped to the block style, so core's default accordion is untouched
   and a user who has not opted in sees core's own treatment. */

/* Rows sit flush, divided by a hairline — the hairline and the question's own padding
   are the rhythm, so the theme's usual gap between blocks is closed up. The accordion
   lays its rows out in normal flow, so that gap arrives as a margin and has to be
   removed as one; `gap` alone would not reach it. */
.wp-block-accordion.is-style-origin-canvas-accordion-minimal {
	gap: 0;
}

.wp-block-accordion.is-style-origin-canvas-accordion-minimal > .wp-block-accordion-item {
	gap: 0;
	margin-block: 0;
}

.wp-block-accordion.is-style-origin-canvas-accordion-minimal > .wp-block-accordion-item + .wp-block-accordion-item {
	margin-block-start: 0;
}

/* The question's own text box sets the row height: 20 padding, a 25.2 line at 18/1.4,
   20 padding — 65.2, plus the hairline. Core pads the button with a spacing preset this
   theme does not define, so left alone it falls back to 1em and the row collapses. */
.wp-block-accordion.is-style-origin-canvas-accordion-minimal > .wp-block-accordion-item > .wp-block-accordion-heading > .wp-block-accordion-heading__toggle {
	align-items: center;
	display: flex;
	gap: var(--wp--preset--spacing--medium);
	justify-content: space-between;
	padding-block: var(--wp--preset--spacing--medium);
}

/* The answer shares the question's leading edge — this is a vertical reveal, not a nested
   outline — and stops short of the marker's column so the block reads as one edge. Logical
   properties, because this style is reusable and core allows the marker on either side.
   The padding sits on the answer itself, not the panel: a closed panel is hidden but keeps
   its box, so padding there puts an invisible band under every closed row. That is also why
   it cannot move to theme.json, which can only reach the panel. */
.wp-block-accordion.is-style-origin-canvas-accordion-minimal > .wp-block-accordion-item > .wp-block-accordion-panel > * {
	padding-block-end: var(--wp--preset--spacing--medium);
	padding-inline-end: var(--wp--preset--spacing--extra-large);
}

/* Opening a row must not introduce space: the question's own bottom padding is the gap
   to the answer. Core clears the theme's usual gap only while the panel is hidden, so
   without this the answer drops away from its question the moment the row opens. */
.wp-block-accordion.is-style-origin-canvas-accordion-minimal > .wp-block-accordion-item > .wp-block-accordion-panel {
	margin-block-start: 0;
}

/* Marker. Core's own "+" character is hidden by a zero font size while the span keeps
   its box; the mark itself is a Lucide glyph painted as a mask, which gives an exact
   stroke weight instead of inheriting the question's font weight. The span holds the
   marker color (settings.custom.accordion.markerColor in theme.json) and the mask
   paints in currentColor, so the color is set in one place. */
.wp-block-accordion.is-style-origin-canvas-accordion-minimal > .wp-block-accordion-item > .wp-block-accordion-heading > .wp-block-accordion-heading__toggle .wp-block-accordion-heading__toggle-icon {
	color: var(--wp--custom--accordion--marker-color);
	flex: none;
	font-size: 0;
	height: 20px;
	position: relative;
	transform: none;
	width: 20px;
}

.wp-block-accordion.is-style-origin-canvas-accordion-minimal > .wp-block-accordion-item > .wp-block-accordion-heading > .wp-block-accordion-heading__toggle .wp-block-accordion-heading__toggle-icon::after {
	background-color: currentColor;
	content: "";
	display: block;
	height: 20px;
	inset-inline-start: 0;
	line-height: 1;
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M12 5v14'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M12 5v14'/%3E%3C/svg%3E");
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-size: contain;
	mask-size: contain;
	position: absolute;
	top: 0;
	width: 20px;
}

/* A text color set on the question carries to its marker. */
.wp-block-accordion.is-style-origin-canvas-accordion-minimal > .wp-block-accordion-item > .wp-block-accordion-heading.has-text-color > .wp-block-accordion-heading__toggle .wp-block-accordion-heading__toggle-icon {
	color: inherit;
}

/* Open: the mark becomes a single bar. Core rotates its glyph from a four-class
   selector, so the scoped rule outranks it and the rotation stops. */
.wp-block-accordion.is-style-origin-canvas-accordion-minimal > .wp-block-accordion-item.is-open > .wp-block-accordion-heading .wp-block-accordion-heading__toggle-icon {
	transform: none;
}

.wp-block-accordion.is-style-origin-canvas-accordion-minimal > .wp-block-accordion-item.is-open > .wp-block-accordion-heading .wp-block-accordion-heading__toggle-icon::after {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E");
}

/* Windows high-contrast mode drops background colours, which would take the mask-drawn
   mark with it and leave the row with no open/closed signal at all. There, core's own
   character is shown again instead. */
@media (forced-colors: active) {
	.wp-block-accordion.is-style-origin-canvas-accordion-minimal > .wp-block-accordion-item > .wp-block-accordion-heading > .wp-block-accordion-heading__toggle .wp-block-accordion-heading__toggle-icon {
		color: CanvasText;
		font-size: inherit;
	}

	.wp-block-accordion.is-style-origin-canvas-accordion-minimal > .wp-block-accordion-item > .wp-block-accordion-heading > .wp-block-accordion-heading__toggle .wp-block-accordion-heading__toggle-icon::after {
		content: none;
	}

	/* Core's rotation is suppressed above because the mask swaps the glyph instead.
	   With the mask gone, the rotation has to come back or open and closed look
	   identical. */
	.wp-block-accordion.is-style-origin-canvas-accordion-minimal > .wp-block-accordion-item.is-open > .wp-block-accordion-heading > .wp-block-accordion-heading__toggle .wp-block-accordion-heading__toggle-icon {
		transform: rotate(45deg);
	}

}

/* Same reasoning for a browser without mask support: show the character rather than
   nothing. */
@supports not ((-webkit-mask-image: none) or (mask-image: none)) {
	.wp-block-accordion.is-style-origin-canvas-accordion-minimal > .wp-block-accordion-item > .wp-block-accordion-heading > .wp-block-accordion-heading__toggle .wp-block-accordion-heading__toggle-icon {
		font-size: inherit;
	}

	.wp-block-accordion.is-style-origin-canvas-accordion-minimal > .wp-block-accordion-item > .wp-block-accordion-heading > .wp-block-accordion-heading__toggle .wp-block-accordion-heading__toggle-icon::after {
		content: none;
	}

	/* Core's rotation is suppressed above because the mask swaps the glyph instead.
	   With the mask gone, the rotation has to come back or open and closed look
	   identical. */
	.wp-block-accordion.is-style-origin-canvas-accordion-minimal > .wp-block-accordion-item.is-open > .wp-block-accordion-heading > .wp-block-accordion-heading__toggle .wp-block-accordion-heading__toggle-icon {
		transform: rotate(45deg);
	}

}

/* Core underlines the question on hover. An underline reads as a link to somewhere else,
   and this one opens a panel in place, so it shifts colour instead. Focus shifts it too: the
   field ring alone is too faint to carry focus, and every cue has a second carrier (#119). */
.wp-block-accordion.is-style-origin-canvas-accordion-minimal > .wp-block-accordion-item > .wp-block-accordion-heading > .wp-block-accordion-heading__toggle:hover .wp-block-accordion-heading__toggle-title,
.wp-block-accordion.is-style-origin-canvas-accordion-minimal > .wp-block-accordion-item > .wp-block-accordion-heading > .wp-block-accordion-heading__toggle:focus-visible .wp-block-accordion-heading__toggle-title {
	color: var(--wp--preset--color--primary);
	text-decoration: none;
}

/* A coloured note after the question, made with the editor's text colour format, sets
   lighter than the question so it reads as a gloss on it, not part of it. The editor
   has no inline weight format, and the heading's own weight reaches the whole question,
   so neither theme.json nor a block setting can reach the note alone. The weight is
   settings.custom.accordion.noteWeight in theme.json, so a style variation can change it. */
.wp-block-accordion.is-style-origin-canvas-accordion-minimal .wp-block-accordion-heading__toggle-title > mark.has-inline-color {
	font-weight: var(--wp--custom--accordion--note-weight);
}

/* The question takes the field ring on focus: primary, 4px at 25%, the ring style.css gives
   every field. A toggle is an interactive control, so it focuses like one (#119). The
   transparent outline replaces the browser's and still paints in forced-colors mode, where
   the ring is dropped. */
.wp-block-accordion.is-style-origin-canvas-accordion-minimal > .wp-block-accordion-item > .wp-block-accordion-heading > .wp-block-accordion-heading__toggle:focus-visible {
	border-radius: var(--wp--custom--radius--small);
	box-shadow: 0 0 0 var(--wp--preset--spacing--extra-small) color-mix(in srgb, var(--wp--preset--color--primary) 25%, transparent);
	outline: 2px solid transparent;
}

/* Everything above is appearance and applies to everyone. The panel opens at once:
   core declares a grid-template-rows transition on the ITEM, but on this markup the
   panel opens by dropping `hidden`, so no height change can run. The rule below clears
   that transition and the icon's, and only the question's color change is timed. */
.wp-block-accordion.is-style-origin-canvas-accordion-minimal > .wp-block-accordion-item,
.wp-block-accordion.is-style-origin-canvas-accordion-minimal > .wp-block-accordion-item > .wp-block-accordion-heading > .wp-block-accordion-heading__toggle .wp-block-accordion-heading__toggle-icon {
	transition: none;
}

@media (prefers-reduced-motion: no-preference) {
	.wp-block-accordion.is-style-origin-canvas-accordion-minimal > .wp-block-accordion-item > .wp-block-accordion-heading > .wp-block-accordion-heading__toggle .wp-block-accordion-heading__toggle-title {
		transition: color 200ms ease;
	}
}

/* Sticky is NOT part of the block style. It is a separate opt-in utility for the
   two-column FAQ layout, applied to a Columns block via Additional CSS Classes, and is
   deliberately left unscoped. */
@media (min-width: 782px) {
	.origin-canvas-faq-sticky > .wp-block-column:first-child {
		align-self: start;
		position: sticky;
		top: var(--wp--preset--spacing--extra-large);
	}
}
