/*
 * FAQ (template-parts/components/faq.php). Home „Przed przyjazdem”, from
 * the preview docs/preview/new_home7_2.png: heading with a rule, then
 * full-width rows split by thin lines, a brown „+” on the right that turns
 * into „−” when the answer is open. The „boxed” variant (Kontakt „Zanim
 * napiszesz”, docs/preview/kontakt.png) at the end of the file.
 */

.hf-faq
{
	padding-block: var(--hf-space-section-block);
}

.hf-faq__header
{
	margin-bottom: clamp(1.25rem, 0.9rem + 1vw, 2rem);
}

.hf-faq__eyebrow
{
	margin-bottom: var(--hf-space-s);
}

.hf-faq__title
{
	margin: 0;
	font-size: var(--hf-text-h2-s);
}

/* Uważność: as the other headings of that page (about 43 px in its preview at 1440). */
.hf-faq__title--m
{
	font-size: var(--hf-text-h2-m);
}

.hf-faq__item
{
	border-top: 1px solid var(--hf-color-card-border);
}

.hf-faq__item:last-child
{
	border-bottom: 1px solid var(--hf-color-card-border);
}

.hf-faq__question
{
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--hf-space-m);
	padding-block: clamp(0.85rem, 0.7rem + 0.4vw, 1.15rem);
	color: var(--hf-color-heading);
	cursor: pointer;
	font-size: clamp(1.0625rem, 0.95rem + 0.45vw, 1.375rem);
	line-height: 1.35;
	list-style: none;
}

/* Safari still draws its own triangle. */
.hf-faq__question::-webkit-details-marker
{
	display: none;
}

.hf-faq__question:hover .hf-faq__question-text
{
	color: var(--hf-color-primary-hover);
}

.hf-faq__question:focus-visible
{
	outline: 3px solid var(--hf-color-focus);
	outline-offset: 2px;
}

/* „+” from two lines; the vertical one folds away into „−” when open.
   Whole pixels (18 px box, 2 px lines), so the lines stay sharp. */
.hf-faq__icon
{
	position: relative;
	flex: none;
	width: 1.125rem;
	height: 1.125rem;
	color: var(--hf-color-primary);
}

.hf-faq__icon::before,
.hf-faq__icon::after
{
	position: absolute;
	top: calc(50% - 1px);
	left: 0;
	width: 100%;
	height: 2px;
	background: currentColor;
	content: "";
	transition: transform var(--hf-transition);
}

.hf-faq__icon::after
{
	transform: rotate(90deg);
}

.hf-faq__item[open] .hf-faq__icon::after
{
	transform: rotate(0deg);
}

.hf-faq__answer
{
	max-width: 48em;
	padding-bottom: var(--hf-space-m);
	font-size: var(--hf-text-m);
	line-height: var(--hf-leading-text);
}

.hf-faq__answer p
{
	margin: 0;
}

.hf-faq__answer p + p
{
	margin-top: var(--hf-space-s);
}

/* Smooth opening where the browser can animate to height: auto. */
@supports (interpolate-size: allow-keywords)
{
	@media (prefers-reduced-motion: no-preference)
	{
		.hf-faq__item
		{
			interpolate-size: allow-keywords;
		}

		.hf-faq__item::details-content
		{
			overflow: hidden;
			block-size: 0;
			transition: block-size 250ms ease, content-visibility 250ms allow-discrete;
		}

		.hf-faq__item[open]::details-content
		{
			block-size: auto;
		}
	}
}

/* Optional text under the heading and link under an answer (Kontakt). */
.hf-faq__lead
{
	margin: var(--hf-space-m) 0 0;
	font-size: var(--hf-text-l);
	line-height: 1.45;
}

.hf-faq__answer .hf-text-link
{
	margin-top: var(--hf-space-s);
}

/*
 * „Boxed” (Kontakt „Zanim napiszesz”): every question in its own light
 * frame, small gaps between them, the „+” in the heading colour. With a
 * mouse the question row turns to the button colours; an open question
 * keeps a warm background, so the chosen one stands out (user, 2026-10-28).
 * The row and the answer carry the side padding, so the hover colour fills
 * the frame.
 */
.hf-faq--boxed .hf-faq__list
{
	display: grid;
	gap: 0.625rem;
}

.hf-faq--boxed .hf-faq__item,
.hf-faq--boxed .hf-faq__item:last-child
{
	--hf-faq-pad: clamp(1rem, 0.6rem + 1.2vw, 2rem);

	border: 1px solid color-mix(in srgb, var(--hf-color-field-border) 30%, var(--hf-color-surface));
	border-radius: var(--hf-radius-s);
	background: var(--hf-color-surface);
	transition: background-color var(--hf-transition);
}

.hf-faq--boxed .hf-faq__item[open]
{
	background: var(--hf-color-band);
}

.hf-faq--boxed .hf-faq__question
{
	padding: clamp(0.9rem, 0.75rem + 0.45vw, 1.25rem) var(--hf-faq-pad);
	border-radius: calc(var(--hf-radius-s) - 1px);
	transition: background-color var(--hf-transition), color var(--hf-transition);
}

.hf-faq--boxed .hf-faq__item[open] .hf-faq__question
{
	border-end-start-radius: 0;
	border-end-end-radius: 0;
}

.hf-faq--boxed .hf-faq__answer
{
	padding-inline: var(--hf-faq-pad);
}

.hf-faq--boxed .hf-faq__icon
{
	color: var(--hf-color-heading);
}

/* Mouse only: on touch screens a tapped row would stay inverted. */
@media (hover: hover)
{
	.hf-faq--boxed .hf-faq__question:hover
	{
		background: var(--hf-color-primary);
		color: var(--hf-color-on-dark);
	}

	.hf-faq--boxed .hf-faq__question:hover .hf-faq__question-text,
	.hf-faq--boxed .hf-faq__question:hover .hf-faq__icon
	{
		color: inherit;
	}
}
