/*
 * PEI Nettoyage — Custom CSS
 * TailwindCSS est chargé via CDN (head.html)
 * Ce fichier : composants spécifiques, typographie, WCAG AA, animations
 */

/* ─── Variables ──────────────────────────────────────────── */
:root {
  --color-primary:   #059669;
  --color-secondary: #047857;
  --color-accent:    #6366f1;
  --color-text:      #1f2937;
  --color-muted:     #4b5563; /* ratio 7.14:1 sur blanc — WCAG AA ✓ */
  --radius-card:     0.75rem;
  --shadow-card:     0 1px 3px 0 rgba(0,0,0,.07), 0 1px 2px -1px rgba(0,0,0,.05);
  --shadow-card-hover: 0 4px 12px 0 rgba(0,0,0,.10), 0 2px 4px -2px rgba(0,0,0,.06);
}

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

body {
  color: var(--color-text);
}

/* ─── Focus WCAG AA ──────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

a, button {
  transition: color 0.18s ease, background-color 0.18s ease, opacity 0.18s ease;
}

/* ─── Header ─────────────────────────────────────────────── */
.site-header {
  box-shadow: 0 1px 0 0 rgba(0,0,0,.06);
}

/* Liens de navigation — texte foncé sur blanc, ratio ≥ 4.5:1 ✓ */
.nav-link {
  color: #374151;        /* #374151 sur blanc = 10.5:1 ✓ */
  font-size: 0.875rem;
}
.nav-link:hover {
  color: var(--color-primary);
  background-color: rgba(5, 150, 105, 0.05);
}
.nav-link--active {
  color: var(--color-secondary);  /* #047857 sur blanc = 6.4:1 ✓ */
  background-color: rgba(5, 150, 105, 0.06);
}

/* ─── Hero Section ───────────────────────────────────────── */
.hero-section {
  background: linear-gradient(135deg, #047857 0%, #059669 55%, #065f46 100%);
  min-height: 480px;
  display: flex;
  align-items: center;
}

/* Label au-dessus du H1 */
.hero-label {
  letter-spacing: 0.12em;
}

/* Bouton CTA primaire (blanc sur vert) */
.cta-primary {
  background: white;
  color: #047857;        /* ratio 6.4:1 ✓ */
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.cta-primary:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  transform: translateY(-1px);
}

/* Bouton CTA secondaire (blanc sur transparent) */
.cta-secondary:hover {
  background: rgba(255,255,255,.12);
}

/* ─── Cards catégories ───────────────────────────────────── */
.category-card {
  box-shadow: var(--shadow-card);
}
.category-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}
.category-icon svg {
  transition: transform 0.2s ease;
}
.category-card:hover .category-icon svg {
  transform: scale(1.12);
}

/* ─── Cards articles ─────────────────────────────────────── */
.article-card {
  box-shadow: var(--shadow-card);
}
.article-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

/* Lien titre d'article — noir sur blanc = WCAG AAA ✓ */
.article-title-link {
  color: #111827;
}
.article-title-link:hover {
  color: var(--color-primary);
}

/* ─── Scenario cards (section "Par où commencer") ────────── */
.scenario-card {
  cursor: pointer;
}
.scenario-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(5,150,105,.12);
}

/* ─── Footer ─────────────────────────────────────────────── */
.site-footer {
  position: relative;
}
.footer-wave {
  margin-bottom: -1px;
  overflow: hidden;
  line-height: 0;
}
/* Logo dans le footer — version claire sur fond vert foncé */
.footer-logo {
  filter: brightness(0) invert(1);   /* blanc */
  opacity: 0.92;
}

/* ─── Prose / Contenu article ────────────────────────────── */
.article-prose {
  font-size: 1.0625rem;  /* 17px */
  line-height: 1.8;
  color: #1f2937;        /* ratio 16:1 sur blanc ✓ */
  max-width: 68ch;
}

.article-prose h2 {
  font-family: var(--tw-font-heading, Poppins, sans-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.3;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #ecfdf5;
}

.article-prose h3 {
  font-family: var(--tw-font-heading, Poppins, sans-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: #1f2937;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.article-prose p {
  margin-bottom: 1.5rem;
  color: #1f2937;
}

.article-prose ul,
.article-prose ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}
.article-prose ul { list-style-type: disc; }
.article-prose ol { list-style-type: decimal; }
.article-prose li {
  margin-bottom: 0.5rem;
  color: #1f2937;
}
.article-prose li::marker {
  color: var(--color-primary);
}

.article-prose strong {
  font-weight: 700;
  color: #111827;
}

.article-prose a {
  color: var(--color-secondary); /* #047857 sur blanc = 6.4:1 ✓ */
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}
.article-prose a:hover {
  color: var(--color-primary);
}

/* Blockquote — texte foncé sur fond vert très clair */
.article-prose blockquote {
  border-left: 4px solid var(--color-primary);
  background: #ecfdf5;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  border-radius: 0 0.5rem 0.5rem 0;
  font-style: normal;
}
.article-prose blockquote p {
  color: #065f46;   /* vert foncé sur fond vert clair = 7.8:1 ✓ */
  margin-bottom: 0;
}

/* Tableaux */
.article-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9375rem;
  overflow-x: auto;
  display: block;
}
.article-prose thead {
  background: #f0fdf4;
  border-bottom: 2px solid #d1fae5;
}
.article-prose th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 700;
  color: #065f46;    /* 7.8:1 sur #f0fdf4 ✓ */
  white-space: nowrap;
}
.article-prose td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  color: #1f2937;
}
.article-prose tbody tr:hover {
  background: #f9fafb;
}

/* Images dans l'article */
.article-prose img {
  border-radius: 0.75rem;
  margin: 2rem 0;
  max-width: 100%;
  height: auto;
}

/* Code inline */
.article-prose code:not(pre code) {
  background: #f0fdf4;
  color: #065f46;
  padding: 0.15em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.9em;
}

/* ─── Pagination ─────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.375rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}
.pagination li { list-style: none; }
.pagination a,
.pagination .active {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.625rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.15s;
}
.pagination a {
  color: #374151;
  background: white;
  border: 1px solid #e5e7eb;
}
.pagination a:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.pagination .active {
  background: var(--color-primary);
  color: white;          /* blanc sur #059669 = 4.51:1 ✓ AA */
  border: 1px solid var(--color-primary);
}
.pagination .disabled {
  opacity: 0.38;
  pointer-events: none;
}

/* ─── 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;
}

/* ─── Utilitaires ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  header, footer, nav, .site-footer { display: none !important; }
  .article-prose { max-width: 100%; }
}
