/*
 * Le Parc de Crécy — Feuille de style éditoriale
 * TailwindCSS est chargé via CDN dans head.html
 * Ce fichier ajoute les nuances typographiques, ornements et états d'accessibilité
 * qui ne tiennent pas dans des utilitaires.
 */

/* ─────────────────────────────────────────────
 * 1. Base & rendu typographique
 * ───────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

/* États focus accessibles WCAG 2.1 AA */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #047857;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ─────────────────────────────────────────────
 * 2. Ornements éditoriaux (filets, kickers)
 * ───────────────────────────────────────────── */

/* "Eyebrow" / sur-titre — petit chapeau majuscule lettre-spacé */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1;
}

.eyebrow::before,
.eyebrow::after {
  content: "";
  display: inline-block;
  width: 1.75rem;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

/* Variante simple sans filets (pour cards) */
.eyebrow-plain {
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Filet décoratif horizontal sous un titre de section */
.section-rule {
  display: block;
  width: 3rem;
  height: 2px;
  background: linear-gradient(90deg, #059669, #6366f1);
  border: none;
  margin: 0 auto 1.5rem;
  border-radius: 2px;
}

/* ─────────────────────────────────────────────
 * 3. Hero — robustesse anti-FOIT et lisibilité
 * ───────────────────────────────────────────── */

/* Renfort lisibilité : texte blanc sur image (drop-shadow tailwind utilisé inline) */
.hero-shadow-strong {
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55), 0 1px 3px rgba(0, 0, 0, 0.4);
}
.hero-shadow-soft {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

/* ─────────────────────────────────────────────
 * 4. Typographie d'article (.prose)
 * ───────────────────────────────────────────── */

.prose { max-width: 68ch; }

.prose h2 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.625rem;
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.prose h3 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
  color: #1e293b;
}

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

.prose ul, .prose ol {
  margin: 0 0 1.5rem;
  padding-left: 1.6rem;
}
.prose ul { list-style-type: disc; }
.prose ol { list-style-type: decimal; }
.prose li {
  margin-bottom: 0.55rem;
  color: #334155;
}
.prose li::marker { color: #059669; }

.prose blockquote {
  border-left: 3px solid #059669;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #475569;
  background: #f0fdf4;
  border-radius: 0 0.5rem 0.5rem 0;
  position: relative;
}

.prose a {
  color: #047857;
  text-decoration: underline;
  text-decoration-color: rgba(4, 120, 87, 0.4);
  text-underline-offset: 3px;
  font-weight: 500;
}
.prose a:hover {
  color: #064e3b;
  text-decoration-color: currentColor;
}

.prose strong {
  font-weight: 700;
  color: #0f172a;
}

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

/* Tableaux : style éditorial, scrollable sur mobile */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9375rem;
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}
.prose thead {
  border-bottom: 2px solid #d1fae5;
}
.prose th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 700;
  color: #064e3b;
  background: #f0fdf4;
}
.prose td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  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;
  }
}

/* ─────────────────────────────────────────────
 * 5. Utilitaires de troncature
 * ───────────────────────────────────────────── */
.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;
}
.line-clamp-4 {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─────────────────────────────────────────────
 * 6. Cartes et états interactifs
 * ───────────────────────────────────────────── */

/* Card hover lift */
.card-lift {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card-lift:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px -20px rgba(15, 23, 42, 0.18);
}

/* Bouton flèche progressive */
.cta-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.cta-arrow .arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}
.cta-arrow:hover .arrow {
  transform: translateX(3px);
}

/* ─────────────────────────────────────────────
 * 7. Pagination Hugo
 * ───────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid #e2e8f0;
  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: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'Nunito', system-ui, sans-serif;
}
.pagination a {
  color: #334155;
  background: #f1f5f9;
}
.pagination a:hover {
  background: #d1fae5;
  color: #064e3b;
}
.pagination .active {
  color: #ffffff;
  background: #059669;
}
.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

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

/* ─────────────────────────────────────────────
 * 9. Préférences d'utilisateur
 * ───────────────────────────────────────────── */
@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;
  }
}
