/* CSS Style Sheet - Carousels sur la page "articles.shtml"
   C. Eddy Traductions */

/* ===================================
   CAROUSEL CONTAINER & LAYOUT
   =================================== */

.carousel-section {
  margin: 60px auto;
  max-width: 1400px;
  padding: 0 20px;
}

.carousel-section h2 {
  margin-bottom: 30px;
  font-size: 20px;
  color: #333;
  font-variant: small-caps; 
  text-align: center;
}

.carousel-wrapper {
  position: relative;
}

.carousel {
  position: relative;
  overflow: hidden;
  padding: 10px 0;
}

.carousel-track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 10px 5px 20px;
  -webkit-overflow-scrolling: touch;  
  /* PEEK EFFECT: Show partial next card */
  /* This creates the "peek" by constraining width */
  max-width: calc(100vw - 40px); /* Full viewport minus section padding */
  /* Firefox scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #888 #f1f1f1;
}

/* Custom scrollbar styling */
.carousel-track::-webkit-scrollbar {
  height: 8px;
}

.carousel-track::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.carousel-track::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

.carousel-track::-webkit-scrollbar-thumb:hover {
  background: #555;
}


/* ===================================
   CAROUSEL CARDS
   =================================== */

.carousel-card {
  flex: 0 0 calc(100% - 60px); /* Full width minus peek amount on mobile */
  scroll-snap-align: start;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  max-height: 400px;
}

.carousel-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* ===================================
   CARD IMAGE
   =================================== */

.card-image {
  width: 100%;
  height: 140px;
  overflow: hidden;
  background: linear-gradient(135deg, #345883 0%, #88C693 100%);
  position: relative;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.carousel-card:hover .card-image img {
  transform: scale(1.08);
}

.card-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
}

.carousel-card:hover .card-image::after {
  background: rgba(0, 0, 0, 0.1);
}

/* ===================================
   CARD CONTENT
   =================================== */

.card-content {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-date {
  margin: 0 0 8px 0;
  font-size: 13px;
  color: #999;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-content h3 {
  margin: 0 0 12px 0;
  font-size: 18px;
  color: #222;
  line-height: 1.3;
  transition: color 0.3s ease;
}

/* Allows titles of links on cards to not be underlined when linked */
.card-content a {
  text-decoration: none !important;
}


.carousel-card:hover .card-content h3 {
  color: #345883;
}

.card-excerpt {
  margin: 0 0 16px 0;
  font-size: 15px;
  line-height: 1.6;
  color: #666;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===================================
   CARD LINK
   =================================== */

.card-link {
  display: inline-flex;
  align-items: center;
  color: #345883;
  text-decoration: underline !important;
  font-weight: 600;
  font-size: 15px;
  transition: gap 0.3s ease, color 0.3s ease;
  gap: 6px;
  align-self: flex-start;
}

.card-link:hover {
  color: #764ba2;
  gap: 10px;
}

/* ===================================
   INDICATOR DOTS
   =================================== */

.carousel-indicators {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
  padding: 10px 0;
}

.indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ddd;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.indicator-dot:hover {
  background: #999;
  transform: scale(1.2);
}

.indicator-dot:focus {
  outline: 2px solid #345883;
  outline-offset: 3px;
}

 /* Indicator dot tweak for JS at bottom of page */
.indicator-dot.active {
  background: #345883 !important;
  width: 12px !important;
  height: 12px !important;
}

/* Active dot indicator - uses :target pseudo-class */
.carousel-card:target ~ .carousel-indicators .indicator-dot,
.indicator-dot:active {
  background: #345883;
  width: 12px;
  height: 12px;
}

/* Alternative: CSS-only active state based on scroll position */
/* This won't work perfectly but gives visual feedback */
.carousel-track:has(.carousel-card:nth-child(1):hover) ~ .carousel-indicators .indicator-dot:nth-child(1),
.carousel-track:has(.carousel-card:nth-child(2):hover) ~ .carousel-indicators .indicator-dot:nth-child(2),
.carousel-track:has(.carousel-card:nth-child(3):hover) ~ .carousel-indicators .indicator-dot:nth-child(3),
.carousel-track:has(.carousel-card:nth-child(4):hover) ~ .carousel-indicators .indicator-dot:nth-child(4),
.carousel-track:has(.carousel-card:nth-child(5):hover) ~ .carousel-indicators .indicator-dot:nth-child(5),
.carousel-track:has(.carousel-card:nth-child(6):hover) ~ .carousel-indicators .indicator-dot:nth-child(6) {
  background: #345883;
  width: 12px;
  height: 12px;
}

/* ===================================
   TABLET RESPONSIVE (768px+)
   =================================== */

@media (min-width: 768px) {
  .carousel-card {
    flex: 0 0 360px; /* Fixed width cards with peek effect */
    max-height: 450px;
  }
  
  .card-image {
    height: 160px;
  }
  
  .carousel-section h2 {
    font-size: 24px;
  }
  
  .carousel-track {
    max-width: 100%; /* Remove constraint, let multiple cards show */
  }
}

/* ===================================
   DESKTOP RESPONSIVE (1024px+)
   =================================== */

@media (min-width: 1024px) {
  .carousel-card {
    flex: 0 0 380px;
    max-height: 480px;
  }
  
  .card-image {
    height: 180px;
  }
  
  .card-content h3 {
    font-size: 22px;
  }
  
  .card-excerpt {
    font-size: 16px;
  }
}

/* ===================================
   LARGE DESKTOP (1440px+)
   =================================== */

@media (min-width: 1440px) {
  .carousel-card {
    flex: 0 0 420px;
    max-height: 500px;
  }
  
  .carousel-track {
    gap: 32px;
  }
}

/* ===================================
   ACCESSIBILITY & FOCUS STATES
   =================================== */

.carousel-card:focus-within {
  outline: 3px solid #345883;
  outline-offset: 4px;
}

.card-link:focus {
  outline: 2px solid #345883;
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .carousel-track {
    scroll-behavior: auto;
  }
  
  .carousel-card,
  .card-image img,
  .card-link,
  .indicator-dot {
    transition: none;
  }
  
  .carousel-card:hover {
    transform: none;
  }
  
  .carousel-card:hover .card-image img {
    transform: none;
  }
}

/* ===================================
   PRINT STYLES
   =================================== */

@media print {
  .carousel-track {
    overflow: visible;
    flex-wrap: wrap;
  }
  
  .carousel-card {
    break-inside: avoid;
  }
  
  .carousel-indicators {
    display: none;
  }
}