/* Articles — carrousel accueil & pages dédiées */

.articles-carousel-outer {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-top: 2rem;
}

.articles-carousel-wrap {
  position: relative;
}

.articles-carousel {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(10, 37, 64, 0.25) transparent;
  padding: 0.5rem max(4vw, calc((100vw - 1120px) / 2 + 4vw)) 1.5rem;
}

.articles-carousel:focus-visible {
  outline: 2px solid var(--blue-600);
  outline-offset: 4px;
  border-radius: 8px;
}

.articles-carousel::-webkit-scrollbar {
  height: 6px;
}

.articles-carousel::-webkit-scrollbar-thumb {
  background: rgba(10, 37, 64, 0.2);
  border-radius: 999px;
}

.article-card {
  display: flex;
  flex-direction: column;
  flex: 0 0 clamp(260px, 28vw, 320px);
  scroll-snap-align: start;
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(10, 37, 64, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.article-card:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-lg);
  z-index: 1;
}

.article-card-image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--blue-50);
}

.article-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.article-card:hover .article-card-image img {
  transform: scale(1.05);
}

.article-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.1rem 1.25rem 1.25rem;
  gap: 0.4rem;
}

.article-card-meta {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.article-card-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--blue-800);
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-title a {
  color: inherit;
  text-decoration: none;
}

.article-card-title a:hover {
  color: var(--blue-600);
}

.article-card-excerpt {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--blue-600);
  text-decoration: none;
}

.article-card-link:hover {
  color: var(--blue-800);
}

.articles-carousel-nav {
  display: none;
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--blue-800);
  box-shadow: 0 4px 20px rgba(10, 37, 64, 0.15);
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.articles-carousel-nav svg {
  width: 1.25rem;
  height: 1.25rem;
}

.articles-carousel-nav:hover:not(:disabled) {
  background: var(--white);
  transform: translateY(-50%) scale(1.05);
}

.articles-carousel-nav:disabled {
  opacity: 0;
  pointer-events: none;
}

.articles-carousel-nav--prev {
  left: max(1rem, calc((100vw - 1120px) / 2 + 0.5rem));
}

.articles-carousel-nav--next {
  right: max(1rem, calc((100vw - 1120px) / 2 + 0.5rem));
}

.articles-footer-link {
  margin-top: 1.5rem;
  text-align: center;
}

.articles-footer-link a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--blue-600);
}

/* Page article */
.page-article .article-hero {
  padding: 7rem 0 2.5rem;
  background: linear-gradient(180deg, var(--blue-50) 0%, var(--white) 100%);
}

.page-article .article-hero-cover {
  margin-top: 2rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.page-article .article-hero-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.article-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}

.article-content .article-lead {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--blue-800);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.article-content p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--gray-700);
  margin: 0 0 1.25rem;
}

.article-content h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--blue-800);
  margin: 2rem 0 0.75rem;
}

.article-content strong {
  font-weight: 600;
  color: var(--blue-900, var(--blue-800));
}

.article-content ol {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
}

.article-content ol li {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.article-content ul {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
}

.article-content li {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--gray-700);
  margin-bottom: 0.75rem;
}

.article-content li:last-child {
  margin-bottom: 0;
}

.article-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(10, 37, 64, 0.1);
  font-size: 0.9rem;
  color: var(--gray-600);
}

.article-byline a {
  color: var(--blue-600);
  font-weight: 500;
}

.article-back {
  margin-bottom: 1.5rem;
}

.article-back a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--blue-600);
  text-decoration: none;
}

.article-back a:hover {
  color: var(--blue-800);
}

@media (min-width: 768px) {
  .articles-carousel-wrap:hover .articles-carousel-nav,
  .articles-carousel-wrap:focus-within .articles-carousel-nav {
    display: flex;
  }
}

@media (max-width: 767px) {
  .page-article .article-hero {
    padding-top: 6rem;
  }

  .article-card {
    flex-basis: min(78vw, 300px);
  }
}
