/* ─── 1. SECTION & TRACK ────────────────────────────────────────────────────── */
#timeline-section {
  padding: 60px 0 60px 40px;
  min-height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
#timeline-section h2,
#timeline-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text2);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 32px;
}
#timeline-track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
  padding-bottom: 16px;
  padding-right: 40px;
  user-select: none;
}
#timeline-track::-webkit-scrollbar { display: none; }
#timeline-track.is-dragging { cursor: grabbing; }

/* ─── 2. WEEK CARDS ─────────────────────────────────────────────────────────── */
.week-card {
  position: relative;
  width: 360px;
  min-width: 360px;
  flex-shrink: 0;
  border-radius: 16px;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  padding: 24px;
  cursor: pointer;
  transition: border-color 0.3s, transform 0.2s;
  overflow: hidden;
}
.week-card:hover { border-color: rgba(74,127,212,0.5); transform: translateY(-4px); }

.card-week-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--blue-bright);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 4px;
}
.card-week-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}
.card-header { margin-bottom: 16px; }

.card-image-wrap {
  height: 200px;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 16px;
  background: var(--bg2);
}
.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

/* ─── CAROUSEL DANS LES CARDS ───────────────────────────────────────────────── */
.carousel-wrapper {
  position: relative;
  height: 100%;
  overflow: hidden;
}
.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.35s ease;
}
.carousel-track img {
  min-width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background: rgba(15,22,40,0.75);
  border: 1px solid rgba(102,153,255,0.3);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.carousel-btn.prev { left: 6px; }
.carousel-btn.next { right: 6px; }
.carousel-counter {
  position: absolute;
  bottom: 6px;
  right: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  color: var(--text2);
  background: rgba(15,22,40,0.7);
  padding: 2px 8px;
  border-radius: 4px;
  backdrop-filter: blur(8px);
}

/* ─── 3. TAGS ───────────────────────────────────────────────────────────────── */
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text2);
  background: rgba(74,127,212,0.06);
}

/* ─── OVERLAY HOVER ─────────────────────────────────────────────────────────── */
.card-overlay {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: rgba(15,22,40,0.94);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(74,127,212,0.3);
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}
.week-card:hover .card-overlay { opacity: 1; pointer-events: auto; }

.overlay-week {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--blue-bright);
  letter-spacing: 0.1em;
}
.overlay-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.overlay-list {
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.overlay-list li {
  font-size: 0.82rem;
  color: var(--text2);
  line-height: 1.5;
  padding-left: 16px;
  position: relative;
}
.overlay-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--blue-bright);
  font-size: 0.7rem;
}

/* ─── 4. CARTE S5 ROUGE ─────────────────────────────────────────────────────── */
.s5-card { border-color: rgba(255,45,45,0.25); }
.s5-card .card-week-num { color: #ff6666; }
.s5-card:hover { border-color: rgba(255,45,45,0.6); transform: translateY(-4px); }
.s5-card .card-overlay { border-color: rgba(255,45,45,0.3); }
.s5-card .overlay-week { color: #ff6666; }
.s5-card .overlay-list li::before { color: #ff6666; }

.placeholder-s5 {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,45,45,0.07);
  border: 1px dashed #ff2d2d;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: #ff6666;
  text-align: center;
  padding: 12px;
}

/* ─── 5. MODAL ──────────────────────────────────────────────────────────────── */
#modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 4999;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(16px);
  display: none;
}
#modal-backdrop.open { display: block; }

#card-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#card-modal.open { display: flex; }

.modal-inner {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  z-index: 5001;
  pointer-events: auto;
}

#modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#modal-counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text2);
  position: absolute;
  top: 22px;
  left: 32px;
}

.modal-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
}
.modal-nav button {
  padding: 8px 20px;
  background: rgba(74,127,212,0.1);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s, color 0.2s;
}
.modal-nav button:hover { background: rgba(74,127,212,0.25); color: var(--text); }

.modal-carousel-wrapper {
  position: relative;
  height: 280px;
  overflow: hidden;
  border-radius: 10px;
  margin: 20px 0;
  background: var(--bg3);
}
.modal-carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.35s ease;
}
.modal-carousel-track img {
  min-width: 100%;
  object-fit: contain;
  object-position: center;
}
.modal-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: rgba(15,22,40,0.75);
  border: 1px solid rgba(102,153,255,0.3);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-carousel-btn.prev { left: 8px; }
.modal-carousel-btn.next { right: 8px; }
/* ─── OVERLAY LINKS ─────────────────────────────────────────────────────────── */
.overlay-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--blue-bright);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(102,153,255,0.4);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s, text-shadow 0.2s;
  cursor: pointer;
  position: relative;
  z-index: 10;
  pointer-events: auto;
}
.overlay-link:hover {
  color: #ffffff;
  border-color: var(--blue-bright);
  text-shadow: 0 0 12px rgba(102,153,255,0.8);
}

.modal-carousel-counter {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  color: var(--text2);
  background: rgba(15,22,40,0.7);
  padding: 2px 8px;
  border-radius: 4px;
  backdrop-filter: blur(8px);
}
