/**
 * Juni FAQ — Frontend CSS
 *
 * Skopas under .juni-faq för att inte påverka annan styling.
 * Variabler sätts inline från PHP utifrån modulens färginställningar.
 */

.juni-faq {
	color: var(--juni-faq-text, #1A1D1B);
	max-width: 100%;
}

.juni-faq *,
.juni-faq *::before,
.juni-faq *::after {
	box-sizing: border-box;
}

.juni-faq__heading {
	font-family: 'Instrument Serif', Georgia, serif;
	font-weight: 400;
	margin: 0 0 1.5rem;
	line-height: 1.2;
	color: var(--juni-faq-text);
}

.juni-faq__list {
	display: flex;
	flex-direction: column;
}

/* ==========================================================================
   Accordion-läge — bygger på native <details>/<summary>
   ========================================================================== */

.juni-faq--accordion .juni-faq__item {
	border-top: 1px solid color-mix(in srgb, var(--juni-faq-border) 15%, transparent);
}

.juni-faq--accordion .juni-faq__item:last-child {
	border-bottom: 1px solid color-mix(in srgb, var(--juni-faq-border) 15%, transparent);
}

.juni-faq__question {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.25rem 0.25rem;
	cursor: pointer;
	font-size: 1.05rem;
	font-weight: 500;
	line-height: 1.4;
	color: var(--juni-faq-text);
	list-style: none;
}

/* Dölj default-pilen i Chrome/Safari — vi använder vår egen chevron */
.juni-faq__question::-webkit-details-marker {
	display: none;
}
.juni-faq__question::marker {
	display: none;
	content: '';
}

/* Ingen färg-shift på hover — chevronens rotation räcker som feedback.
   Hover-tonar bara chevronen (lite mer opaque) för att markera klickbarheten. */
.juni-faq__question:hover .juni-faq__chevron {
	opacity: 1;
}

.juni-faq__question:focus-visible {
	outline: 2px solid var(--juni-faq-accent);
	outline-offset: 2px;
	border-radius: 4px;
}

.juni-faq__question-text {
	flex: 1 1 auto;
	min-width: 0;
}

.juni-faq__chevron {
	flex: 0 0 auto;
	color: var(--juni-faq-text);
	opacity: 0.6;
	transition: transform 0.25s ease, opacity 0.15s ease;
}

.juni-faq__item[open] .juni-faq__chevron {
	transform: rotate(180deg);
	opacity: 1;
	color: var(--juni-faq-text);
}

.juni-faq__answer {
	padding: 0 0.25rem 1.5rem;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--juni-faq-text);
}

/* Återställ marginal för det första elementet i svaret så det startar tight */
.juni-faq__answer > *:first-child {
	margin-top: 0;
}
.juni-faq__answer > *:last-child {
	margin-bottom: 0;
}

/* Länkar inuti svar — diskret understruken, accent-färg på hover */
.juni-faq__answer a {
	color: var(--juni-faq-text);
	text-decoration: underline;
	text-decoration-color: color-mix(in srgb, var(--juni-faq-text) 35%, transparent);
	text-underline-offset: 3px;
	transition: text-decoration-color 0.15s ease;
}

.juni-faq__answer a:hover,
.juni-faq__answer a:focus-visible {
	text-decoration-color: var(--juni-faq-accent);
}

/* Listor i svar */
.juni-faq__answer ul,
.juni-faq__answer ol {
	padding-left: 1.25rem;
	margin: 0.5rem 0;
}

.juni-faq__answer li + li {
	margin-top: 0.25rem;
}

/* ==========================================================================
   Statiskt läge — alla frågor öppna
   ========================================================================== */

.juni-faq--static .juni-faq__item--static {
	padding: 1.25rem 0;
	border-top: 1px solid color-mix(in srgb, var(--juni-faq-border) 15%, transparent);
}

.juni-faq--static .juni-faq__item--static:last-child {
	border-bottom: 1px solid color-mix(in srgb, var(--juni-faq-border) 15%, transparent);
}

.juni-faq__question--static {
	font-family: inherit;
	font-size: 1.1rem;
	font-weight: 600;
	margin: 0 0 0.5rem;
	color: var(--juni-faq-text);
	line-height: 1.4;
}

.juni-faq--static .juni-faq__answer {
	padding: 0;
}

/* ==========================================================================
   Mobilanpassning
   ========================================================================== */

@media (max-width: 640px) {
	.juni-faq__question {
		font-size: 1rem;
		padding: 1rem 0.25rem;
	}

	.juni-faq__answer {
		font-size: 0.95rem;
	}
}
