/*
 * Quel Déshumidificateur — feuille de styles globale
 * TailwindCSS est chargé via CDN dans head.html
 * Ce fichier ajoute :
 *   - styles de base (smooth scroll, sélection, focus)
 *   - typographie .prose (lecture article)
 *   - utilitaires line-clamp / pagination
 *   - règles d'impression
 */

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

body {
  background: #f8fafc; /* slate-50 — alignement homepage */
}

::selection {
  background: rgba(8, 145, 178, 0.18); /* primary cyan, 18% */
  color: #0e7490;
}

a, button {
  transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

a:focus-visible, button:focus-visible {
  outline: 2px solid #0891b2;
  outline-offset: 3px;
  border-radius: 4px;
}

img {
  max-width: 100%;
  height: auto;
}

/* ----------------------------------------------------------------- */
/* Typographie article (.prose)                                      */
/* Surcharge légère du @tailwindcss/typography                        */
/* ----------------------------------------------------------------- */
.prose {
  max-width: 70ch;
}
.prose h2 {
  font-size: 1.875rem;
  line-height: 1.25;
}
.prose h3 {
  font-size: 1.25rem;
  line-height: 1.3;
}
.prose p {
  color: #334155; /* slate-700 */
}
.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; color: #334155; }

.prose blockquote {
  font-style: normal;
  margin: 2rem 0;
  background: rgba(207, 250, 254, 0.45); /* cyan-100/45 */
  border-radius: 0 0.5rem 0.5rem 0;
}
.prose blockquote p {
  margin-bottom: 0.5rem;
}

.prose a {
  text-decoration: none;
  font-weight: 500;
}
.prose a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

.prose strong { font-weight: 600; }
.prose img { border-radius: 0.5rem; margin: 1.5rem 0; }

/* Tableaux dans le contenu markdown */
.prose table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 2rem 0;
  font-size: 0.9375rem;
  overflow: hidden;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0; /* slate-200 */
  display: table;
}
.prose thead {
  background: #f1f5f9; /* slate-100 */
  border-bottom: 1px solid #e2e8f0;
}
.prose th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #0f172a; /* slate-900 */
}
.prose td {
  padding: 0.75rem 1rem;
  border-top: 1px solid #f1f5f9;
  color: #334155;
}
.prose tbody tr:hover {
  background: #f8fafc;
}
@media (max-width: 640px) {
  .prose th, .prose td {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }
}

/* ----------------------------------------------------------------- */
/* Utilitaires line-clamp                                             */
/* ----------------------------------------------------------------- */
.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 (template interne Hugo)                                 */
/* ----------------------------------------------------------------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e2e8f0;
}
.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 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}
.pagination a {
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.pagination a:hover {
  background: #ecfeff; /* cyan-50 */
  color: #0891b2;
  border-color: #a5f3fc;
}
.pagination .active {
  color: #ffffff;
  background: #0891b2;
  border: 1px solid #0e7490;
}
.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ----------------------------------------------------------------- */
/* Préférence utilisateur : reduce motion                             */
/* ----------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ----------------------------------------------------------------- */
/* Impression                                                        */
/* ----------------------------------------------------------------- */
@media print {
  header, footer, nav { display: none !important; }
  body { background: #ffffff; }
  .prose { max-width: 100%; color: #000; }
  a { color: #000; text-decoration: underline; }
}
