/*
 * MonCoinMaison.fr — feuille de styles globale
 * Tailwind est chargé via le CDN Play (head.html). Ce fichier complète
 * la base avec : typographie longue, prose éditorial, accessibilité.
 */

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

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

/* Préférence utilisateur : pas d'animation */
@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;
  }
}

/* Cible focus accessible — visible sur fond clair comme sombre */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #ea580c;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Transitions douces par défaut */
a, button {
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

/* Sélection de texte cohérente avec la marque */
::selection {
  background-color: rgba(234, 88, 12, 0.18);
  color: #1f2937;
}

/* ===== Typographie longue (prose magazine) ============================== */
.prose {
  max-width: 70ch;
  font-size: 1.0625rem;
  line-height: 1.75;
}

.prose h2 {
  font-size: 1.6rem;
  margin-top: 2.75rem;
  margin-bottom: 1.1rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.prose h3 {
  font-size: 1.3rem;
  margin-top: 2.25rem;
  margin-bottom: 0.85rem;
  font-weight: 700;
  line-height: 1.3;
}

.prose p {
  margin-bottom: 1.4rem;
}

.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 a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  font-weight: 600;
}
.prose a:hover {
  text-decoration-thickness: 2px;
}

.prose strong {
  font-weight: 700;
}

.prose blockquote {
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  font-style: normal;
  border-radius: 0 0.5rem 0.5rem 0;
}

.prose img {
  border-radius: 0.75rem;
  margin: 1.75rem 0;
}

/* Tables magazine — bord doux, en-tête contrasté, lignes alternées */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95rem;
  display: block;
  overflow-x: auto;
  border-radius: 0.5rem;
}

.prose thead {
  border-bottom: 2px solid #e5d9cd;
}

.prose th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 700;
  color: #1f2937;
  background-color: #f5efe8;
  white-space: nowrap;
}

.prose td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #ece1d3;
  color: #1f2937;
  vertical-align: top;
}

.prose tbody tr:nth-child(even) td {
  background-color: rgba(245, 239, 232, 0.4);
}

.prose tbody tr:hover td {
  background-color: rgba(254, 243, 236, 0.7);
}

@media (max-width: 640px) {
  .prose th, .prose td {
    padding: 0.55rem 0.75rem;
    font-size: 0.875rem;
  }
}

/* ===== Line-clamp utilities (fallback hors 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 ================================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #ece1d3;
  list-style: none;
  flex-wrap: wrap;
}

.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: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
}

.pagination a {
  color: #c2410c;
  background-color: #ffffff;
  border: 1px solid #ece1d3;
}
.pagination a:hover {
  border-color: #ea580c;
  color: #ea580c;
}

.pagination .active {
  color: #ffffff;
  background-color: #ea580c;
  border: 1px solid #ea580c;
}

.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ===== Print =========================================================== */
@media print {
  header, footer, nav, .no-print { display: none !important; }
  body { background: white; color: #000; }
  .prose { max-width: 100%; }
  a { text-decoration: underline; color: #000; }
  a[href]:after { content: " (" attr(href) ")"; font-size: 0.85em; }
}
