/*
 * La Perle d'Argent — Custom CSS
 *
 * Tailwind est chargé via CDN dans head.html. Ce fichier complète :
 *  - les ajustements typographiques (.prose) pour un rendu magazine,
 *  - les éléments natifs Hugo (pagination, focus visible),
 *  - quelques règles d'impression.
 */

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

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

/* Sélection texte cohérente avec la marque */
::selection {
  background-color: rgba(79, 70, 229, 0.18); /* accent indigo @ 18% */
  color: #064e3b;                            /* secondary */
}

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

/* Focus visible (clavier) — contraste fort */
a:focus-visible, button:focus-visible {
  outline: 2px solid #4f46e5; /* accent */
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Typographie longue (.prose) ---------- */
.prose { max-width: 70ch; }

.prose h2 {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 1.6rem;
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: #064e3b; /* secondary */
}
.prose h3 {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: #065f46; /* primary */
}

.prose p {
  margin-bottom: 1.5rem;
  line-height: 1.78;
  color: #1f2937; /* slate-800 — contraste 13:1 sur blanc */
}

/* Premier paragraphe : initiale légèrement plus grosse pour effet magazine */
.prose > p:first-of-type {
  font-size: 1.0625rem;
}

.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.4rem;
  color: #1f2937;
  line-height: 1.7;
}
.prose li::marker {
  color: #065f46;
}

.prose blockquote {
  border-left: 3px solid #065f46;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  font-style: normal;
  color: #374151;
  background: #f5f5f4; /* stone-100 */
  border-radius: 0 0.5rem 0.5rem 0;
}
.prose blockquote p:last-of-type { margin-bottom: 0; }

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

.prose strong {
  font-weight: 700;
  color: #064e3b;
}

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

.prose hr {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin: 2.5rem 0;
}

/* ---------- Tables (prose) ---------- */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0;
  font-size: 0.95rem;
  display: block;
  overflow-x: auto;
}
.prose thead {
  border-bottom: 2px solid #d1d5db;
}
.prose th {
  background-color: #f0fdf4; /* emerald-50 */
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #064e3b;
  white-space: nowrap;
}
.prose td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  color: #1f2937;
}
.prose tbody tr:nth-child(even) {
  background-color: #fafaf9; /* stone-50 */
}
.prose tbody tr:hover {
  background-color: #f0fdf4;
}
@media (max-width: 640px) {
  .prose th, .prose td {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }
}

/* ---------- Line clamp utilities (utilisées dans les cards) ---------- */
.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 Hugo interne) ---------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.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 0.875rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: "Lato", system-ui, sans-serif;
}
.pagination a {
  color: #064e3b;
  background: #ffffff;
  border: 1px solid #e5e7eb;
}
.pagination a:hover {
  background: #f0fdf4;
  border-color: #065f46;
}
.pagination .active {
  color: #ffffff;
  background: #065f46; /* primary — contraste 6.85:1 sur blanc, AAA */
}
.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

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

/* ---------- Reduce motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
