/*
 * Bridge: editorial pages.
 *
 * pages.css covers the About, Contact and FAQ layouts from the design preview.
 * Two things it does not cover are added here:
 *
 *   1. The FAQ accordion. The prototype scripted its own open/close; this build
 *      uses <details>/<summary>, so every answer stays expandable, readable and
 *      findable by browser search with no JavaScript. That needs its own rules.
 *   2. The contact form's server-rendered success and error states, which the
 *      prototype toggled in JS.
 *
 * All values come from the design tokens.
 */

/* ---------------------------------------------------------------------------
 * FAQ groups
 * ------------------------------------------------------------------------- */
.faq-group + .faq-group {
	margin-top: 56px;
}

.faq-group h2 {
	font-family: var(--font-display);
	font-size: 26px;
	color: var(--text-on-base-heading);
	margin: 0 0 6px;
}

.faq-group__lede {
	font-size: 14px;
	color: var(--text-on-base-muted);
	margin: 0 0 20px;
}

/* ---------------------------------------------------------------------------
 * Accordion
 * ------------------------------------------------------------------------- */
.faq-item {
	border-bottom: 1px solid var(--hairline-on-base);
}

.faq-item summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 0;
	cursor: pointer;
	font-family: var(--font-sans);
	font-size: 15px;
	color: var(--text-on-base);
	list-style: none;
}

/* Both engines draw their own marker; the design uses a chevron instead. */
.faq-item summary::-webkit-details-marker {
	display: none;
}

.faq-item summary::marker {
	content: "";
}

.faq-item summary:hover {
	color: var(--text-on-base-heading);
}

.faq-item summary svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	color: var(--text-on-base-muted);
	transition: transform .2s ease;
}

.faq-item[open] summary {
	color: var(--text-on-base-heading);
}

.faq-item[open] summary svg {
	transform: rotate(180deg);
}

.faq-item__body {
	padding: 0 0 20px;
	max-width: 68ch;
}

.faq-item__body p {
	font-size: 14px;
	line-height: 1.75;
	color: var(--text-on-base-muted);
	margin: 0;
}

/* ---------------------------------------------------------------------------
 * FAQ side nav
 * ------------------------------------------------------------------------- */
.faq-nav {
	position: sticky;
	top: 24px;
	align-self: start;
	display: grid;
	gap: 2px;
}

.faq-nav a {
	display: block;
	padding: 10px 14px;
	border-radius: var(--radius-pill);
	font-size: 13px;
	color: var(--text-on-base-muted);
	text-decoration: none;
}

.faq-nav a:hover {
	background: var(--pill-bg);
	color: var(--text-on-base);
}

.faq-nav a.is-active {
	background: var(--pill-active-bg);
	color: var(--pill-active-text);
}

@media (max-width: 900px) {
	.faq-nav {
		position: static;
		grid-auto-flow: column;
		grid-auto-columns: max-content;
		overflow-x: auto;
		gap: 8px;
		margin-bottom: 28px;
		scrollbar-width: none;
	}

	.faq-nav::-webkit-scrollbar {
		display: none;
	}

	.faq-nav a {
		white-space: nowrap;
		border: 1px solid var(--pill-border);
	}
}

/* Anchored sections should not land under the sticky header. */
.faq-group,
#fabric,
#craft {
	scroll-margin-top: 100px;
}

/* ---------------------------------------------------------------------------
 * Contact form states
 *
 * The prototype toggled these in JS. Here the server decides which to render
 * after the redirect, so they only need styling.
 * ------------------------------------------------------------------------- */
.info-panel .error {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--state-error);
	background: rgba( 140, 74, 61, .12 );
	border: 1px solid var(--state-error);
	border-radius: var(--radius-md);
	padding: 12px 14px;
	margin-bottom: 18px;
}

.info-panel .error svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.form-success {
	text-align: center;
	padding: 24px 0;
}

.form-success__tick {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--state-success);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 18px;
}

.form-success__tick svg {
	width: 26px;
	height: 26px;
}

/* The +880 prefix is a sibling of the input, not part of its value, so what the
   handler validates stays the 11 local digits. */
.phone-wrap {
	position: relative;
	display: block;
}

.phone-prefix {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 15px;
	color: var(--text-on-base-muted);
	pointer-events: none;
}

.phone-wrap input {
	padding-left: 62px;
}

/* ---------------------------------------------------------------------------
 * Shared field styling for the editorial forms
 * ------------------------------------------------------------------------- */
.info-panel input[type="text"],
.info-panel input[type="tel"],
.info-panel input[type="email"],
.info-panel select,
.info-panel textarea {
	width: 100%;
	font-family: var(--font-sans);
	font-size: 15px;
	color: var(--text-on-base);
	background: var(--pill-bg);
	border: 1px solid var(--surface-inverse-control-border);
	border-radius: var(--radius-sm);
	padding: 12px 14px;
}

.info-panel select {
	appearance: none;
	-webkit-appearance: none;
}

.select-arrow {
	position: relative;
}

.select-arrow svg {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 15px;
	height: 15px;
	pointer-events: none;
	color: var(--text-on-base-muted);
}

.info-panel label {
	display: block;
	font-size: 11px;
	letter-spacing: var(--tracking-wider);
	text-transform: uppercase;
	color: var(--text-on-base-muted);
	margin-bottom: 7px;
}

.info-panel .req {
	color: var(--taupe-400);
}
