/* =========================================================
   TEC Carrousel — Cartes carrées avec overlay au hover
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=DM+Sans:wght@300;400;500&display=swap');

/* ---- Variables ---- */
.tec-carrousel-wrap {
  --tc-bg:        #c13d26;
  --tc-surface:   #1e1e1e;
  --tc-accent:    #e8c97e;
  --tc-accent2:   #b8862a;
  --tc-text:      #f0ece4;
  --tc-muted:     #9a9590;
  --tc-border:    rgba(255,255,255,.09);
  --tc-radius:    10px;
  --tc-ease:      cubic-bezier(.4, 0, .2, 1);
  --tc-font-h:    'Playfair Display', Georgia, serif;
  --tc-font-b:    'DM Sans', system-ui, sans-serif;
}

/* =========================================================
   NOTICE
   ========================================================= */
.tec-carrousel-notice {
  font-family: var(--tc-font-b);
  padding: 1.2rem 1.5rem;
  background: var(--tc-surface);
  color: var(--tc-muted);
  border-radius: var(--tc-radius);
  border-left: 3px solid var(--tc-accent);
}

/* =========================================================
   WRAPPER PRINCIPAL
   Flex row : [flèche] [viewport] [flèche]
   ========================================================= */
.tec-carrousel-wrap {
  display: flex;
  flex-direction: column;  /* colonne : viewport + dots + progress */
  background: var(--tc-bg);
  border-radius: 14px;
  padding: 1.5rem 0 1.25rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  font-family: var(--tc-font-b);
  user-select: none;
  box-sizing: border-box;
}

/* Ligne du haut : flèche-gauche + viewport + flèche-droite */
.tec-carr-row {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
}

/* =========================================================
   VIEWPORT — masque ce qui dépasse
   ========================================================= */
.tec-carr-viewport {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  cursor: grab;
}
.tec-carrousel-wrap.is-dragging .tec-carr-viewport { cursor: grabbing; }

/* =========================================================
   TRACK — flex horizontal, ne wrap pas
   Le gap est injecté via <style> scopé depuis PHP
   ========================================================= */
.tec-carr-track {
  display: flex;
  flex-wrap: nowrap;
  transition: transform .5s cubic-bezier(.4, 0, .2, 1);
  will-change: transform;
  /* gap défini par style scopé */
}
.tec-carrousel-wrap.is-dragging .tec-carr-track {
  transition: none;
}

/* =========================================================
   CARTE CARRÉE
   flex-basis + min/max-width injectés par PHP en style scopé
   aspect-ratio: 1/1 → carré parfait
   ========================================================= */
.tec-carr-card {
  /* dimensions : calculées par PHP et injectées en <style> scopé */
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  position: relative;
  border-radius: var(--tc-radius);
  overflow: hidden;
  flex-shrink: 0;
  /* cursor pour indiquer le lien */
  cursor: default;
}

/* =========================================================
   FOND IMAGE (couvre toute la carte)
   ========================================================= */
.tec-carr-bg {
  position: absolute;
  inset: 0;
  background: var(--tc-surface) center/cover no-repeat;
  transition: transform .6s var(--tc-ease);
}

/* Fond de fallback si pas d'image */
.tec-carr-card:not(:has(.tec-carr-bg[style])) .tec-carr-bg,
.tec-carr-bg:not([style]) {
  background:
    radial-gradient(ellipse at 25% 70%, rgba(200,160,60,.25) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(140,90,20,.18) 0%, transparent 55%),
    #1e1a14;
}

/* Zoom subtil au hover */
.tec-carr-card:hover .tec-carr-bg {
  transform: scale(1.06);
}

/* =========================================================
   OVERLAY STATIQUE (toujours visible)
   Gradient sombre en bas + badge date + catégorie
   ========================================================= */
.tec-carr-static {
  position: absolute;
  inset: 0;
  /* Gradient opaque en bas pour lisibilité du badge */
  background: linear-gradient(
    to top,
    rgba(0,0,0,.75) 0%,
    rgba(0,0,0,.2)  40%,
    transparent     70%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: .85rem 1rem;
  transition: opacity .35s var(--tc-ease);
  z-index: 2;
}

/* Cacher l'overlay statique au hover pour laisser place à l'overlay complet */
.tec-carr-card:hover .tec-carr-static {
  opacity: 0;
}

/* ---- Badge date ---- */
.tec-carr-date {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: var(--tc-accent);
  color: #0d0d0d;
  border-radius: 8px;
  padding: .45rem .65rem .5rem;
  line-height: 1;
  width: 62px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(232,201,126,.4);
  margin-bottom: .5rem;
}

.tec-d-day {
  font-family: var(--tc-font-h);
  font-size: 1.75rem;
  font-weight: 700;
  display: block;
}

.tec-d-month {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  display: block;
}

.tec-d-year {
  font-size: .62rem;
  font-weight: 400;
  opacity: .7;
  display: block;
  margin-top: 2px;
}

/* ---- Catégorie statique ---- */
.tec-carr-cat {
  font-size: .6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--tc-accent);
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
}

/* =========================================================
   OVERLAY HOVER (révélé au survol)
   Couvre toute la carte, contient toutes les infos
   ========================================================= */
.tec-carr-hover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(10,8,5,.88) 0%,
    rgba(20,14,4,.94) 100%
  );
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-end;
  padding: 1.25rem 1.1rem 1.1rem;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity .35s var(--tc-ease),
    transform .35s var(--tc-ease);
  z-index: 3;
}

.tec-carr-card:hover .tec-carr-hover-overlay {
  opacity: 1;
  transform: translateY(0);
}

.tec-carr-hover-inner {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  width: 100%;
}

/* ---- Catégorie (hover) ---- */
.tec-ho-cat {
  font-size: .6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--tc-accent);
}

/* ---- Titre (hover) ---- */
.tec-ho-title {
  font-family: var(--tc-font-h);
  font-size: clamp(.9rem, 1.8vw, 1.15rem);
  font-weight: 700;
  color: var(--tc-text);
  margin: 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Séparateur ---- */
.tec-ho-sep {
  width: 26px;
  height: 1px;
  background: var(--tc-accent);
  opacity: .5;
  flex-shrink: 0;
}

/* ---- Meta ---- */
.tec-ho-meta {
  display: flex;
  flex-direction: column;
  gap: .28rem;
}

.tec-ho-meta-item {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .88rem;
  color: var(--tc-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tec-ho-meta-item svg {
  width: 15px;
  height: 15px;
  stroke: var(--tc-accent);
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
}

/* ---- Bouton CTA ---- */
.tec-ho-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: .35rem;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tc-accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(232,201,126,.35);
  padding-bottom: 3px;
  align-self: flex-start;
  transition: gap .2s, color .2s, border-color .2s;
}

.tec-ho-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  transition: transform .2s;
}

.tec-ho-btn:hover { color: #fff; border-color: rgba(255,255,255,.4); gap: .65rem; }
.tec-ho-btn:hover svg { transform: translateX(3px); }

/* =========================================================
   FLÈCHES
   ========================================================= */
.tec-carr-arrow {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--tc-border);
  background: rgba(30,30,30,.85);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tc-text);
  transition: background .2s, border-color .2s, color .2s;
  margin: 0 10px;
  /* empêche le shrink/grow */
  flex: 0 0 38px;
  z-index: 10;
  align-self: center;
}

.tec-carr-arrow svg {
  width: 16px;
  height: 16px;
  display: block;
}

.tec-carr-arrow:hover {
  background: var(--tc-accent);
  border-color: var(--tc-accent);
  color: #0d0d0d;
}

.tec-carr-arrow:disabled {
  opacity: .25;
  cursor: default;
  pointer-events: none;
}

.tec-carr-arrow:focus-visible {
  outline: 2px solid var(--tc-accent);
  outline-offset: 3px;
}

/* =========================================================
   DOTS
   ========================================================= */
.tec-carr-dots {
  display: flex;
  justify-content: center;
  gap: .45rem;
  margin-top: 1.1rem;
  padding: 0 58px; /* aligner avec le viewport (38px flèche + 10px margin * 2 = 56) */
}

.tec-carr-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255,255,255,.2);
  cursor: pointer;
  transition: background .25s, width .3s;
}

.tec-carr-dot.active {
  background: var(--tc-accent);
  width: 18px;
  border-radius: 3px;
}

.tec-carr-dot:focus-visible { outline: 2px solid var(--tc-accent); outline-offset: 3px; }

/* =========================================================
   BARRE DE PROGRESSION
   ========================================================= */
.tec-carr-progress {
  height: 2px;
  background: rgba(255,255,255,.07);
  margin: .75rem 58px 0;
  border-radius: 1px;
  overflow: hidden;
}

.tec-carr-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--tc-accent2), var(--tc-accent));
  width: 0;
  animation: tec-carr-progress linear forwards;
}

@keyframes tec-carr-progress {
  from { width: 0; }
  to   { width: 100%; }
}

/* =========================================================
   LAYOUT — la ligne principale (flèche + viewport + flèche)
   ========================================================= */
.tec-carr-main-row {
  display: flex;
  align-items: center;
  width: 100%;
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .tec-carr-track             { transition: none; }
  .tec-carr-bg                { transition: none; }
  .tec-carr-hover-overlay     { transition: none; }
  .tec-carr-progress-bar      { animation: none; width: 100%; }
}

/* =========================================================
   RESPONSIVE
   Par défaut : 3 cartes (géré par PHP)
   On surcharge juste le padding/margin au besoin.
   ========================================================= */
@media (max-width: 640px) {
  .tec-carr-arrow {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    margin: 0 6px;
  }
  .tec-carr-dots,
  .tec-carr-progress {
    padding-left: 44px;
    padding-right: 44px;
  }
}
