/* ==========================================================================
   JM Derniers Articles Carousel v1.3
   Fully customizable via CSS custom properties (--jm-*)
   Mobile: native horizontal scroll with snap, denser cards
   ========================================================================== */

/* ── Section ── */
.jm-lpc-section {
	padding: var(--jm-section-py, 80px) 0;
	background: var(--jm-section-bg, #f8f9fc);
	/* No overflow:hidden here — let card hover breathe */
	overflow-x: clip;
	overflow-y: visible;
}

/* Full-width breakout — override any theme container */
.jm-lpc--full-width {
	width: 100vw !important;
	max-width: 100vw !important;
	margin-left: calc(-50vw + 50%) !important;
	margin-right: calc(-50vw + 50%) !important;
	box-sizing: border-box !important;
}

.jm-lpc-container {
	max-width: 1500px;
	margin: 0 auto;
	padding: 0 80px;
}

@media (max-width: 921px) {
	.jm-lpc-container { padding: 0 40px; }
	.jm-lpc-section { padding: calc(var(--jm-section-py, 80px) * 0.75) 0; }
}

@media (max-width: 544px) {
	.jm-lpc-container { padding: 0 20px; }
	.jm-lpc-section { padding: calc(var(--jm-section-py, 80px) * 0.5) 0; }
}

/* ── Header ── */
.jm-lpc-header {
	margin-bottom: var(--jm-header-gap, 48px);
	text-align: var(--jm-header-align, left);
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.jm-lpc-section[style*="--jm-header-align:center"] .jm-lpc-header { align-items: center; }
.jm-lpc-section[style*="--jm-header-align:right"] .jm-lpc-header { align-items: flex-end; }

.jm-lpc-header__title {
	font-family: 'Plus Jakarta Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
	font-size: 2.5rem;
	font-weight: 700;
	color: var(--jm-title-color, #060097);
	margin: 0 0 8px 0;
	line-height: 1.2;
	letter-spacing: -0.02em;
}

.jm-lpc-header__subtitle {
	font-family: 'Helvetica Neue', Helvetica, Verdana, Arial, sans-serif;
	font-size: 1.05rem;
	color: var(--jm-subtitle-color, #67768e);
	margin: 0;
	line-height: 1.6;
	max-width: 600px;
}

@media (max-width: 700px) {
	.jm-lpc-header { margin-bottom: calc(var(--jm-header-gap, 48px) * 0.6); }
	.jm-lpc-header__title { font-size: 1.75rem; }
}

/* ── Carousel wrapper (desktop: flex with arrows) ── */
.jm-lpc-carousel-wrapper {
	display: flex;
	align-items: center;
	gap: 16px;
}

.jm-lpc-carousel {
	overflow: visible;
	position: relative;
	flex: 1;
	min-width: 0;
}

.jm-lpc-carousel__track {
	display: flex;
	gap: 24px;
	transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
	will-change: transform;
	/* Vertical padding to give room for hover shadow + transform */
	padding: 8px 0 16px 0;
	margin: -8px 0 -16px 0;
}

/* ── Side arrows ── */
.jm-lpc-nav__arrow {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1.5px solid currentColor;
	background: var(--jm-arrow-bg, #ffffff);
	color: var(--jm-arrow-color, #060097);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.25s ease;
	padding: 0;
	flex-shrink: 0;
	opacity: 0.6;
}

.jm-lpc-nav__arrow:hover:not(:disabled) {
	background: var(--jm-arrow-hover-bg, #060097);
	color: var(--jm-arrow-hover-color, #ffffff);
	border-color: var(--jm-arrow-hover-bg, #060097);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	opacity: 1;
}

.jm-lpc-nav__arrow:disabled {
	opacity: 0.2;
	cursor: not-allowed;
}

.jm-lpc-nav__arrow svg { display: block; }

/* ── Cards ── */
.jm-lpc-card {
	flex-shrink: 0;
	border-radius: var(--jm-card-radius, 16px);
	background: var(--jm-card-bg, #ffffff);
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.03);
	transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.jm-lpc-card:hover {
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1), 0 16px 40px rgba(0, 0, 0, 0.06);
	transform: translateY(-6px);
}

/* Force no underline — override Astra/WordPress */
.jm-lpc-section a,
.jm-lpc-section a:hover,
.jm-lpc-section a:focus,
.jm-lpc-section a:visited,
.jm-lpc-section a:active,
.jm-lpc-card__link,
.jm-lpc-card__link:hover,
.jm-lpc-card__link:focus,
.jm-lpc-card__link:visited,
.jm-lpc-card__link:active,
.jm-lpc-card__link *,
.jm-lpc-archive__link,
.jm-lpc-archive__link:hover,
.jm-lpc-archive__link:focus,
.jm-lpc-archive__link:visited {
	text-decoration: none !important;
	border-bottom: none !important;
	box-shadow: none !important;
	-webkit-text-decoration: none !important;
	background-image: none !important;
}

.jm-lpc-card__link {
	display: flex;
	flex-direction: column;
	color: inherit;
	height: 100%;
}

.jm-lpc-card__link:hover,
.jm-lpc-card__link:focus {
	color: inherit;
}

/* ── Card Content ── */
.jm-lpc-card__content {
	padding: 28px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	text-align: var(--jm-card-align, left);
}

.jm-lpc-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 16px;
}

.jm-lpc-section[style*="--jm-card-align:center"] .jm-lpc-card__tags { justify-content: center; }
.jm-lpc-section[style*="--jm-card-align:right"] .jm-lpc-card__tags { justify-content: flex-end; }

.jm-lpc-tag {
	display: inline-block;
	font-family: 'Helvetica Neue', Helvetica, Verdana, Arial, sans-serif;
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--jm-tag-color, #060097);
	background: var(--jm-tag-bg, rgba(6,0,151,0.06));
	border: 1px solid rgba(0, 0, 0, 0.06);
	border-radius: 50px;
	padding: 4px 12px;
	transition: background 0.2s ease;
}

.jm-lpc-card:hover .jm-lpc-tag { filter: brightness(0.95); }

.jm-lpc-card__title {
	font-family: 'Plus Jakarta Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--jm-card-title-color, #1e293b);
	margin: 0 0 6px 0;
	line-height: 1.35;
	transition: color 0.2s ease;
}

.jm-lpc-card:hover .jm-lpc-card__title {
	color: var(--jm-card-title-hover, #060097);
}

.jm-lpc-card__date {
	font-family: 'Helvetica Neue', Helvetica, Verdana, Arial, sans-serif;
	font-size: 0.82rem;
	color: var(--jm-date-color, #9ba5b4);
	margin-bottom: 12px;
	display: block;
}

.jm-lpc-card__excerpt {
	font-family: 'Helvetica Neue', Helvetica, Verdana, Arial, sans-serif;
	font-size: 0.92rem;
	color: var(--jm-excerpt-color, #67768e);
	line-height: 1.65;
	margin: 0 0 16px 0;
	flex-grow: 1;
}

.jm-lpc-card__read-more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: 'Plus Jakarta Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--jm-cta-color, #060097);
	margin-top: auto;
	transition: gap 0.3s ease;
}

.jm-lpc-section[style*="--jm-card-align:center"] .jm-lpc-card__read-more { justify-content: center; }
.jm-lpc-section[style*="--jm-card-align:right"] .jm-lpc-card__read-more { justify-content: flex-end; }

.jm-lpc-card:hover .jm-lpc-card__read-more { gap: 10px; }
.jm-lpc-card__read-more svg { transition: transform 0.3s ease; }
.jm-lpc-card:hover .jm-lpc-card__read-more svg { transform: translateX(3px); }

/* ── Navigation — centered dots ── */
.jm-lpc-nav {
	display: flex;
	justify-content: center;
	align-items: center;
	margin-top: 32px;
}

.jm-lpc-nav__dots {
	display: flex;
	gap: 8px;
}

.jm-lpc-nav__dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	border: none;
	background: var(--jm-dot-color, rgba(6,0,151,0.15));
	cursor: pointer;
	padding: 0;
	transition: background 0.3s ease, transform 0.3s ease, width 0.3s ease;
}

.jm-lpc-nav__dot--active {
	background: var(--jm-dot-active, #060097);
	border-radius: 5px;
	width: 28px;
}

.jm-lpc-nav__dot:hover:not(.jm-lpc-nav__dot--active) {
	background: var(--jm-dot-active, #060097);
	opacity: 0.5;
	transform: scale(1.2);
}

/* ── Archive button — outline, discreet ── */
.jm-lpc-archive {
	text-align: center;
	margin-top: 36px;
}

.jm-lpc-archive__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: 'Plus Jakarta Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--jm-archive-color, #060097);
	background: transparent;
	border: 1.5px solid var(--jm-archive-border, rgba(6,0,151,0.25));
	border-radius: 50px;
	padding: 10px 28px;
	transition: all 0.3s ease;
	letter-spacing: 0.01em;
}

.jm-lpc-archive__link:hover,
.jm-lpc-archive__link:focus {
	color: var(--jm-archive-hover-color, #ffffff);
	background: var(--jm-archive-hover-bg, #060097);
	border-color: var(--jm-archive-hover-bg, #060097);
	gap: 12px;
}

.jm-lpc-archive__link svg { transition: transform 0.3s ease; }
.jm-lpc-archive__link:hover svg { transform: translateX(3px); }

/* ── Archive: mobile-only mode ── */
.jm-lpc--archive-mobile-only .jm-lpc-archive {
	display: none;
}

@media (max-width: 700px) {
	.jm-lpc--archive-mobile-only .jm-lpc-archive {
		display: block;
	}
}

/* ── Empty state ── */
.jm-lpc-empty {
	text-align: center;
	padding: 60px 20px;
	font-family: 'Helvetica Neue', Helvetica, Verdana, Arial, sans-serif;
	font-size: 1rem;
	color: #67768e;
}

/* ==========================================================================
   MOBILE — Native horizontal scroll with snap + dense cards
   ========================================================================== */

@media (max-width: 700px) {

	/* Hide arrows when toggle is on */
	.jm-lpc--hide-arrows-mobile .jm-lpc-nav__arrow {
		display: none !important;
	}

	/* Carousel becomes a native scroll container */
	.jm-lpc-carousel-wrapper {
		gap: 0;
	}

	.jm-lpc-carousel {
		overflow-x: auto;
		overflow-y: visible;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x mandatory;
		scroll-behavior: smooth;
		scrollbar-width: none;
		-ms-overflow-style: none;
	}

	.jm-lpc-carousel::-webkit-scrollbar {
		display: none;
	}

	.jm-lpc-carousel__track {
		transform: none !important;
		transition: none !important;
		gap: 12px;
		padding: 8px 4px 16px 4px;
		margin: -8px 0 -16px 0;
	}

	/* Cards: ~80vw wide for peek effect, snap to center */
	.jm-lpc-card {
		min-width: 78vw !important;
		max-width: 78vw !important;
		scroll-snap-align: center;
	}

	.jm-lpc-card:hover {
		transform: none;
	}

	.jm-lpc-card__content {
		padding: 20px;
	}

	.jm-lpc-card__title { font-size: 1.1rem; }
	.jm-lpc-card__excerpt { font-size: 0.85rem; line-height: 1.55; margin-bottom: 12px; }
	.jm-lpc-card__date { font-size: 0.78rem; margin-bottom: 8px; }
	.jm-lpc-card__read-more { font-size: 0.82rem; }

	.jm-lpc-nav { margin-top: 20px; }
	.jm-lpc-nav__dot { width: 8px; height: 8px; }
	.jm-lpc-nav__dot--active { width: 22px; }

	.jm-lpc-archive { margin-top: 24px; }
	.jm-lpc-archive__link { font-size: 0.82rem; padding: 8px 22px; }
}

/* Tablet intermediate */
@media (min-width: 701px) and (max-width: 920px) {
	.jm-lpc-carousel-wrapper { gap: 10px; }
	.jm-lpc-nav__arrow { width: 38px; height: 38px; }
	.jm-lpc-nav__arrow svg { width: 16px; height: 16px; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
	.jm-lpc-carousel__track { transition: none; }
	.jm-lpc-card,
	.jm-lpc-card__read-more svg,
	.jm-lpc-nav__dot,
	.jm-lpc-nav__arrow,
	.jm-lpc-archive__link { transition: none; }
	.jm-lpc-card:hover { transform: none; }
}

/* ── Focus visible for accessibility ── */
.jm-lpc-card__link:focus-visible {
	outline: 3px solid #c10fff;
	outline-offset: 2px;
	border-radius: var(--jm-card-radius, 16px);
}

.jm-lpc-nav__arrow:focus-visible,
.jm-lpc-nav__dot:focus-visible {
	outline: 3px solid #c10fff;
	outline-offset: 2px;
}
