/* =============================================================================
   Astrolabe — Widget : Carrousel Actualités (jxc-actu-carousel)
   Réutilisable sur tous les templates : série, album, genre, collection, auteur
   ============================================================================= */

/* ── Section wrapper ─────────────────────────────────────────────────────────── */

.jxc-actu-carousel-section {
position: relative;
padding: 60px 0;
overflow: hidden;
}

.jxc-actu-carousel-section__overlay {
position: absolute;
inset: 0;
pointer-events: none;
}

.jxc-actu-carousel-section__inner {
position: relative;
z-index: 1;
max-width: var(--jxc-content-width, 1200px);
margin: 0 auto;
padding: 0 24px;
}

/* Mode overlay : les cartes vont bord à bord (pas de padding latéral) */
.jxc-actu-carousel-section--overlay .jxc-actu-carousel-section__inner {
padding: 0;
max-width: 100%;
}

/* Titre en mode overlay blanc → forcer couleur sombre (le title_color du widget override via inline style) */
.jxc-actu-carousel-section--overlay .jxc-actu-carousel-section__title {
color: var(--jxc-dark, #212121) !important;
}

/* ── Titre de section ────────────────────────────────────────────────────────── */

/* Titre géré par jxc-shared.css (variante lumière — fond sombre) */
/* Surcharge locale : gap légèrement différent du parent */


/* ── Wrapper boutons + track ─────────────────────────────────────────────────── */

.jxc-actu-carousel-wrap {
display: flex;
flex-direction: column;
align-items: stretch;
gap: 20px;
}

/* ── Track carrousel ─────────────────────────────────────────────────────────── */

.jxc-actu-carousel {
display: flex;
gap: 24px;
overflow-x: auto;
scroll-snap-type: x mandatory;
scroll-behavior: smooth;
-webkit-overflow-scrolling: touch;
scrollbar-width: none;
width: 100%;
}

.jxc-actu-carousel::-webkit-scrollbar { display: none; }

/* ── Carte article ───────────────────────────────────────────────────────────── */

.jxc-actu-card {
flex: 0 0 calc(25% - 18px);
min-width: 200px;
scroll-snap-align: start;
background: #ffffff;
border-radius: 6px;
overflow: hidden;
display: flex;
flex-direction: column;
}

.jxc-actu-card__img-link {
display: block;
overflow: hidden;
line-height: 0;
}

.jxc-actu-card__img {
width: 100%;
height: 180px;
object-fit: cover;
display: block;
transition: transform 0.3s ease;
}

.jxc-actu-card:hover .jxc-actu-card__img {
transform: scale(1.05);
}

.jxc-actu-card__body {
padding: 14px 16px 16px;
display: flex;
flex-direction: column;
gap: 6px;
flex: 1;
}

.jxc-actu-card__date {
font-family: var(--jxc-font);
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.07em;
color: var(--jxc-accent, #212121);
line-height: 1.3;
}

.jxc-actu-card__title {
margin: 0;
font-family: var(--jxc-font);
font-size: 14px;
font-weight: 700;
line-height: 1.3;
}

.jxc-actu-card__title a {
text-decoration: none;
color: var(--jxc-dark, #212121);
transition: color 0.2s ease;
}

.jxc-actu-card__title a:hover { color: var(--jxc-accent, #212121); }

/* H1 overlay card title (mode overlay) */
.jxc-actu-card--overlay .jxc-actu-card__title {
font-family: var(--jxc-font);
font-size: 40px;
font-weight: 600;
line-height: 39px;
letter-spacing: -0.6px;
color: #ffffff;
margin: 0;
}

/* ── Dots / Bullets ────────────────────────────────────────────────────── */

.jxc-actu-dots {
display: flex;
justify-content: center;
align-items: center;
gap: 10px;
}

.jxc-actu-dot {
width: 10px;
height: 10px;
border-radius: 50%;
border: none;
padding: 0;
cursor: pointer;
background: rgba(255, 255, 255, 0.35);
transition: background-color 0.2s ease, transform 0.2s ease;
flex-shrink: 0;
}

.jxc-actu-dot.is-active {
background: #ffffff;
transform: scale(1.25);
}

.jxc-actu-dot:hover:not(.is-active) {
background: rgba(255, 255, 255, 0.6);
}

/* ── Boutons prev / next ─────────────────────────────────────────────────────── */

.jxc-actu-carousel__btn {
flex-shrink: 0;
width: 42px;
height: 42px;
border-radius: 50%;
border: 2px solid rgba(255, 255, 255, 0.5);
background: rgba(255, 255, 255, 0.12);
color: #ffffff;
font-size: 24px;
line-height: 1;
cursor: pointer;
display: none;
align-items: center;
justify-content: center;
transition: background-color 0.15s ease, border-color 0.15s ease;
padding: 0;
backdrop-filter: blur(4px);
}

.jxc-actu-carousel__btn:hover {
background: rgba(255, 255, 255, 0.3);
border-color: #ffffff;
}

.jxc-actu-carousel__btn:disabled {
opacity: 0.25;
cursor: default;
pointer-events: none;
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
.jxc-actu-card { flex: 0 0 calc(50% - 12px); }
}

@media (max-width: 767px) {
.jxc-actu-carousel-section { padding: 40px 0; }

.jxc-actu-card { flex: 0 0 calc(80% - 0px); }
.jxc-actu-carousel__btn { width: 34px; height: 34px; font-size: 20px; }
}

/* ── Mode Overlay (grille 4 col, titre blanc sur image, slide-right) ───────── */

/* Le track overlay est une grille, pas un carousel scrollable */
.jxc-actu-carousel--overlay {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 8px;
overflow-x: visible;
scroll-snap-type: none;
}

.jxc-actu-carousel--overlay .jxc-actu-card--overlay {
background: none;
position: relative;
border-radius: 10px;
overflow: hidden;
height: 300px;
min-width: 0;
flex: none;
scroll-snap-align: none;
width: 100%;
}

/* Chaque carte a ses propres coins arrondis */

.jxc-actu-card--overlay .jxc-actu-card__img-link {
position: absolute;
inset: 0;
display: block;
overflow: hidden;
line-height: 0;
}

.jxc-actu-card--overlay .jxc-actu-card__img {
width: 100%;
height: 100%;
object-fit: cover;
transform-origin: center center;
transition: transform 0.4s ease;
}

.jxc-actu-card--overlay:hover .jxc-actu-card__img {
transform: scale(1.06);
}

.jxc-actu-card--overlay .jxc-actu-card__overlay-body {
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: 30px 70px 30px 30px;
background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, transparent 100%);
pointer-events: none;
}

.jxc-actu-card--overlay .jxc-actu-card__title {
margin: 0;
font-family: var(--jxc-font);
font-size: 40px;
font-weight: 600;
line-height: 39px;
letter-spacing: -0.6px;
color: #ffffff;
}

/* Masquer les dots en mode overlay (pas de scroll) */
.jxc-actu-carousel--overlay ~ .jxc-actu-dots {
display: none;
}

@media (max-width: 1024px) {
.jxc-actu-carousel--overlay {
  grid-template-columns: repeat(2, 1fr);
}
.jxc-actu-carousel--overlay .jxc-actu-card--overlay {
  height: 240px;
  border-radius: 10px;
}
.jxc-actu-card--overlay .jxc-actu-card__title { font-size: 24px; line-height: 1.2; }
}

@media (max-width: 767px) {
.jxc-actu-carousel--overlay {
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.jxc-actu-carousel--overlay .jxc-actu-card--overlay {
  height: 180px;
  border-radius: 8px;
}
.jxc-actu-card--overlay .jxc-actu-card__title { font-size: 18px; line-height: 1.2; letter-spacing: 0; }
.jxc-actu-card--overlay .jxc-actu-card__overlay-body { padding: 16px; }
}
