/*
 * Accordion (blog-single, product detail): the HTML reference. The original theme uses core/accordion with block settings and
 * the theme's Boxed / Chevron block styles (wp/block-styles/accordion-boxed, accordion-chevron); no rule here
 * reaches it.
 *
 * Boxed: items 16px apart; 60px heading rows in the bar grey with a 60px square at the start (+ closed, − open, in
 * the contrast colour); titles 16px medium, 36px after the square; the open item gets a 1px frame; panel padding
 * 29/28/43, paragraphs 25px apart, the lead paragraph larger.
 * Chevron: 82px rows divided by 1px lines; titles 18px bold, 30px from the start; a thin chevron at the end, turned
 * down when open; the open heading is cream; panel padding 30/30/56.
 */
.rt-accordion--boxed,
.rt-accordion--chevron {
	display: flex;
	flex-direction: column;
	row-gap: var(--rt-spacing-30);
	color: var(--rt-color-body);
	font-family: var(--rt-font-family-body);
	font-size: var(--rt-font-size-base);
}

.rt-accordion__item--open {
	border: 1px solid var(--rt-accordion-border);
}

.rt-accordion__heading {
	margin: 0;
	color: var(--rt-color-contrast);
	font: inherit;
	font-weight: var(--rt-font-weight-medium);
	line-height: 1.25;
}

.rt-accordion__toggle {
	display: flex;
	align-items: stretch;
	width: 100%;
	min-height: 3.75rem;
	margin: 0;
	border: 0;
	padding: 0;
	background-color: var(--rt-accordion-bar);
	color: inherit;
	font: inherit;
	text-align: start;
	cursor: pointer;
}

.rt-accordion__toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -0.375rem;
}

.rt-accordion__title {
	flex: 1;
	align-self: center;
	padding: 1.25rem 2.25rem;
}

.rt-accordion__toggle:hover .rt-accordion__title {
	text-decoration: underline;
}

/* +/− drawn with two bars in the contrast colour; the vertical bar collapses when open. */
.rt-accordion__icon {
	flex: none;
	width: 3.75rem;
	font-size: 0;
	background:
		linear-gradient(currentColor, currentColor) center / 0.625rem 2px no-repeat,
		linear-gradient(currentColor, currentColor) center / 2px 0.625rem no-repeat,
		var(--rt-accordion-icon);
}

.rt-accordion__item--open .rt-accordion__icon {
	background-size: 0.625rem 2px, 2px 0, auto;
}

.rt-accordion__panel {
	padding: 1.8125rem 1.75rem 2.6875rem;
	line-height: 1.625;
}

/* hidden="until-found" keeps the box (content-visibility: hidden) so find-in-page can open it; drop its padding
   (outranks the variants' and mobile padding, as core's !important does). */
.rt-accordion .rt-accordion__panel[hidden] {
	padding: 0;
}

.rt-accordion__panel > * {
	margin: 0;
}

.rt-accordion__panel > * + * {
	margin-top: 1.5625rem;
}

/* Design 18/26; the theme's medium size (18 on mobile, 20 at 1440) keeps the original theme's fluid type from shrinking it. */
.rt-accordion__lead {
	font-size: var(--rt-font-size-medium);
	line-height: 1.4;
}

/* Chevron */
.rt-accordion--chevron {
	row-gap: 0;
}

.rt-accordion--chevron .rt-accordion__item--open {
	border: 0;
}

.rt-accordion--chevron .rt-accordion__item + .rt-accordion__item {
	border-top: 1px solid var(--rt-accordion-border);
}

.rt-accordion--chevron .rt-accordion__heading {
	font-size: var(--rt-font-size-base-plus);
	font-weight: var(--rt-font-weight-bold);
	line-height: 1.1875;
}

.rt-accordion--chevron .rt-accordion__toggle {
	min-height: 5.125rem;
	background-color: transparent;
}

.rt-accordion--chevron .rt-accordion__item--open .rt-accordion__toggle {
	background-color: var(--rt-accordion-open);
}

.rt-accordion--chevron .rt-accordion__title {
	padding: 1.875rem;
}

.rt-accordion--chevron .rt-accordion__icon {
	align-self: center;
	width: 1rem;
	height: 1rem;
	margin-inline-end: 1.625rem;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 16'%3E%3Cpath d='M1.5 1l7 7-7 7' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E") center / 0.5625rem 1rem no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 16'%3E%3Cpath d='M1.5 1l7 7-7 7' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E") center / 0.5625rem 1rem no-repeat;
	transition: transform 0.2s ease-in-out;
}

.rt-accordion--chevron .rt-accordion__item--open .rt-accordion__icon {
	transform: rotate(90deg);
}

.rt-accordion--chevron .rt-accordion__panel {
	padding: 1.875rem 1.875rem 3.5rem;
}

@media (max-width: 37.5rem) {
	/* The title 20px after the icon and still 36px before the edge on phones (core/accordion's button padding) */
	.rt-accordion__title {
		padding-inline-start: 1.25rem;
	}

	.rt-accordion__panel {
		padding-inline: 1.25rem;
	}

	.rt-accordion--chevron .rt-accordion__title {
		padding: 1.875rem 1.25rem;
	}

	.rt-accordion--chevron .rt-accordion__icon {
		margin-inline-end: 1.25rem;
	}

	.rt-accordion--chevron .rt-accordion__panel {
		padding: 1.25rem 1.25rem var(--rt-spacing-50);
	}
}

@media (prefers-reduced-motion: reduce) {
	.rt-accordion--chevron .rt-accordion__icon {
		transition: none;
	}
}
