/* ==========================================================================
   Acme FAQ — giao diện frontend
   Dùng <details>/<summary> gốc nên không cần JavaScript.

   Muốn đổi màu, bo góc, khoảng cách: ghi đè các biến bên dưới trong
   Appearance → Customize → Additional CSS. Ví dụ:

       .acme-faq {
           --acme-faq-accent: #16a34a;
           --acme-faq-radius: 4px;
       }
   ========================================================================== */

.acme-faq {
	--acme-faq-accent: #2563eb;
	--acme-faq-accent-soft: rgba(37, 99, 235, .08);
	--acme-faq-text: inherit;
	--acme-faq-muted: #6b7280;
	--acme-faq-border: #e5e7eb;
	--acme-faq-surface: #fff;
	--acme-faq-radius: 10px;
	--acme-faq-gap: 10px;
	--acme-faq-pad: 18px;
	--acme-faq-speed: .18s;

	margin: 2.5rem 0;
	color: var(--acme-faq-text);
}

/* --------------------------------------------------------------------------
   Tiêu đề khối
   -------------------------------------------------------------------------- */

.acme-faq__title {
	position: relative;
	margin: 0 0 1.25rem;
	padding-left: 14px;
	font-size: clamp(1.25rem, 1.05rem + .8vw, 1.6rem);
	line-height: 1.3;
	font-weight: 700;
	letter-spacing: -.01em;
}

.acme-faq__title::before {
	content: '';
	position: absolute;
	top: .18em;
	bottom: .18em;
	left: 0;
	width: 4px;
	border-radius: 4px;
	background: var(--acme-faq-accent);
}

/* --------------------------------------------------------------------------
   Danh sách
   -------------------------------------------------------------------------- */

.acme-faq__list {
	display: flex;
	flex-direction: column;
	gap: var(--acme-faq-gap);
}

.acme-faq__item {
	background: var(--acme-faq-surface);
	border: 1px solid var(--acme-faq-border);
	border-radius: var(--acme-faq-radius);
	overflow: hidden;
	transition: border-color var(--acme-faq-speed) ease,
		box-shadow var(--acme-faq-speed) ease;
}

.acme-faq__item:hover {
	border-color: var(--acme-faq-accent);
}

.acme-faq__item[open] {
	border-color: var(--acme-faq-accent);
	box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 0 0 3px var(--acme-faq-accent-soft);
}

/* --------------------------------------------------------------------------
   Câu hỏi
   -------------------------------------------------------------------------- */

.acme-faq__q {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: var(--acme-faq-pad);
	cursor: pointer;
	list-style: none;
	transition: background var(--acme-faq-speed) ease;
	-webkit-tap-highlight-color: transparent;
}

.acme-faq__q::-webkit-details-marker {
	display: none;
}

.acme-faq__q::marker {
	content: '';
}

.acme-faq__q:hover {
	background: var(--acme-faq-accent-soft);
}

.acme-faq__q:focus-visible {
	outline: 2px solid var(--acme-faq-accent);
	outline-offset: -2px;
}

.acme-faq__item[open] .acme-faq__q {
	padding-bottom: calc(var(--acme-faq-pad) * .6);
}

.acme-faq__q-text {
	margin: 0;
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.5;
	transition: color var(--acme-faq-speed) ease;
}

.acme-faq__item[open] .acme-faq__q-text {
	color: var(--acme-faq-accent);
}

/* Dấu cộng vẽ bằng CSS, xoay thành dấu trừ khi mở */
.acme-faq__icon {
	position: relative;
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--acme-faq-accent-soft);
	color: var(--acme-faq-accent);
	transition: transform var(--acme-faq-speed) ease,
		background var(--acme-faq-speed) ease;
}

.acme-faq__icon::before,
.acme-faq__icon::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	background: currentColor;
	border-radius: 2px;
	transform: translate(-50%, -50%);
	transition: transform var(--acme-faq-speed) ease, opacity var(--acme-faq-speed) ease;
}

.acme-faq__icon::before {
	width: 11px;
	height: 2px;
}

.acme-faq__icon::after {
	width: 2px;
	height: 11px;
}

.acme-faq__item[open] .acme-faq__icon {
	background: var(--acme-faq-accent);
	color: #fff;
	transform: rotate(180deg);
}

.acme-faq__item[open] .acme-faq__icon::after {
	transform: translate(-50%, -50%) rotate(90deg);
	opacity: 0;
}

/* --------------------------------------------------------------------------
   Câu trả lời
   -------------------------------------------------------------------------- */

.acme-faq__a {
	padding: 0 var(--acme-faq-pad) var(--acme-faq-pad);
	line-height: 1.75;
	color: var(--acme-faq-muted);
	animation: acme-faq-reveal var(--acme-faq-speed) ease;
}

@keyframes acme-faq-reveal {
	from {
		opacity: 0;
		transform: translateY(-4px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.acme-faq__a > *:first-child {
	margin-top: 0;
}

.acme-faq__a > *:last-child {
	margin-bottom: 0;
}

.acme-faq__a a {
	color: var(--acme-faq-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.acme-faq__a ul,
.acme-faq__a ol {
	margin: .75em 0;
	padding-left: 1.4em;
}

.acme-faq__a li + li {
	margin-top: .35em;
}

/* --------------------------------------------------------------------------
   Biến thể: style="line" — chỉ có đường kẻ, không viền hộp
   -------------------------------------------------------------------------- */

.acme-faq--line .acme-faq__list {
	gap: 0;
	border-top: 1px solid var(--acme-faq-border);
}

.acme-faq--line .acme-faq__item {
	border: 0;
	border-bottom: 1px solid var(--acme-faq-border);
	border-radius: 0;
	background: transparent;
	box-shadow: none;
}

.acme-faq--line .acme-faq__q {
	padding-left: 0;
	padding-right: 0;
}

.acme-faq--line .acme-faq__q:hover {
	background: transparent;
}

.acme-faq--line .acme-faq__a {
	padding-left: 0;
	padding-right: 0;
}

/* --------------------------------------------------------------------------
   Biến thể: style="boxed" — cả khối nằm trong một hộp nền nhạt
   -------------------------------------------------------------------------- */

.acme-faq--boxed {
	padding: clamp(18px, 3vw, 28px);
	background: var(--acme-faq-accent-soft);
	border-radius: calc(var(--acme-faq-radius) + 6px);
}

.acme-faq--boxed .acme-faq__item {
	border-color: transparent;
}

/* --------------------------------------------------------------------------
   Màn hình nhỏ
   -------------------------------------------------------------------------- */

@media (max-width: 600px) {
	.acme-faq {
		--acme-faq-pad: 14px;
	}

	.acme-faq__q-text {
		font-size: 1rem;
	}
}

/* --------------------------------------------------------------------------
   Nền tối
   -------------------------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
	.acme-faq {
		--acme-faq-border: #374151;
		--acme-faq-surface: #1f2937;
		--acme-faq-muted: #9ca3af;
		--acme-faq-accent: #60a5fa;
		--acme-faq-accent-soft: rgba(96, 165, 250, .12);
	}
}

/* --------------------------------------------------------------------------
   In ra giấy: mở hết cho dễ đọc
   -------------------------------------------------------------------------- */

@media print {
	.acme-faq__item {
		break-inside: avoid;
		box-shadow: none;
	}

	.acme-faq__a {
		display: block !important;
		animation: none;
	}

	.acme-faq__icon {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.acme-faq__item,
	.acme-faq__q,
	.acme-faq__q-text,
	.acme-faq__icon,
	.acme-faq__icon::before,
	.acme-faq__icon::after {
		transition: none;
	}

	.acme-faq__a {
		animation: none;
	}
}
