/* Formation Widget Styles */
.lyode-formation-wrapper {
	position: relative;
	width: 100%;
}

/* Grid Layout — mosaïque 4 colonnes, une hauteur de ligne par carte (plus de colonne gauche pleine hauteur) */
.lyode-formation-grid-wrapper {
	width: 100%;
}

.lyode-formation-mosaic {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	grid-auto-rows: minmax(250px, auto);
	gap: 20px;
	width: 100%;
	align-items: stretch;
}

.lyode-formation-mosaic .lyode-formation-card {
	min-height: 250px;
	width: 100%;
}

/* ——— Desktop : motifs selon le nombre de formations (grille 4 colonnes) ——— */

/* 1 carte : pleine largeur */
.lyode-formation-mosaic--count-1 .lyode-formation-card:nth-child(1) {
	grid-column: span 4;
}

/* 2 cartes : deux demi-larges côte à côte */
.lyode-formation-mosaic--count-2 .lyode-formation-card:nth-child(1),
.lyode-formation-mosaic--count-2 .lyode-formation-card:nth-child(2) {
	grid-column: span 2;
}

/* 3 cartes : 2 + 1 + 1 */
.lyode-formation-mosaic--count-3 .lyode-formation-card:nth-child(1) {
	grid-column: span 2;
	grid-row: span 1;
}
.lyode-formation-mosaic--count-3 .lyode-formation-card:nth-child(2),
.lyode-formation-mosaic--count-3 .lyode-formation-card:nth-child(3) {
	grid-column: span 1;
	grid-row: span 1;
	aspect-ratio: 1 / 1;
}

/* 4 cartes : 2×2 (deux larges par ligne) */
.lyode-formation-mosaic--count-4 .lyode-formation-card:nth-child(1),
.lyode-formation-mosaic--count-4 .lyode-formation-card:nth-child(2),
.lyode-formation-mosaic--count-4 .lyode-formation-card:nth-child(3),
.lyode-formation-mosaic--count-4 .lyode-formation-card:nth-child(4) {
	grid-column: span 2;
	grid-row: span 1;
}

/* 5 cartes : ligne 1 = 2+1+1, ligne 2 = 2+2 */
.lyode-formation-mosaic--count-5 .lyode-formation-card:nth-child(1) {
	grid-column: span 2;
	grid-row: span 1;
}
.lyode-formation-mosaic--count-5 .lyode-formation-card:nth-child(2),
.lyode-formation-mosaic--count-5 .lyode-formation-card:nth-child(3) {
	grid-column: span 1;
	grid-row: span 1;
	aspect-ratio: 1 / 1;
}
.lyode-formation-mosaic--count-5 .lyode-formation-card:nth-child(4),
.lyode-formation-mosaic--count-5 .lyode-formation-card:nth-child(5) {
	grid-column: span 2;
	grid-row: span 1;
}

/* 6 cartes : ligne 1 = 2+1+1, ligne 2 = 1+2+1 */
.lyode-formation-mosaic--count-6 .lyode-formation-card:nth-child(1) {
	grid-column: span 2;
	grid-row: span 1;
}
.lyode-formation-mosaic--count-6 .lyode-formation-card:nth-child(2),
.lyode-formation-mosaic--count-6 .lyode-formation-card:nth-child(3) {
	grid-column: span 1;
	grid-row: span 1;
	aspect-ratio: 1 / 1;
}
.lyode-formation-mosaic--count-6 .lyode-formation-card:nth-child(4) {
	grid-column: span 1;
	grid-row: span 1;
	aspect-ratio: 1 / 1;
}
.lyode-formation-mosaic--count-6 .lyode-formation-card:nth-child(5) {
	grid-column: span 2;
	grid-row: span 1;
}
.lyode-formation-mosaic--count-6 .lyode-formation-card:nth-child(6) {
	grid-column: span 1;
	grid-row: span 1;
	aspect-ratio: 1 / 1;
}

/* 7+ cartes : tuiles égales 1×1, 4 par ligne */
.lyode-formation-mosaic--count-many .lyode-formation-card {
	grid-column: span 1;
	grid-row: span 1;
	aspect-ratio: 1 / 1;
}

/* Tablette / petit desktop : 2 colonnes, cartes uniformes */
@media (max-width: 1400px) {
	.lyode-formation-mosaic {
		grid-template-columns: repeat(2, 1fr);
		grid-auto-rows: minmax(250px, 1fr);
	}

	.lyode-formation-mosaic .lyode-formation-card {
		grid-column: span 1 !important;
		grid-row: span 1 !important;
		aspect-ratio: 1 / 1;
	}

	/* Une seule formation : pleine largeur (évite une carte sur une demi-grille) */
	.lyode-formation-mosaic--count-1 .lyode-formation-card:nth-child(1) {
		grid-column: 1 / -1 !important;
	}
}

@media (max-width: 480px) {
	.lyode-formation-mosaic {
		grid-template-columns: 1fr;
		grid-auto-rows: minmax(250px, 1fr);
		gap: 20px;
	}

	.lyode-formation-mosaic .lyode-formation-card {
		grid-column: span 1 !important;
		grid-row: span 1 !important;
		aspect-ratio: 1 / 1;
	}
}

/* Carousel Layout */
.lyode-formation-carousel {
	position: relative;
}

.lyode-formation-carousel .lyode-formation-container {
	display: flex;
	overflow: hidden;
	gap: 20px;
	scroll-behavior: smooth;
}

.lyode-formation-carousel .lyode-formation-container::-webkit-scrollbar {
	display: none;
}

.lyode-formation-carousel .lyode-formation-container {
	-ms-overflow-style: none;
	scrollbar-width: none;
}

/* Carousel Cards - Same style as grid */
.lyode-formation-carousel .lyode-formation-card {
	flex-shrink: 0;
	min-height: 350px;
	height: 350px;
}

/* Carousel Navigation */
.lyode-carousel-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background-color: #FECD03;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	transition: opacity 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.lyode-carousel-nav:hover {
	opacity: 0.9;
	transform: translateY(-50%) scale(1.05);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.lyode-carousel-nav:active {
	transform: translateY(-50%) scale(0.95);
}

.lyode-carousel-nav:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: translateY(-50%);
}

.lyode-carousel-nav svg,
.lyode-carousel-nav img {
	width: 30px;
    height: 30px;
    display: block;
    filter: brightness(100) invert(1);
}

.lyode-carousel-prev {
	left: -24px;
}

.lyode-carousel-prev img {
	transform: rotate(180deg);
}

.lyode-carousel-next {
	right: -24px;
}

@media (max-width: 768px) {
	.lyode-carousel-prev {
		left: 10px;
	}
	
	.lyode-carousel-next {
		right: 10px;
	}
	
	/* Carousel cards responsive - keep 350px minimum even on mobile */
	.lyode-formation-carousel .lyode-formation-card {
		min-height: 350px;
		height: 350px;
	}
}

/* Card Styles */
.lyode-formation-card {
	position: relative;
	border-radius: 12px;
	overflow: hidden;
	width: 100%;
	height: 100%;
	min-height: 250px;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	background-color: #f0f0f0;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
	-webkit-transition: all 0.2s ease-out;
	-moz-transition: all 0.2s ease-out;
	-o-transition: all 0.2s ease-out;
	transition: all 0.2s ease-out;
}

.lyode-formation-link {
	display: block;
	width: 100%;
	height: 100%;
	text-decoration: none;
	color: inherit;
	position: relative;
}

/* Image Container */
.lyode-formation-image {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.lyode-formation-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Gradient Overlay */
/* Dégradé couvrant environ 30-40% du bas de la carte */
.lyode-formation-overlay {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 40%;
	/* Dégradé simple du noir opaque (bas) vers transparent (haut) */
	background: linear-gradient(to top, 
		rgba(0, 0, 0, 0.95) 0%,
		rgba(0, 0, 0, 0.85) 20%,
		rgba(0, 0, 0, 0.6) 50%,
		rgba(0, 0, 0, 0.3) 75%,
		rgba(0, 0, 0, 0) 100%
	);
	pointer-events: none;
	z-index: 1;
	-webkit-transition: all 0.2s ease-out;
	-moz-transition: all 0.2s ease-out;
	-o-transition: all 0.2s ease-out;
	transition: all 0.2s ease-out;
}
.lyode-formation-card:hover .lyode-formation-overlay{
	height: 100%;
	background: #fecd03;
}
.lyode-formation-card:hover .lyode-formation-image img{
	/*transform: scale(1.05);*/
}
.lyode-formation-card:hover .lyode-formation-description{
	color: #000!important;
}

.lyode-formation-card:hover .lyode-formation-title {
	color: #000!important;
	margin: 0;
}
.lyode-formation-card:hover .lyode-formation-arrow img{
	filter: brightness(0);
	transform: scale(1.3);
	transition: all 0.2s ease;
	-webkit-transition: all 0.2s ease;
	-moz-transition: all 0.2s ease;
	-o-transition: all 0.2s ease;
}
.lyode-formation-arrow img{
	transition: all 0.2s ease;
	-webkit-transition: all 0.2s ease;
	-moz-transition: all 0.2s ease;
	-o-transition: all 0.2s ease;
}
.lyode-formation-card .lyode-formation-image img{
	-webkit-transition: all 0.2s ease-out;
	-moz-transition: all 0.2s ease-out;
	-o-transition: all 0.2s ease-out;
	transition: all 0.2s ease-out;
}
/* Content Container */
.lyode-formation-content {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 20px;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 15px;
	z-index: 2;
}

/* Title */
.lyode-formation-title {
	font-size: 30px;
	line-height: 32px;
	color: #ffffff;
	margin: 0;
	font-weight: 600;
	/*word-wrap: break-word;
	hyphens: auto;*/
	-webkit-transition: all 0.2s ease-out;
	-moz-transition: all 0.2s ease-out;
	-o-transition: all 0.2s ease-out;
	transition: all 0.2s ease-out;
}

/* Title in text wrapper (for subpages) */
.lyode-formation-text-wrapper .lyode-formation-title {
	flex: 0 0 auto;
}

/* Arrow */
.lyode-formation-arrow {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.3s ease;
	margin-left: auto;
}

.lyode-formation-card:hover .lyode-formation-arrow {
	transform: translateX(5px);
}

.lyode-formation-arrow img {
	width: 40px;
	height: 40px;
	display: block;
	flex-shrink: 0;
}

/* Responsive */
@media (max-width: 1600px) {
	.lyode-formation-title {
    	font-size: 23px;
		line-height: 25px;
	}
}
@media (max-width: 768px) {
	.lyode-formation-title {
		font-size: 24px;
		line-height: 26px;
	}
	
	.lyode-formation-content {
		padding: 15px;
	}
	
	.lyode-formation-arrow img {
		width: 32px;
		height: 32px;
	}
}

@media (max-width: 480px) {
	.lyode-formation-title {
		font-size: 20px;
		line-height: 22px;
	}
	
	.lyode-formation-content {
		padding: 12px;
	}
}

/* Subpages Grid Layout - Grille standard 3 colonnes */
.lyode-formation-subpages-grid {
	width: 100%;
}

.lyode-formation-subpages-container {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
	width: 100%;
}

.lyode-formation-subpages-container .lyode-formation-card {
	min-height: 300px;
	aspect-ratio: 1 / 1;
}

/* Text wrapper for title and description */
.lyode-formation-text-wrapper {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* Description text */
.lyode-formation-description {
	font-size: 14px;
	line-height: 1.5;
	color: #ffffff;
	margin: 0;
	opacity: 0.95;
}

/* Responsive - Subpages Grid */
@media (max-width: 1024px) {
	.lyode-formation-subpages-container {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 768px) {
	.lyode-formation-subpages-container {
		grid-template-columns: repeat(2, 1fr);
	}
	
	.lyode-formation-description {
		font-size: 13px;
	}
}

@media (max-width: 480px) {
	.lyode-formation-subpages-container {
		grid-template-columns: 1fr;
	}
	
	.lyode-formation-description {
		font-size: 12px;
	}
}
