/**
 * Carougrid Blog for WP - Styles
 * 
 * @package CarougridBlog
 * @version 3.0.0
 */

/* ========================================
   CSS Variables
   ======================================== */
:root {
	--cg-gap: 40px;
	--cg-gap-mobile: 20px;
	--cg-border-radius: 10px;
	--cg-transition: 0.5s ease;
	--cg-overlay-bg: rgba(0, 0, 0, 0.5);

	/* Palette de Couleurs Dynamique */
	--cg-primary: #FF6B6B;
	--cg-primary-hover: #FF5252;
	--cg-secondary: #4ECDC4;
	--cg-accent: #FFE66D;
	--cg-gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

	/* Texte avec contraste */
	--cg-text-primary: #2D3748;
	--cg-text-secondary: #718096;
	--cg-text-light: #A0AEC0;
}

/* ========================================
   Grid Container
   ======================================== */
.grid-container {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	grid-template-rows: auto auto;
	grid-column-gap: var(--cg-gap);
	grid-row-gap: var(--cg-gap);
	grid-template-areas:
		"slider slider right"
		"col1   col2   right";
}

/* Grid Areas */
.col1 {
	grid-area: col1;
}

.col2 {
	grid-area: col2;
}

.col3 {
	grid-area: right;
}

/* ========================================
   Slider
   ======================================== */
.merged-slider {
	grid-area: slider;
	position: relative;
	overflow: hidden;
	border-radius: var(--cg-border-radius);
	user-select: none;
	width: 100%;
	aspect-ratio: 1.49 / 1;
	cursor: pointer;
}

.merged-slider .slides {
	display: flex;
	transition: transform var(--cg-transition);
	height: 100%;
}

.merged-slider .slide {
	position: relative;
	min-width: 100%;
	height: 100%;
	box-sizing: border-box;
}

.slide-image-container {
	position: relative;
	height: 100%;
}

.merged-slider .slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: var(--cg-border-radius);
	user-drag: none;
	user-select: none;
	-webkit-user-drag: none;
	/* Ken Burns Animation - Zoom lent */
	transition: transform 8s ease-out;
	transform: scale(1);
}

.merged-slider .slide img:hover {
	transform: scale(1.1);
}

/* Slide Title Overlay */
.slide-title-overlay {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	/* Gradient overlay plus prononcé */
	background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 70%, rgba(0, 0, 0, 0) 100%);
	/* Padding top augmenté pour laisser place au bouton CTA */
	padding: 70px 30px 25px 30px;
	color: #fff;
	overflow: visible;
}

.slide-title-overlay a {
	text-decoration: none;
	color: inherit;
}

.slide-title-overlay a:hover,
.slide-title-overlay a:visited,
.slide-title-overlay a:active {
	text-decoration: none;
	color: #fff;
}

.slide-title-overlay h3 {
	margin: 0 0 8px 0;
	/* Titre en 24px bold avec text-shadow */
	font-size: 24px;
	font-weight: 700;
	line-height: 1.3;
	color: #fff !important;
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(0, 0, 0, 0.3);
	display: -webkit-box;
	-webkit-box-orient: vertical;
	overflow: hidden;
	-webkit-line-clamp: 2;
	line-clamp: 2;
}

/* Sous-titre / Extrait (2 lignes max) */
.slide-excerpt {
	margin: 0 0 12px 0;
	font-size: 15px;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.9);
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
	display: -webkit-box;
	-webkit-box-orient: vertical;
	overflow: hidden;
	-webkit-line-clamp: 2;
	line-clamp: 2;
}

/* Bouton CTA qui apparaît au hover - Positionné en haut, au-dessus du titre */
.slide-cta {
	position: absolute;
	top: 0px;
	right: 30px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	background: var(--cg-primary);
	color: white;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
	opacity: 0;
	transform: translateY(-10px);
	transition: all 0.3s ease;
	z-index: 5;
}

.merged-slider:hover .slide-cta {
	opacity: 1;
	transform: translateY(0);
}

.slide-cta::after {
	content: '→';
	font-size: 16px;
	transition: transform 0.3s ease;
}

.slide-cta:hover {
	background: var(--cg-primary-hover);
	box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
}

.slide-cta:hover::after {
	transform: translateX(4px);
}

/* Post Badges (New, Updated, Popular) */
.post-badge {
	position: absolute;
	top: 20px;
	left: 20px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	color: white;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
	z-index: 5;
	animation: pulse 2s ease-in-out infinite;
}

.badge-new {
	background: linear-gradient(135deg, #667eea 0%, #4ecdc4 100%);
	box-shadow: 0 4px 12px rgba(78, 205, 196, 0.4);
}

.badge-updated {
	background: linear-gradient(135deg, #f093fb 0%, #ffe66d 100%);
	box-shadow: 0 4px 12px rgba(240, 147, 251, 0.4);
}

.badge-popular {
	background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
	box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
}

@keyframes pulse {

	0%,
	100% {
		transform: scale(1);
	}

	50% {
		transform: scale(1.05);
	}
}

/* Overlay Animation */
@keyframes fadeInOverlay {
	from {
		opacity: 0;
		transform: translateY(20px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.animate-overlay {
	animation: fadeInOverlay 0.5s ease forwards;
}

/* Progress Indicator */
.slider-progress {
	position: absolute;
	top: 3%;
	right: 3%;
	width: 6%;
	aspect-ratio: 1;
	z-index: 10;
	min-width: 30px;
	max-width: 80px;
}

.slider-progress svg {
	width: 100%;
	height: 100%;
	transform: rotate(-90deg);
}

@keyframes progress {
	from {
		stroke-dashoffset: 100;
	}

	to {
		stroke-dashoffset: 0;
	}
}



.progress-bar.animate {
	animation: progress 5s linear infinite;
}

/* Pause animation on hover */
.merged-slider:hover .progress-bar {
	animation-play-state: paused !important;
}

/* ========================================
   Cards (col1, col2)
   ======================================== */
.col1,
.col2 {
	text-align: center;
}

.carougrid-card {
	height: 100%;
	display: flex;
	flex-direction: column;
}

.col1 img,
.col2 img {
	width: 100%;
	border-radius: var(--cg-border-radius);
	display: block;
	transition: transform 0.3s ease;
}

.col1 a:hover img,
.col2 a:hover img {
	transform: scale(1.02);
}

.col1 h3,
.col2 h3 {
	font-size: 18px;
	margin: 10px 5px 5px;
	line-height: 1.4;
	color: var(--cg-text-primary);
	transition: color 0.3s ease;
}

.col1 a:hover h3,
.col2 a:hover h3 {
	color: var(--cg-primary);
}

.col1 p.post-desc,
.col2 p.post-desc {
	margin: 5px 0 0;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	overflow: hidden;
	-webkit-line-clamp: 4;
	line-clamp: 4;
	line-height: 1.6;
	color: var(--cg-text-secondary);
}

/* ========================================
   List (col3)
   ======================================== */
.col3 {
	display: flex;
	flex-direction: column;
}

.col3 .post-item {
	display: flex;
	align-items: center;
	margin-bottom: 25px;
	transition: transform 0.2s ease;
}

.col3 .post-item {
	padding: 10px;
	border-radius: 8px;
	margin-left: -10px;
}

.col3 .post-item:hover {
	transform: translateX(12px);
	background: rgba(102, 126, 234, 0.05);
	box-shadow: -4px 0 0 var(--cg-primary);
}

.col3 .col3-image {
	flex: 0 0 40%;
}

.col3 .col3-image img {
	width: 100%;
	display: block;
	border-radius: var(--cg-border-radius);
	transition: transform 0.3s ease;
}

.col3 .post-item:hover .col3-image img {
	transform: scale(1.05);
}

.col3 .col3-title {
	flex: 1;
	padding-left: 15px;
	position: relative;
	overflow: hidden;
}

.col3 .col3-title h3 {
	margin: 0;
	font-size: 16px;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	overflow: hidden;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	color: var(--cg-text-primary);
	transition: color 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

.col3 .post-item:hover h3 {
	color: var(--cg-primary);
	opacity: 0;
	transform: translateY(-10px);
}

/* Extrait qui apparaît au hover */
.list-item-excerpt {
	position: absolute;
	top: 0;
	left: 15px;
	right: 0;
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: black;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	overflow: hidden;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.3s ease, transform 0.3s ease;
	pointer-events: none;
}

.col3 .post-item:hover .list-item-excerpt {
	opacity: 1;
	transform: translateY(0);
}

/* ========================================
   Links
   ======================================== */
.grid-container a {
	text-decoration: none;
	color: inherit;
	transition: opacity 0.2s ease;
}

.grid-container a:hover {
	opacity: 0.8;
}

/* ========================================
   Responsive - Desktop
   ======================================== */
@media (min-width: 769px) {
	.slide-title-overlay h3 {
		-webkit-line-clamp: 1;
		line-clamp: 1;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
}

/* ========================================
   Responsive - Tablet
   ======================================== */
@media (max-width: 1024px) and (min-width: 769px) {
	:root {
		--cg-gap: 30px;
	}

	.col3 .col3-title h3 {
		font-size: 15px;
	}
}

/* ========================================
   Responsive - Mobile
   ======================================== */
@media (max-width: 768px) {
	:root {
		--cg-gap: var(--cg-gap-mobile);
	}

	.grid-container {
		display: block;
	}

	.merged-slider {
		margin-bottom: 30px;
	}

	.slide-title-overlay {
		padding: 15px 20px;
	}

	.slide-title-overlay h3 {
		font-size: 20px;
		-webkit-line-clamp: 2;
		line-clamp: 2;
	}

	.slide-excerpt {
		font-size: 14px;
		margin-bottom: 10px;
	}

	/* Désactiver le CTA sur mobile (pas de hover) */
	.slide-cta {
		display: none;
	}

	.col1,
	.col2,
	.col3 {
		width: 100%;
		display: block;
		margin-bottom: 30px;
	}

	.col1 h3,
	.col2 h3 {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		overflow: hidden;
		-webkit-line-clamp: 2;
		line-clamp: 2;
	}

	.col3 .col3-title h3 {
		-webkit-line-clamp: 2;
		line-clamp: 2;
		font-size: 15px;
	}

	.col3 .post-item {
		margin-bottom: 20px;
	}
}

/* ========================================
   Accessibility
   ======================================== */
.grid-container a:focus {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

.merged-slider:focus {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

	.merged-slider .slides,
	.col1 img,
	.col2 img,
	.col3 .col3-image img,
	.grid-container a {
		transition: none;
	}

	.animate-overlay {
		animation: none;
	}

	.progress-bar {
		animation: none;
	}
}