/*
 * Velur disclosure standard (Paket 2 · 2C-1/2C-2, VEL-20261024-P2-KAUFBOX)
 *
 * Product pages only, loaded after velur-design-system (functions.php), whose
 * tokens it uses; no literal durations or curves (motion-contract.php).
 * Sections: the configurator rows (vlr-disclosure-config) and the FAQ
 * (vlr-disclosure-faq). The info accordions below the purchase box ("Der Ring
 * im Detail", Elementor toggles and accordion) follow the same standard in
 * plugins/velur-ring-dimensions/assets/ring-specifications.css, the global
 * place of their styling on every product page.
 *
 * 1. State: the existing class or attribute stays the only truth (`.collapse`
 *    on the configurator rows). Every script that writes it (theme, diamond
 *    choice, earrings, birthstone bracelet) keeps working unchanged. The
 *    trigger carries aria-expanded and aria-controls (variable.php).
 * 2. Height: a grid row on the item, `0fr` closed and `1fr` open, between
 *    the header (max-content) and a filler row (auto). While a row moves, an
 *    fr row below 1 is smaller than the item (fr² against fr); the filler
 *    takes the rest (align-content: stretch reaches only auto rows) and the
 *    body spans both rows, so its clip edge is the item's edge in every frame:
 *    no empty band above the line, and the header keeps its height. The item
 *    itself never clips (the info tooltips of a header open below the row).
 *    No max-height values and no padding on the item: the row's bottom
 *    spacing is part of the body (variable.php), so closing has no jump.
 * 3. Time: the row opens and closes with --vlr-motion-slow and --vlr-ease.
 *    A closed body is `visibility: hidden`, delayed by the same duration, so
 *    nothing inside a closed row takes focus or is read out, and closing
 *    starts in the first frame. Opening shows the body at once (no transition
 *    at all, so the reduced-motion rule cannot hold it hidden for a frame).
 * 4. Reduced motion: the global rule of the design system shortens every
 *    transition to 0.01ms and drops the delay; nothing here is !important.
 * 5. Focus rings of the options (2 px plus their offset) stay inside the
 *    clipped body: it is inset by the focus width plus offset on the top and
 *    the sides and pulls the same amount back with a negative margin, so the
 *    layout does not move; below, the row spacing gives the room. No inset at
 *    the bottom, so a closing row shows no strip of its options under the
 *    header. The header is positioned and stays on top of the inset.
 *
 * Not covered: the compact earring and necklace rows (`data-vlr-open` and
 * `hidden`, mu-plugins/velur-earrings-conversion/assets/selectors.*) and rows
 * the [hidden] attribute removes (diamond choice before it applies).
 * Contexts without this file (quick view) keep the static collapse of
 * variable.php: closed rows hidden at once, no animation.
 */

/* vlr-disclosure-config:start */
body:not(.velur-compact-earrings):not(.velur-compact-necklace) .variations_form .config-group .accordion-item:not([hidden]):not([data-vlr-open]) {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-rows: max-content 1fr auto;
	align-content: stretch; /* the filler row takes what a moving fr row leaves (comment 2) */
	transition: grid-template-rows var(--vlr-motion-slow) var(--vlr-ease);
}

body:not(.velur-compact-earrings):not(.velur-compact-necklace) .variations_form .config-group .accordion-item.collapse:not([hidden]):not([data-vlr-open]) {
	grid-template-rows: max-content 0fr auto;
}

body:not(.velur-compact-earrings):not(.velur-compact-necklace) .variations_form .config-group .accordion-item:not([hidden]):not([data-vlr-open]) > .acc-header {
	position: relative;
}

body:not(.velur-compact-earrings):not(.velur-compact-necklace) .variations_form .config-group .accordion-item:not([hidden]):not([data-vlr-open]) > .acc-body {
	grid-row: 2 / span 2;
	min-height: 0;
	max-height: none;
	margin: calc(-1 * (var(--vlr-focus-width) + var(--vlr-focus-offset)));
	margin-bottom: 0;
	padding: calc(var(--vlr-focus-width) + var(--vlr-focus-offset));
	padding-bottom: 0;
	overflow: hidden;
	visibility: visible;
	transition: none; /* shown at once, also while reduced motion shortens every transition */
}

body:not(.velur-compact-earrings):not(.velur-compact-necklace) .variations_form .config-group .accordion-item.collapse:not([hidden]):not([data-vlr-open]) > .acc-body {
	visibility: hidden;
	transition: visibility 0s linear var(--vlr-motion-slow);
}
/* vlr-disclosure-config:end */

/* vlr-disclosure-faq:start */
/*
 * FAQ (Paket 2 · 2C-2): the native <details> of the lower ring PDP (#fragen, HTML widget of
 * the product template) and of the solitaire FAQ (includes/pdp-solitaire-faq.php). The #fragen
 * rules live only here (pdp-solitaire-faq.css stays free of the ring namespace).
 *
 * - Sign: the "+" stays text in the markup (summary > span; single-product.js compares
 *   summary.textContent); it is drawn as the 1.5 px plus/minus mask of the 24 px icon grid in
 *   Ink, without turning. The question rows that open a chat keep the plus, as a link.
 * - Motion: only where the browser interpolates to `auto` (@supports interpolate-size,
 *   Chromium) the answer (::details-content) opens and closes in --vlr-motion-slow with the one
 *   curve; elsewhere <details> stays untouched and opens and closes at once, as before (no
 *   answer held visible after a jump). The answer clips itself at its moving edge, the top of
 *   the question's line (overflow-y: clip; the sides stay open), so content and edge move
 *   together and no text shows under the line. It is inset by the room of a focus ring at
 *   the top, under the question (positioned, so it stays on top and takes the taps there):
 *   the rings of links in its first line stay whole; below, its 20 px spacing holds them. An
 *   open answer shows all of its content. ::details-content is no ::before/::after, so the
 *   global reduced-motion rule does not reach it; it gets its own.
 * - Focus: 2 px Ink with the 3 px offset of the standard (the widget CSS set 4 px).
 */
body.single-product .vlr-lower #fragen .faq-list summary > span,
body.single-product .vlr-lower #fragen .vlr-faq-consult-link .vlr-faq-consult-link__icon,
body.single-product .vlr-solitaire-faq summary > span,
body.single-product .vlr-solitaire-faq .vlr-solitaire-faq__other-question > span {
	display: block;
	flex: 0 0 var(--vlr-icon-size);
	width: var(--vlr-icon-size);
	height: var(--vlr-icon-size);
	color: var(--vlr-ink);
	background-color: currentColor;
	font-size: 0;
	line-height: 0;
	-webkit-mask: var(--vlr-icon-plus) center / var(--vlr-icon-size) var(--vlr-icon-size) no-repeat;
	mask: var(--vlr-icon-plus) center / var(--vlr-icon-size) var(--vlr-icon-size) no-repeat;
	transform: none;
	transition: none;
}

body.single-product .vlr-lower #fragen .faq-list details[open] > summary > span,
body.single-product .vlr-solitaire-faq details[open] > summary > span {
	-webkit-mask-image: var(--vlr-icon-minus);
	mask-image: var(--vlr-icon-minus);
	transform: none;
}

body.single-product .vlr-lower #fragen .faq-list summary:focus-visible,
body.single-product .vlr-solitaire-faq summary:focus-visible {
	outline: var(--vlr-focus-width) solid var(--vlr-focus-color);
	outline-offset: var(--vlr-focus-offset);
}

@supports (interpolate-size: allow-keywords) {
	body.single-product .vlr-lower #fragen .faq-list details,
	body.single-product .vlr-solitaire-faq details {
		interpolate-size: allow-keywords;
	}

	body.single-product .vlr-lower #fragen .faq-list summary,
	body.single-product .vlr-solitaire-faq summary {
		position: relative;
	}

	body.single-product .vlr-lower #fragen .faq-list details::details-content,
	body.single-product .vlr-solitaire-faq details::details-content {
		block-size: 0;
		margin-top: calc(-1 * (var(--vlr-focus-width) + var(--vlr-focus-offset)));
		padding-top: calc(var(--vlr-focus-width) + var(--vlr-focus-offset));
		overflow-x: visible;
		overflow-y: clip;
		transition:
			block-size var(--vlr-motion-slow) var(--vlr-ease),
			content-visibility var(--vlr-motion-slow) var(--vlr-ease) allow-discrete;
	}

	body.single-product .vlr-lower #fragen .faq-list details[open]::details-content,
	body.single-product .vlr-solitaire-faq details[open]::details-content {
		block-size: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.single-product .vlr-lower #fragen .faq-list details::details-content,
	body.single-product .vlr-solitaire-faq details::details-content {
		transition-duration: 0s;
		transition-delay: 0s;
	}
}

@media (forced-colors: active) {
	body.single-product .vlr-lower #fragen .faq-list summary > span,
	body.single-product .vlr-lower #fragen .vlr-faq-consult-link .vlr-faq-consult-link__icon,
	body.single-product .vlr-solitaire-faq summary > span,
	body.single-product .vlr-solitaire-faq .vlr-solitaire-faq__other-question > span {
		forced-color-adjust: none;
		background-color: CanvasText;
	}
}
/* vlr-disclosure-faq:end */
