/**
 * simplydwell/accordion — FAQ-style accordion (Figma "FAQ" frame).
 *
 * Desktop reference (1440): section padding 80px 120px, 64px gap; centred header
 * (max 910px) with a 12/16 +0.17em #D46F35 eyebrow, a 60/60 Lexend 700 #1F242E
 * headline (with a #D46F35 -> #E2BB61 gradient on *wrapped* words) and a 78x3 #DCA23B
 * accent line; a 1200px-wide list with 48px gaps; each item padded 32px with a 1px
 * #C8C8C8 divider, a 24/32 #1F242E title, a +/- icon, and an 18/28 #737A87 body.
 * Buildless, hand-authored; layout/type/spacing live here, content comes from attrs.
 */

.sd-accordion {
	box-sizing: border-box;
	width: 100%;
	background: var( --sd-accordion-bg, #fff );
	padding: clamp(48px, 9vw, 120px) clamp(24px, 6vw, 120px);
}

.sd-accordion__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: clamp( 40px, 5vw, 64px );
	width: 100%;
	max-width: 1440px;
	margin: 0 auto;
}

/* ── Header ──────────────────────────────────────────────────────────────────── */
.sd-accordion__head {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 32px;
	width: 100%;
	max-width: 910px;
}

.sd-accordion__eyebrow {
	margin: 0;
	font-family: 'Lexend', sans-serif;
	font-size: 12px;
	font-weight: 700;
	line-height: 16px;
	letter-spacing: 0.17em;
	text-transform: uppercase;
	text-align: center;
	color: #d46f35;
}

.sd-accordion__heading {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0 16px;
	margin: 0;
	font-family: 'Lexend', sans-serif;
	font-size: clamp( 2rem, 5vw, 3.75rem );
	font-weight: 700;
	line-height: 1;
	text-align: center;
	color: #1f242e;
}

.sd-accordion__heading-accent {
	background: linear-gradient( 90deg, #d46f35 0%, #e2bb61 100% );
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

.sd-accordion__divider {
	display: block;
	width: 78px;
	height: 0;
	border-top: 3px solid #dca23b;
}

/* ── List ────────────────────────────────────────────────────────────────────── */
.sd-accordion__list {
	list-style: none;
	margin: 0;
	padding: 0;
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 48px;
}

/* .sd-accordion__item {
	padding-bottom: 32px;
	border-bottom: 1px solid #c8c8c8;
} */

/* ── Toggle (question row) ───────────────────────────────────────────────────── */
.sd-accordion__toggle {
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	gap: 24px;
	padding: 0 8px 0 0;
	margin: 0;
	background: none;
	border: none;
	cursor: pointer;
	text-align: left;
	-webkit-user-select: none;
	user-select: none;
	border-bottom: 1px solid #c8c8c8;
}

.sd-accordion__toggle:focus-visible {
	outline: 2px solid #d46f35;
	outline-offset: 4px;
}

.sd-accordion__toggle:focus{
	outline: none;
}

.sd-accordion__title {
	flex: 1 1 auto;
	font-family: 'Lexend', sans-serif;
	font-size: clamp( 1.125rem, 2.5vw, 1.5rem );
	font-weight: 700;
	line-height: 1.333;
	text-align: left;
	color: #1f242e;
	padding: 20px 0px;
}

/* ── Plus / minus icon (two bars; the vertical one hides when open) ──────────── */
.sd-accordion__icon {
	position: relative;
	flex: none;
	width: 24px;
	height: 24px;
}

.sd-accordion__icon::before,
.sd-accordion__icon::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Horizontal bar */
.sd-accordion__icon::before {
	width: 14px;
	height: 0;
	border-top: 1.5px solid #1f242e;
	transform: translate( -50%, -50% );
}

/* Vertical bar — fades out when the panel opens, leaving a minus */
.sd-accordion__icon::after {
	width: 0;
	height: 14px;
	border-left: 1.5px solid #475569;
	transform: translate( -50%, -50% );
}

.sd-accordion__toggle[aria-expanded="true"] .sd-accordion__icon::after,
.sd-accordion__item--open .sd-accordion__icon::after {
	transform: translate( -50%, -50% ) rotate( 90deg );
	opacity: 0;
}

/* ── Content / body (animated open / close) ─────────────────────────────────── */
.sd-accordion__content {
	overflow: hidden;
	max-height: 0;
	transition: max-height 0.3s ease, padding-top 0.3s ease, opacity 0.3s ease;
	opacity: 0;
}

.sd-accordion__toggle[aria-expanded="true"] + .sd-accordion__content,
.sd-accordion__item--open .sd-accordion__content {
	max-height: 1500px;
	padding-top: 32px;
	opacity: 1;
}

.sd-accordion__body {
	font-family: 'Lexend', sans-serif;
	font-size: 18px;
	font-weight: 500;
	line-height: 28px;
	color: #737a87;
}

.sd-accordion__body > :first-child { margin-top: 0; }
.sd-accordion__body > :last-child { margin-bottom: 0; }

.sd-accordion__body p { margin: 0 0 16px; }

.sd-accordion__body h1,
.sd-accordion__body h2,
.sd-accordion__body h3,
.sd-accordion__body h4,
.sd-accordion__body h5,
.sd-accordion__body h6 {
	margin: 24px 0 12px;
	font-weight: 700;
	line-height: 1.2;
	color: #1f242e;
}

.sd-accordion__body ul,
.sd-accordion__body ol {
	margin: 0 0 16px;
	padding-left: 1.25em;
}

.sd-accordion__body li { margin: 0 0 6px; }

.sd-accordion__body a {
	color: #d46f35;
	text-decoration: underline;
}

.sd-accordion__body img {
	max-width: 100%;
	height: auto;
}

.sd-accordion__body blockquote {
	margin: 16px 0;
	padding-left: 16px;
	border-left: 3px solid #d46f35;
}

/* Buttons authored in the WYSIWYG (the .wp-block-button markup or a bare <a class="button">) */
.sd-accordion__body .wp-block-button__link,
.sd-accordion__body a.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 54px;
	padding: 8px 24px;
	background: #d46f35;
	color: #fff;
	border-radius: 31px;
	font-weight: 500;
	text-decoration: none;
	transition: filter 0.18s ease;
}

.sd-accordion__body .wp-block-button__link:hover,
.sd-accordion__body a.button:hover {
	filter: brightness( 0.92 );
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media ( max-width: 768px ) {
	.sd-accordion__list {
		gap: 32px;
	}
	.sd-accordion__title {
		text-align: left;
	}
	.sd-accordion__body {
		font-size: 16px;
		line-height: 26px;
	}
	.sd-accordion__toggle[aria-expanded="true"] + .sd-accordion__content,
	.sd-accordion__item--open .sd-accordion__content {
		padding-top: 20px;
	}
}
