/*
 * jkacreil.fr — Custom CSS (editorial magazine style)
 * TailwindCSS est chargé via CDN dans head.html ; ce fichier
 * contient uniquement les utilitaires custom non couverts par Tailwind.
 */

/* ====================================================================
   Base
   ==================================================================== */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

/* Selection — accent éditorial discret */
::selection {
  background-color: #f97316;
  color: #ffffff;
}

/* Transitions globales sobres */
a, button {
  transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .2s ease, opacity .2s ease;
}

/* ====================================================================
   Focus visible — accessibilité (WCAG)
   ==================================================================== */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 3px;
  border-radius: 3px;
}

/* ====================================================================
   Prose — typographie longue lecture
   Surcharge légère du @tailwindcss/typography pour un rendu magazine.
   ==================================================================== */
.prose {
  max-width: 68ch;
}

/* Premier paragraphe : taille légèrement supérieure (chapô) */
.prose > p:first-of-type {
  font-size: 1.125rem;
  line-height: 1.7;
  color: #374151;
}

/* H2 / H3 — espacement éditorial respirant */
.prose h2 {
  font-size: 1.75rem;
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.prose h3 {
  font-size: 1.25rem;
  margin-top: 2.25rem;
  margin-bottom: .75rem;
  font-weight: 600;
}

.prose p {
  margin-bottom: 1.4rem;
  line-height: 1.75;
  color: #374151;
}

.prose ul, .prose ol {
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}
.prose ul { list-style-type: disc; }
.prose ol { list-style-type: decimal; }
.prose li {
  margin-bottom: .5rem;
  color: #374151;
  line-height: 1.65;
}

.prose blockquote {
  margin: 2rem 0;
  font-style: normal;
  color: #374151;
  position: relative;
}

.prose strong {
  font-weight: 600;
  color: #111827;
}

.prose img {
  border-radius: .5rem;
  margin: 2rem 0;
}

/* Tables — éditorial sobre */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: .9375rem;
  display: block;
  overflow-x: auto;
}
.prose thead {
  border-bottom: 2px solid #d1d5db;
}
.prose th {
  padding: .75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #111827;
  background: #f9fafb;
  white-space: nowrap;
}
.prose td {
  padding: .75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
}
.prose tbody tr:hover {
  background: #f9fafb;
}
@media (max-width: 640px) {
  .prose th, .prose td {
    padding: .5rem .75rem;
    font-size: .875rem;
  }
}

/* ====================================================================
   Line clamp — utilitaires manquants en CDN tailwind
   ==================================================================== */
.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;
}

/* ====================================================================
   Pagination Hugo — style éditorial
   ==================================================================== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
  list-style: none;
  padding-left: 0;
}
.pagination li { list-style: none; }
.pagination a,
.pagination .active {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 .75rem;
  border-radius: .375rem;
  font-size: .875rem;
  font-weight: 500;
  font-family: 'DM Sans', system-ui, sans-serif;
  transition: all .2s;
}
.pagination a {
  color: #374151;
  background: #f3f4f6;
}
.pagination a:hover {
  background: #7c3aed;
  color: #ffffff;
}
.pagination .active {
  color: #ffffff;
  background: #7c3aed;
}
.pagination .disabled {
  opacity: .4;
  pointer-events: none;
}

/* ====================================================================
   Print styles — articles imprimables propres
   ==================================================================== */
@media print {
  header, footer, nav, .no-print { display: none !important; }
  .prose { max-width: 100%; color: #000; }
  a { color: #000; text-decoration: underline; }
  body { background: #fff; }
}

/* ====================================================================
   Reduced motion — respecte les préférences utilisateur
   ==================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
