/**
 * Styles du Widget FAQ Accordion
 *
 * Styles pour l'accordéon FAQ avec support complet
 * des animations et états actifs/inactifs.
 *
 * @package Widget_Dix_Elementor
 * @subpackage Widgets\FAQ
 * @since 1.0.0
 */

/* ========================================
   Container principal
   ======================================== */

.faq-accordion-wrapper {
	width: 100%;
	display: flex;
	flex-direction: column;
}

/* ========================================
   Items FAQ
   ======================================== */

.faq-item {
	overflow: hidden;
	transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* ========================================
   Titre (clickable)
   ======================================== */

.faq-title-wrapper {
	display: flex;
	align-items: center;
	cursor: pointer;
	user-select: none;
	transition: all 0.3s ease;
	position: relative;
}

/* Position de l'icône */
.icon-left .faq-title-wrapper {
	flex-direction: row;
}

.icon-right .faq-title-wrapper {
	flex-direction: row;
	justify-content: space-between;
}

.faq-title {
	margin: 0;
	flex: 1;
	transition: color 0.3s ease;
}

/* Hover effect */
.faq-title-wrapper:hover {
	opacity: 0.85;
}

/* Focus accessibility */
.faq-title-wrapper:focus {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* ========================================
   Icône
   ======================================== */

.faq-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: all 0.3s ease;
	line-height: 1;
}

.faq-icon svg {
	display: block;
	transition: transform 0.3s ease, fill 0.3s ease;
}

/* Rotation de l'icône pour certains types (chevron, angle) */
.faq-item.active .faq-icon svg.fa-chevron-down,
.faq-item.active .faq-icon svg.fa-angle-down,
.faq-item.active .faq-icon svg.fa-caret-down {
	transform: rotate(180deg);
}

/* ========================================
   Contenu
   ======================================== */

.faq-content-wrapper {
	overflow: hidden;
	transition: max-height 0.4s ease, opacity 0.3s ease;
	max-height: 0;
	opacity: 0;
}

.faq-item.active .faq-content-wrapper {
	max-height: 5000px; /* Valeur haute pour permettre n'importe quelle hauteur */
	opacity: 1;
}

.faq-content {
	transition: padding 0.3s ease;
}

/* Styles par défaut du contenu */
.faq-content p {
	margin: 0 0 1em 0;
}

.faq-content p:last-child {
	margin-bottom: 0;
}

.faq-content ul,
.faq-content ol {
	margin: 0 0 1em 0;
	padding-left: 1.5em;
}

.faq-content ul:last-child,
.faq-content ol:last-child {
	margin-bottom: 0;
}

.faq-content li {
	margin-bottom: 0.5em;
}

.faq-content li:last-child {
	margin-bottom: 0;
}

/* Styles pour listes à puces personnalisées (losanges bleus comme dans la capture) */
.faq-content ul {
	list-style: none;
}

.faq-content ul li {
	position: relative;
	padding-left: 1.5em;
}

.faq-content ul li::before {
	content: '◆';
	position: absolute;
	left: 0;
	color: currentColor;
	font-size: 0.8em;
	line-height: inherit;
}

/* ========================================
   États et animations
   ======================================== */

/* Animation d'ouverture smooth */
@keyframes faqSlideDown {
	from {
		max-height: 0;
		opacity: 0;
	}
	to {
		max-height: 5000px;
		opacity: 1;
	}
}

@keyframes faqSlideUp {
	from {
		max-height: 5000px;
		opacity: 1;
	}
	to {
		max-height: 0;
		opacity: 0;
	}
}

.faq-content-wrapper.animating-open {
	animation: faqSlideDown 0.4s ease forwards;
}

.faq-content-wrapper.animating-close {
	animation: faqSlideUp 0.4s ease forwards;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
	/* Ajustements mobiles si nécessaire */
	.faq-title-wrapper {
		flex-wrap: nowrap;
	}

	.faq-title {
		font-size: 0.95em;
	}

	.faq-content {
		font-size: 0.9em;
	}
}

@media (max-width: 480px) {
	.faq-icon {
		font-size: 0.9em;
	}
}

/* ========================================
   Accessibilité
   ======================================== */

/* Support pour prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
	.faq-item,
	.faq-title-wrapper,
	.faq-title,
	.faq-icon,
	.faq-icon svg,
	.faq-content-wrapper,
	.faq-content {
		transition: none;
		animation: none;
	}
}

/* High contrast mode support */
@media (prefers-contrast: high) {
	.faq-title-wrapper:focus {
		outline-width: 3px;
	}
}

/* ========================================
   Print styles
   ======================================== */

@media print {
	.faq-content-wrapper {
		display: block !important;
		max-height: none !important;
		opacity: 1 !important;
	}

	.faq-item {
		page-break-inside: avoid;
	}
}
