/*
 * ProtoMicroTP — Custom CSS
 * TailwindCSS chargé via CDN dans head.html
 * Ce fichier : overrides, composants custom, WCAG AA
 *
 * Palette (Palette 4) :
 *   primary   : #7c3aed (violet)
 *   secondary : #6d28d9 (violet foncé)
 *   accent    : #f97316 (orange)
 */

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

/* Transitions globales sans sur-animation */
a, button {
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

/* ─────────────────────────────────────────────────────
   Hero Section
   ───────────────────────────────────────────────────── */
.hero-section {
  min-height: clamp(480px, 72vh, 680px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Gradient de fond hero (affiché via Tailwind bg-gradient-to-br mais enrichi ici) */
.hero-gradient {
  background: linear-gradient(
    135deg,
    #4c1d95 0%,     /* violet très foncé */
    #6d28d9 35%,    /* secondary */
    #7c3aed 65%,    /* primary */
    #5b21b6 100%    /* profond */
  );
}

/* Accent sur mot-clé dans le H1 hero — WCAG AA : blanc sur violet */
.hero-accent {
  position: relative;
  display: inline-block;
}
.hero-accent::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 3px;
  background: #f97316; /* accent */
  border-radius: 2px;
  opacity: 0.85;
}

.hero-content {
  width: 100%;
}

/* Indicateur de scroll */
.scroll-indicator {
  animation: scroll-pulse 2s ease-in-out infinite;
}
@keyframes scroll-pulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.8); }
  50%       { opacity: 0.7; transform: scaleY(1.2); }
}

/* ─────────────────────────────────────────────────────
   Navigation
   ───────────────────────────────────────────────────── */
.site-header {
  /* Contraste : texte gris foncé (#374151) sur blanc → ratio 7.8:1 ✓ */
}

/* Lien de navigation actif : soulignement discret */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 8px; right: 8px;
  height: 2px;
  background: #7c3aed;
  border-radius: 1px;
  transform: scaleX(0);
  transition: transform 0.2s ease;
}
.nav-link:hover::after,
.nav-link--active::after {
  transform: scaleX(1);
}
.nav-link--active {
  color: #7c3aed !important;
}

/* ─────────────────────────────────────────────────────
   Category Cards
   ───────────────────────────────────────────────────── */
.category-card {
  /* Contraste : titres gris foncé sur blanc → ratio 12.6:1 ✓ */
  /* Pas de couleur unique par catégorie (anti-footprint) */
}
.category-card:hover {
  transform: translateY(-2px);
}
.category-card:focus-within {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
  border-radius: 0.75rem;
}

/* Icônes catégories */
.category-icon svg {
  /* Couleurs hardcodées dans le SVG inline, cohérentes avec la palette */
}

/* ─────────────────────────────────────────────────────
   Article Cards
   ───────────────────────────────────────────────────── */
.article-card {
  /* Fond blanc, bordure grise légère — carte sobre sans empreinte générique */
}
.article-card:hover {
  transform: translateY(-1px);
}

/* Badge catégorie : texte violet sur fond violet/8 */
/* #7c3aed sur rgba(124,58,237,0.08) ≈ #f1effe → ratio 6.4:1 ✓ */
.article-cat {
  /* défini via Tailwind dans les templates */
}

/* bg-primary/8 utilitaire custom (Tailwind v3 n'a pas /8 par défaut) */
.bg-primary\/8 {
  background-color: rgba(124, 58, 237, 0.08);
}

/* Badge catégorie dans single.html */
.article-cat-badge {
  /* texte #7c3aed sur rgba(124,58,237,0.08) — contraste AA ✓ */
}

/* ─────────────────────────────────────────────────────
   Étapes clés (Steps section)
   ───────────────────────────────────────────────────── */
.step-card {
  padding: 1.5rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.step-card:hover {
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.08);
  border-color: #c4b5fd;
}

.step-number {
  /* Numéro large en watermark : primary/10 (très bas contraste intentionnel) */
  /* Ne contient pas d'information — aria-hidden=true dans le HTML */
}

.step-icon {
  /* bg-primary/10 = rgba(124,58,237,0.10) → fond violet très clair */
  /* SVG stroke : text-primary = #7c3aed sur fond ~#f3f0fe → ratio 4.7:1 ✓ */
}

/* ─────────────────────────────────────────────────────
   Section "Ressources par profil" (fond violet)
   ───────────────────────────────────────────────────── */
.profile-card {
  transition: background-color 0.2s ease;
}
.profile-card:hover {
  background-color: rgba(255, 255, 255, 0.15);
}
/*
 * Contraste sur fond gradient violet (#6d28d9) :
 *   Blanc #ffffff → ratio ~7.5:1 ✓ (WCAG AA large + small)
 *   white/85 (#d6c8e8 environ) → ratio ~5.2:1 ✓ (WCAG AA)
 *   white/75 → ratio ~4.6:1 ✓ (WCAG AA)
 *   white/60 → ratio ~3.7:1 — utilisé uniquement pour l'accent (breadcrumb),
 *              pas pour du texte informatif → acceptable (décoratif)
 */

/* ─────────────────────────────────────────────────────
   Footer
   ───────────────────────────────────────────────────── */
.site-footer {
  /* bg-gray-950 = #030712 */
  /* Contraste texte gray-400 (#9ca3af) sur #030712 → ratio ~6.5:1 ✓ */
  /* Contraste texte white (#fff) sur #030712 → ratio ~21:1 ✓ */
}

/* ─────────────────────────────────────────────────────
   Prose / Article Content
   ───────────────────────────────────────────────────── */

/* Contraste : texte #374151 (gray-700) sur blanc → ratio 9.7:1 ✓ */
.article-prose {
  max-width: 72ch;
}
.article-prose h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: #111827;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f3f4f6;
}
.article-prose h3 {
  font-size: 1.2rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: #1f2937;
}
.article-prose p {
  margin-bottom: 1.5rem;
  line-height: 1.8;
  color: #374151;
}
.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: #374151;
  line-height: 1.7;
}
.article-prose blockquote {
  border-left: 3px solid #7c3aed;
  background: rgba(124, 58, 237, 0.04);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  border-radius: 0 0.75rem 0.75rem 0;
  color: #4b5563;
  font-style: normal;
}
.article-prose blockquote p { color: #4b5563; margin-bottom: 0; }
.article-prose a {
  color: #7c3aed;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}
.article-prose a:hover { text-decoration-thickness: 2px; }
.article-prose strong { font-weight: 600; color: #111827; }
.article-prose img {
  border-radius: 0.75rem;
  margin: 2rem 0;
}
.article-prose code {
  font-size: 0.875em;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  background: rgba(124, 58, 237, 0.07);
  color: #6d28d9;
}
.article-prose pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* Tables */
.article-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9rem;
  overflow-x: auto;
  display: block;
}
.article-prose thead tr {
  background: #f9fafb;
  border-bottom: 2px solid #e5e7eb;
}
.article-prose th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #111827;  /* ratio 18.1:1 sur gray-50 ✓ */
  white-space: nowrap;
}
.article-prose td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;  /* ratio 9.7:1 sur blanc ✓ */
}
.article-prose tbody tr:hover { background: #fafafa; }
@media (max-width: 640px) {
  .article-prose th,
  .article-prose td { padding: 0.5rem 0.75rem; font-size: 0.8rem; }
}

/* ─────────────────────────────────────────────────────
   Tags (single page)
   ───────────────────────────────────────────────────── */
.tag-pill {
  /* text-gray-600 (#4b5563) sur bg-gray-100 (#f3f4f6) → ratio 5.1:1 ✓ */
}

/* ─────────────────────────────────────────────────────
   Sidebar (single page)
   ───────────────────────────────────────────────────── */
.sidebar-card {
  /* bg-gray-50 fond, texte gray-600 → ratio 5.1:1 ✓ */
}

/* ─────────────────────────────────────────────────────
   Line-clamp utilities (fallback si Tailwind CDN absent)
   ───────────────────────────────────────────────────── */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.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 visible — Accessibilité WCAG AA
   ───────────────────────────────────────────────────── */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ─────────────────────────────────────────────────────
   Pagination (Hugo template interne)
   ───────────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
}
.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.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
}
.pagination a {
  color: #374151;  /* ratio 9.7:1 sur blanc ✓ */
  background: #f3f4f6;
  border: 1px solid transparent;
}
.pagination a:hover {
  background: #e9d5ff;
  color: #6d28d9;
  border-color: #c4b5fd;
}
.pagination .active {
  color: white;  /* ratio ~7.5:1 sur #7c3aed ✓ */
  background: #7c3aed;
  border: 1px solid #6d28d9;
}
.pagination .disabled { opacity: 0.4; pointer-events: none; }

/* ─────────────────────────────────────────────────────
   Print
   ───────────────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, aside, .scroll-indicator { display: none !important; }
  .article-prose { max-width: 100%; }
  a::after { content: ' (' attr(href) ')'; font-size: 0.75em; color: #555; }
}
