/**
 * Frontend FAQ section styles for the Product FAQ Generator plugin.
 *
 * All rules are scoped under .pfaqg-faq-section to minimise theme conflicts.
 * The <details>/<summary> pattern provides native open/close behaviour without
 * JavaScript. The JS accordion enhancement layer adds a pfaqg-open class for
 * themes that suppress native details disclosure styling.
 *
 * @package ProductFAQGenerator
 * @since   0.1.0
 */

/* =========================================================================
   Section wrapper
   ========================================================================= */

.pfaqg-faq-section {
	margin: 2em 0;
}

.pfaqg-faq-heading {
	font-size: 1.25em;
	font-weight: 600;
	margin-bottom: 1em;
}

/* =========================================================================
   FAQ list container
   ========================================================================= */

.pfaqg-faq-list {
	border-top: 1px solid #e0e0e0;
}

/* =========================================================================
   Individual FAQ item (<details>)
   ========================================================================= */

.pfaqg-faq-item {
	border-bottom: 1px solid #e0e0e0;
}

/* Remove the default browser disclosure triangle from <summary>. */
.pfaqg-faq-question {
	list-style: none;
	padding: 0.85em 2em 0.85em 0;
	cursor: pointer;
	font-weight: 500;
	position: relative;
	user-select: none;
}

.pfaqg-faq-question:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Cross-browser: WebKit also uses ::-webkit-details-marker. */
.pfaqg-faq-question::-webkit-details-marker {
	display: none;
}

/* Custom open/close indicator using a CSS ::before pseudo-element. */
.pfaqg-faq-question::before {
	content: "+";
	position: absolute;
	right: 0.25em;
	top: 50%;
	transform: translateY(-50%);
	font-size: 1.25em;
	line-height: 1;
	color: currentColor;
	transition: transform 0.2s ease;
}

/* Switch to "−" when the item is open — works via native [open] attribute
   and also via the .pfaqg-open class added by the JS enhancement layer. */
.pfaqg-faq-item[open] > .pfaqg-faq-question::before,
.pfaqg-faq-item.pfaqg-open > .pfaqg-faq-question::before {
	content: "\2212"; /* Unicode minus sign */
}

/* =========================================================================
   Answer panel (<div class="pfaqg-faq-answer">)
   ========================================================================= */

.pfaqg-faq-answer {
	padding: 0 0 1em 0;
	color: inherit;
}

.pfaqg-faq-answer p {
	margin: 0;
}
