/* ==========================================================================
   FAQ Accordion — reusable component
   Markup: .faq-accordion > .faq-accordion__item (repeatable) >
     .faq-accordion__heading > .faq-accordion__toggle (button, aria-expanded/
     aria-controls) + .faq-accordion__panel (id target, contains
     .faq-accordion__panel-inner with the answer markup).
   Behaviour (open/close, aria-expanded sync) lives in js/faq-accordion.js —
   both are enqueued together in functions.php. First usage:
   single-module-fahrradbox-3.php.
   ========================================================================== */

/* Title above the accordion (not a BEM element of .faq-accordion — it's a
   sibling, not a descendant). Centered per the reference design; the
   accordion questions/answers below stay left-aligned for readability. */
.faq-accordion-title {
	text-align: center;
	margin-bottom: 1.5rem;
}

/* Capped and centered — .faq-accordion sits in a full-width col-xl-12
   column, which the sitewide .wrapper widens up to 1560px on large
   desktops; without a cap, question/answer lines ran edge-to-edge and
   became unreadably long. */
.faq-accordion {
	max-width: 44rem;
	margin: 0 auto;
	border-top: 1px solid var(--lightgray);
}

.faq-accordion__item {
	border-bottom: 1px solid var(--lightgray);
}

.faq-accordion__heading {
	margin: 0;
}

.faq-accordion__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	width: 100%;
	padding: 1.25rem 0;
	background: none;
	border: none;
	font: inherit;
	font-size: 1.125rem;
	font-weight: 600;
	text-align: left;
	color: var(--black);
	cursor: pointer;
}

/* Outline only for keyboard focus, not a mouse click — a plain :focus rule
   fires on click too, which showed up as an unwanted ring around the button
   after mouse interaction. :focus-visible already tracks input modality. */
.faq-accordion__toggle:focus {
	outline: none;
}

.faq-accordion__toggle:focus-visible {
	outline: 2px solid var(--blue);
	outline-offset: 2px;
}

.faq-accordion__label {
	flex: 1;
}

/* Fixed-size icon box: the +/- glyph is built from two bars that never
   change size or position — only the vertical bar rotates. An earlier
   version swapped the text glyph itself ("+" -> "−"), which visibly
   jumped position because the two characters have different widths/optical
   centers. This keeps both states pixel-identical. */
.faq-accordion__icon {
	position: relative;
	flex-shrink: 0;
	width: 1.125rem;
	height: 1.125rem;
}

.faq-accordion__icon::before,
.faq-accordion__icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 100%;
	height: 2px;
	background: var(--black);
	transform: translate(-50%, -50%);
}

.faq-accordion__icon::after {
	transform: translate(-50%, -50%) rotate(90deg);
	transition: transform .25s ease;
}

.faq-accordion__item.is-open .faq-accordion__icon::after {
	/* Rotating flat onto the horizontal bar (::before) reads as "-" —
	   same two bars as the "+" state, just re-oriented, so nothing moves. */
	transform: translate(-50%, -50%) rotate(0deg);
}

/* Expand/collapse via grid-template-rows (0fr -> 1fr) rather than
   height/max-height — animates to the panel's real content height without
   JS measuring it. Per spec, a grid item's automatic minimum size resolves
   to 0 (instead of its min-content size) when the item's overflow is not
   `visible`, which is exactly what lets the 0fr row collapse to nothing;
   .faq-accordion__panel-inner carries the overflow:hidden that makes that
   apply. */
.faq-accordion__panel {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows .3s ease;
}

/* visibility (not just the grid row collapsing to 0 height) is the actual
   guarantee against the collapsed panel's text peeking through: some
   browsers don't fully apply the spec rule that a grid item's automatic
   minimum size is 0 when its overflow isn't visible, so the 0fr row can
   retain a sliver of the item's min-content height. visibility:hidden also
   removes the (still-in-DOM) answer content — including any link inside
   it — from the tab order while collapsed, which plain overflow:hidden does
   not. Delayed on close (only hides once the .3s collapse finishes) but
   instant on open, so content is visible for the whole grow animation. */
.faq-accordion__panel-inner {
	overflow: hidden;
	visibility: hidden;
	transition: visibility 0s linear .3s;
}

.faq-accordion__item.is-open .faq-accordion__panel {
	grid-template-rows: 1fr;
}

.faq-accordion__item.is-open .faq-accordion__panel-inner {
	visibility: visible;
	transition-delay: 0s;
}

.faq-accordion__panel-inner {
	padding: 0 2rem 1.25rem 0;
}

.faq-accordion__panel-inner>:first-child {
	margin-top: 0;
}

.faq-accordion__panel-inner>:last-child {
	margin-bottom: 0;
}

/* Links inside FAQ answers get the same animated-underline treatment as the
   sitewide .linkaHp helper, scoped here so answer content doesn't need an
   extra class on every link. */
.faq-accordion__panel a {
	color: var(--blue);
	font-weight: 600;
	background-image: linear-gradient(var(--transblue), var(--transblue)), linear-gradient(var(--blue), var(--blue));
	background-size: 100% 2px, 0 2px;
	background-position: 100% 100%, 0 100%;
	background-repeat: no-repeat;
	padding-bottom: 4px;
	transition: background-size .5s cubic-bezier(.65, .05, .36, 1);
}

.faq-accordion__panel a:hover,
.faq-accordion__panel a:focus-visible {
	background-size: 0 2px, 100% 2px;
}

@media (prefers-reduced-motion: reduce) {

	.faq-accordion__icon::after,
	.faq-accordion__panel,
	.faq-accordion__panel-inner {
		transition: none;
	}
}
