/*
 * FAQ progressive enhancement.
 *
 * Source markup is a flat list of .faq-item children inside .faq-section,
 * which renders as a readable column without JS. faq-accordion.js detects
 * those sections, captures the Q/A pairs, and replaces the contents with
 * either a two-pane (desktop ≥ 769px) or accordion (≤ 768px) UI. The
 * faq--desktop / faq--mobile classes get toggled on the section by the JS,
 * and the resize handler re-renders if the breakpoint flips.
 *
 * Why two layouts: the master-detail two-pane reads cleaner on wide
 * monitors (you can scan all questions at once and read the active answer
 * on the right). Native <details> on mobile is the right ergonomics on a
 * narrow screen and works without listening to viewport changes — once
 * we render mobile mode the browser handles open/close itself.
 */

.faq-section {
	/* Fill the parent section (.section-white at 1200px max) so the FAQ
	   spans the same width as adjacent content sections rather than
	   reading as a narrower box. */
	max-width: 100%;
	margin: 32px auto 0;
}

/* ── Pre-enhancement (no JS, or JS blocked): readable column list ── */
.faq-section > .faq-item {
	border-bottom: 1px solid #e5e7eb;
	padding: 24px 0;
	max-width: 100%;
}
.faq-section > .faq-item:last-child {
	border-bottom: 0;
}
.faq-section > .faq-item h3 {
	margin: 0 0 12px 0;
	font-size: 1.15rem;
}
.faq-section > .faq-item p {
	margin: 0;
	color: #4b5563;
	line-height: 1.7;
}

/* ── Desktop: two-pane (questions left, answer right) ────────────────
   The grid uses align-items:stretch so the right answer panel
   matches the height of the left list (which has 6 question rows).
   Without stretch the panel collapsed to its content height, leaving
   a tall list next to a short panel. */

.faq-section.faq--desktop {
	text-align: left;
}

.faq-section.faq--desktop .faq-twopane {
	display: grid;
	grid-template-columns: minmax(260px, 340px) 1fr;
	gap: 28px;
	align-items: stretch;
}

.faq-section.faq--desktop .faq-list {
	display: flex;
	flex-direction: column;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	overflow: hidden;
	background: #ffffff;
}

.faq-section.faq--desktop .faq-q {
	display: block;
	width: 100%;
	text-align: left;
	background: #ffffff;
	border: 0;
	border-bottom: 1px solid #f0f1f3;
	padding: 16px 18px;
	font-size: 0.95rem;
	font-weight: 500;
	color: #374151;
	cursor: pointer;
	font-family: inherit;
	line-height: 1.4;
	transition: background 0.15s ease, color 0.15s ease;
}
.faq-section.faq--desktop .faq-q:last-child {
	border-bottom: 0;
}
.faq-section.faq--desktop .faq-q:hover {
	background: #f9fafb;
	color: #0a77ba;
}
.faq-section.faq--desktop .faq-q.is-active {
	background: #e8f4fb;
	color: #0a77ba;
	font-weight: 600;
}

.faq-section.faq--desktop .faq-panels {
	display: flex;
	flex-direction: column;
}

.faq-section.faq--desktop .faq-panel {
	display: none;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 32px;
}
.faq-section.faq--desktop .faq-panel.is-active {
	display: flex;
	flex-direction: column;
	flex: 1;
}
.faq-section.faq--desktop .faq-panel h3 {
	margin: 0 0 14px;
	font-size: 1.4rem;
	color: #191a1a;
}
.faq-section.faq--desktop .faq-panel p {
	margin: 0;
	color: #4b5563;
	line-height: 1.7;
	max-width: 100%;
}

/* ── Mobile: native <details> accordion ──────────────────────────── */

.faq-section.faq--mobile {
	text-align: left;
}

.faq-section.faq--mobile .faq-accordion {
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	overflow: hidden;
	background: #ffffff;
}

.faq-section.faq--mobile details {
	border-bottom: 1px solid #f0f1f3;
}
.faq-section.faq--mobile details:last-child {
	border-bottom: 0;
}

.faq-section.faq--mobile summary {
	padding: 16px 44px 16px 18px;
	font-size: 1rem;
	font-weight: 500;
	color: #191a1a;
	cursor: pointer;
	position: relative;
	list-style: none;
	line-height: 1.4;
}
.faq-section.faq--mobile summary::-webkit-details-marker {
	display: none;
}
.faq-section.faq--mobile summary::after {
	content: "+";
	position: absolute;
	right: 18px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 1.4rem;
	color: #0a77ba;
	font-weight: 400;
	line-height: 1;
}
.faq-section.faq--mobile details[open] summary::after {
	content: "−";
}
.faq-section.faq--mobile details[open] summary {
	background: #f9fafb;
	color: #0a77ba;
}
.faq-section.faq--mobile .faq-answer {
	padding: 4px 18px 20px;
	color: #4b5563;
	line-height: 1.7;
}
.faq-section.faq--mobile .faq-answer p {
	margin: 0;
}
