/**
 * Transforme le bloc accordéon Ultimate Blocks (ub/content-toggle-block) en
 * slider : la ligne titre + chevron de chaque panneau est masquée, une
 * nouvelle barre d'onglets défilante est injectée en JS au-dessus du bloc.
 */

.fsjm-archive-slider .wp-block-ub-content-toggle-accordion-title-wrap {
	display: none;
}

.fsjm-archive-slider .wp-block-ub-content-toggle-accordion {
	border: 0 !important;
	margin: 0 !important;
}

.fsjm-archive-slider__panel-hidden {
	display: none !important;
}

.fsjm-archive-slider__nav {
	display: flex;
	align-items: stretch;
	gap: 0.5rem;
	margin: 0 0 1.5rem;
}

.fsjm-archive-slider__track {
	display: flex;
	flex: 1 1 auto;
	gap: 0.5rem;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scroll-behavior: smooth;
	/* No visible scrollbar: dedicated prev/next buttons drive scrolling, and
	   a scrollbar row would make the track (and the stretched arrows next
	   to it) taller than the tab buttons themselves. */
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.fsjm-archive-slider__track::-webkit-scrollbar {
	display: none;
}

.fsjm-archive-slider__tab {
	flex: 0 0 calc(20% - 0.4rem);
	min-width: 100px;
	scroll-snap-align: start;
	border: 1px solid #dcdcdc;
	border-radius: 8px;
	background: #f3f3f3;
	color: #000;
	padding: 0.75rem 0.5rem;
	font-family: var(--fsjm-sans, inherit);
	font-weight: 700;
	font-size: 0.9rem;
	line-height: 1.25;
	text-align: center;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.fsjm-archive-slider__heading {
	/* Matches the 4% left padding Ultimate Blocks applies to the panel's own
	   content wrapper, so the heading lines up with the text below it. */
	margin: 0 0 1rem;
	padding-left: 4%;
}

.fsjm-archive-slider__tab:hover {
	border-color: var(--wp--preset--color--accent-3, #503aa8);
}

.fsjm-archive-slider__tab.is-active {
	background: var(--wp--preset--color--accent-3, #503aa8);
	border-color: var(--wp--preset--color--accent-3, #503aa8);
	color: #fff;
}

.fsjm-archive-slider__arrow {
	flex: 0 0 auto;
	width: 2.5rem;
	border: 1px solid #dcdcdc;
	border-radius: 8px;
	background: #fff;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.fsjm-archive-slider__arrow:hover {
	border-color: var(--wp--preset--color--accent-3, #503aa8);
}

.fsjm-archive-slider__arrow:disabled {
	opacity: 0.35;
	cursor: default;
}

@media (max-width: 782px) {
	.fsjm-archive-slider__tab {
		flex-basis: calc(45% - 0.4rem);
		min-width: 100px;
		font-size: 0.85rem;
	}
}
