/*
 * Étang des Saules — design system éditorial
 * Inspiration : magazine slow press · papier crème · typographie serif
 * Contraste : WCAG AA garanti sur l'ensemble des paires couleur
 *
 * Tailwind CDN gère les utilitaires ; ce fichier ajoute le caractère
 * éditorial (typographie .prose, filets, numéros de section, etc.)
 */

/* ============================================================
   1. RESET & BASE
   ============================================================ */
:root {
  --es-paper: #fafaf9;            /* fond crème */
  --es-paper-warm: #f5f5f4;       /* alt léger */
  --es-ink: #1c1917;              /* texte principal */
  --es-ink-soft: #44403c;         /* texte secondaire */
  --es-ink-muted: #78716c;        /* méta */
  --es-rule: #d6d3d1;             /* filets fins */
  --es-rule-soft: #e7e5e4;        /* filets très subtils */
  --es-leaf: #4d7c0f;             /* vert olive — accent texte */
  --es-leaf-bright: #65a30d;      /* lime — accents UI larges */
  --es-leaf-deep: #365314;        /* vert très profond — hover */
  --es-violet: #8b5cf6;           /* violet — touches éditoriales */
  --es-shadow: 0 1px 2px rgba(28, 25, 23, 0.04), 0 4px 12px rgba(28, 25, 23, 0.04);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background-color: var(--es-paper);
}

body {
  background-color: var(--es-paper);
  color: var(--es-ink);
}

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 avec couleur de marque */
::selection {
  background-color: var(--es-leaf-bright);
  color: #fff;
}

/* ============================================================
   2. TYPOGRAPHIE ÉDITORIALE — utilitaires
   ============================================================ */

/* Eyebrow : libellé thématique tout en majuscules avant un titre */
.es-eyebrow {
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--es-leaf);
}

/* Numéros décoratifs de section (01, 02...) */
.es-numeral {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--es-leaf);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

/* Titre display XL pour le hero */
.es-display {
  font-family: 'Merriweather', Georgia, serif;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--es-ink);
}

/* Filet horizontal éditorial */
.es-rule {
  display: inline-block;
  width: 2.5rem;
  height: 1px;
  background: var(--es-leaf);
  vertical-align: middle;
}

/* Citation éditoriale (édito hero) */
.es-pullquote {
  font-family: 'Merriweather', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  color: var(--es-ink-soft);
  line-height: 1.55;
}

/* ============================================================
   3. SVG DÉCORATIF (hero) — branche de saule pleureur
   ============================================================ */

.es-willow-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.5;
}
.es-willow-svg path {
  stroke: var(--es-leaf);
  stroke-width: 1;
  fill: none;
  opacity: 0.45;
}
.es-willow-svg .es-leaf-shape {
  fill: var(--es-leaf-bright);
  stroke: none;
  opacity: 0.18;
}
.es-willow-svg .es-ripple {
  stroke: var(--es-leaf);
  stroke-width: 0.8;
  fill: none;
  opacity: 0.3;
}

/* ============================================================
   4. CARDS, BOUTONS, COMPOSANTS UI
   ============================================================ */

/* Carte article éditoriale */
.es-card {
  background: #fff;
  border: 1px solid var(--es-rule-soft);
  border-radius: 4px;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.es-card:hover {
  border-color: var(--es-leaf);
  transform: translateY(-2px);
}

/* Bouton primaire — vert olive (contraste AAA sur blanc/crème) */
.es-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  font-family: 'Nunito', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
}
.es-btn-primary {
  background: var(--es-ink);
  color: var(--es-paper);
  border-color: var(--es-ink);
}
.es-btn-primary:hover {
  background: var(--es-leaf-deep);
  border-color: var(--es-leaf-deep);
  color: #fff;
}
.es-btn-secondary {
  background: transparent;
  color: var(--es-ink);
  border-color: var(--es-ink);
}
.es-btn-secondary:hover {
  background: var(--es-ink);
  color: var(--es-paper);
}

/* Catégorie chip (réutilisé entre listing et single) */
.es-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.7rem;
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--es-leaf);
  background: rgba(132, 204, 22, 0.08);
  border-radius: 2px;
}

/* ============================================================
   5. PROSE — corps des articles
   ============================================================ */
.prose {
  max-width: 68ch;
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--es-ink);
}
.prose h2 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.625rem;
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--es-ink);
}
.prose h3 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
  color: var(--es-ink);
}
.prose p {
  margin-bottom: 1.5rem;
  line-height: 1.75;
  color: var(--es-ink-soft);
  font-size: 1.0625rem;
}
.prose ul, .prose ol {
  margin: 0 0 1.5rem 0;
  padding-left: 1.5rem;
  color: var(--es-ink-soft);
}
.prose ul { list-style-type: disc; }
.prose ol { list-style-type: decimal; }
.prose li {
  margin-bottom: 0.5rem;
  line-height: 1.75;
}
.prose strong {
  color: var(--es-ink);
  font-weight: 700;
}
.prose a {
  color: var(--es-leaf);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  font-weight: 600;
}
.prose a:hover {
  color: var(--es-leaf-deep);
  text-decoration-thickness: 2px;
}
.prose blockquote {
  border-left: 2px solid var(--es-leaf);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 2rem 0;
  font-family: 'Merriweather', Georgia, serif;
  font-style: italic;
  font-size: 1.125rem;
  color: var(--es-ink-soft);
  line-height: 1.6;
}
.prose blockquote strong {
  color: var(--es-ink);
  font-style: normal;
}
.prose img {
  border-radius: 4px;
  margin: 2rem 0;
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--es-rule);
  margin: 3rem 0;
}
.prose code {
  background: var(--es-paper-warm);
  padding: 0.15rem 0.4rem;
  border-radius: 2px;
  font-size: 0.9em;
  color: var(--es-ink);
}

/* Tables éditoriales */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95rem;
}
.prose thead {
  border-bottom: 2px solid var(--es-ink);
}
.prose th {
  padding: 0.85rem 1rem;
  text-align: left;
  font-family: 'Nunito', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--es-ink);
  background: transparent;
}
.prose td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--es-rule-soft);
  color: var(--es-ink-soft);
}
.prose tbody tr:hover {
  background: var(--es-paper-warm);
}
.prose tbody tr:last-child td {
  border-bottom: 1px solid var(--es-rule);
}
@media (max-width: 640px) {
  .prose table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  .prose th, .prose td {
    padding: 0.6rem 0.75rem;
    font-size: 0.875rem;
  }
}

/* ============================================================
   6. UTILITAIRES — line clamp, focus, pagination
   ============================================================ */
.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;
}

/* Focus accessible — visibilité forte sans bord disgracieux */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--es-leaf);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Pagination Hugo (template interne) */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--es-rule);
  list-style: none;
  padding-inline-start: 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.75rem;
  border-radius: 2px;
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--es-rule);
}
.pagination a {
  color: var(--es-ink);
  background: transparent;
}
.pagination a:hover {
  background: var(--es-ink);
  color: var(--es-paper);
  border-color: var(--es-ink);
}
.pagination .active {
  color: var(--es-paper);
  background: var(--es-ink);
  border-color: var(--es-ink);
}
.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ============================================================
   7. PRINT
   ============================================================ */
@media print {
  header, footer, nav { display: none !important; }
  .prose { max-width: 100%; color: #000; }
  body { background: #fff; }
}
