/*
 * MR Motocross — Custom CSS
 * TailwindCSS chargé via CDN (head.html)
 * Ce fichier : styles custom additionnels, animations, composants spécifiques
 */

/* ─── Base ─────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* ─── Transitions globales ──────────────────────────────────── */
a, button {
  transition: color 0.2s ease, background-color 0.2s ease,
              border-color 0.2s ease, box-shadow 0.2s ease,
              transform 0.2s ease, opacity 0.2s ease;
}

/* ─── Hero — clip diagonal bottom ──────────────────────────── */
.hero-clip-bottom {
  clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%);
}

/* ─── Cards ─────────────────────────────────────────────────── */
.card-hover {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.12);
}

/* Article card image: maintains aspect ratio placeholder even without image */
.article-card-image-wrapper {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: #f3f4f6;
}

/* ─── Rubrique cards ─────────────────────────────────────────── */
.rubrique-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.rubrique-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background-color: #dc2626;
  transition: width 0.3s ease;
}
.rubrique-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.1);
}
.rubrique-card:hover::after {
  width: 100%;
}

/* ─── Decorative heading accent ─────────────────────────────── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.section-label::before {
  content: '';
  display: block;
  width: 2rem;
  height: 2px;
  background-color: currentColor;
  flex-shrink: 0;
}

/* ─── Journey step cards ─────────────────────────────────────── */
.step-number {
  font-family: 'DM Serif Display', 'Georgia', serif;
  font-size: 4.5rem;
  font-weight: 900;
  line-height: 1;
  color: #e5e7eb;
  user-select: none;
  transition: color 0.3s ease;
}
.step-card:hover .step-number {
  color: #fecaca;
}

/* ─── Prose — article body ───────────────────────────────────── */
.prose {
  max-width: 68ch;
  line-height: 1.75;
  color: #374151;
}
.prose h2 {
  font-size: 1.5rem;
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: #111827;
}
.prose h3 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: #111827;
}
.prose p {
  margin-bottom: 1.5rem;
}
.prose ul,
.prose ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}
.prose ul  { list-style-type: disc; }
.prose ol  { list-style-type: decimal; }
.prose li  { margin-bottom: 0.5rem; }
.prose blockquote {
  border-left: 4px solid #dc2626;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #57534e;
  background: #fafaf9;
  border-radius: 0 0.5rem 0.5rem 0;
}
.prose a {
  color: #dc2626;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  font-weight: 500;
}
.prose a:hover {
  text-decoration-thickness: 2px;
  color: #b91c1c;
}
.prose strong { font-weight: 700; color: #111827; }
.prose img {
  border-radius: 0.5rem;
  margin: 1.75rem 0;
  width: 100%;
}

/* Prose tables */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9rem;
  display: block;
  overflow-x: auto;
}
.prose thead {
  border-bottom: 2px solid #e5e7eb;
}
.prose th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #111827;
  background: #f9fafb;
  white-space: nowrap;
}
.prose td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
  vertical-align: top;
}
.prose tbody tr:hover { background: #f9fafb; }

/* ─── Line clamp utilities ───────────────────────────────────── */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Focus visible (accessibilité) ─────────────────────────── */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 3px;
  border-radius: 3px;
}

/* ─── Pagination (Hugo internal) ────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid #e5e7eb;
  list-style: none;
  padding-left: 0;
}
.pagination a,
.pagination .active {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
}
.pagination a {
  color: #374151;
  background: #f3f4f6;
}
.pagination a:hover { background: #e5e7eb; color: #111827; }
.pagination .active {
  color: #ffffff;
  background: #dc2626;
}
.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ─── Print ──────────────────────────────────────────────────── */
@media print {
  header, footer, nav, .no-print { display: none !important; }
  .prose { max-width: 100%; }
}
