/*
 * SR Financements Pro — Custom CSS
 * TailwindCSS chargé via CDN dans head.html
 * Palette : Indigo #4f46e5 / #4338ca | Accent Vert #22c55e
 * Fonts   : Poppins (titres) / Source Sans Pro (corps)
 */

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

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

/* ============================================================
   BARRE DE PROGRESSION DE LECTURE
   Animée par JS dans scripts.html
   ============================================================ */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #4f46e5 0%, #22c55e 100%);
  z-index: 9999;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ============================================================
   NAVIGATION — ONGLETS AVEC UNDERLINE ACTIF
   ============================================================ */
.nav-tab-link {
  position: relative;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.nav-tab-link:hover {
  border-bottom-color: #c7d2fe; /* indigo-200 */
}
.nav-tab-link.nav-tab-active,
.nav-tab-link[aria-current="page"] {
  color: #4f46e5;
  border-bottom-color: #4f46e5;
}

/* ============================================================
   CARTES — EFFET LIFT AU SURVOL
   ============================================================ */
.card-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-lift:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(79, 70, 229, 0.10), 0 2px 8px rgba(0,0,0,0.06);
}

/* ============================================================
   HERO — GRILLE DE POINTS DÉCORATIVE
   ============================================================ */
.hero-dot-grid {
  background-image: radial-gradient(circle, rgba(255,255,255,0.18) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* ============================================================
   FOCUS VISIBLE — ACCESSIBILITÉ WCAG AA
   ============================================================ */
:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 3px;
  border-radius: 4px;
}
a:focus-visible,
button:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
   PROSE — ARTICLE CONTENT
   ============================================================ */
.prose {
  max-width: 68ch;
}

/* Headings */
.prose h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: #111827;
}
.prose h3 {
  font-size: 1.2rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: #1f2937;
}

/* Paragraphes */
.prose p {
  margin-bottom: 1.5rem;
  line-height: 1.8;
  color: #374151;
}

/* Listes */
.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.5rem;
  color: #374151;
  line-height: 1.7;
}

/* Citation -->  fond indigo très clair, bordure primaire -->
.prose blockquote {
  border-left: 4px solid #4f46e5;
  background: #f5f3ff;
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  border-radius: 0 0.5rem 0.5rem 0;
  font-style: normal;
  color: #374151;
}
.prose blockquote strong {
  color: #4f46e5;
}

/* Liens dans prose */
.prose a {
  color: #4f46e5;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.prose a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

/* Strong */
.prose strong {
  font-weight: 600;
  color: #111827;
}

/* Images */
.prose img {
  border-radius: 0.5rem;
  margin: 1.5rem 0;
}

/* Code inline */
.prose code:not(pre code) {
  background: #ede9fe;
  color: #4f46e5;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

/* ============================================================
   TABLES DANS PROSE
   ============================================================ */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9375rem;
  overflow-x: auto;
  display: block;
  -webkit-overflow-scrolling: touch;
}
.prose thead {
  border-bottom: 2px solid #e5e7eb;
}
.prose th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: #374151;
  background: #f9fafb;
  white-space: nowrap;
}
.prose td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  color: #4b5563;
}
.prose tbody tr:hover td {
  background: #fafafa;
}
@media (max-width: 640px) {
  .prose th,
  .prose td {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }
}

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

/* ============================================================
   PAGINATION (template Hugo interne)
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.375rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid #f3f4f6;
  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.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
}
.pagination a {
  color: #6b7280;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}
.pagination a:hover {
  background: #f3f4f6;
  color: #4f46e5;
  border-color: #c7d2fe;
}
.pagination .active {
  color: white;
  background: #4f46e5;
  border: 1px solid #4f46e5;
}
.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ============================================================
   SECTION PADDING UTILITAIRE (py-18)
   ============================================================ */
.py-18 {
  padding-top: 4.5rem;
  padding-bottom: 4.5rem;
}

/* ============================================================
   IMPRESSION
   ============================================================ */
@media print {
  header, footer, nav,
  .reading-progress-bar,
  #reading-progress {
    display: none !important;
  }
  .prose { max-width: 100%; }
  body { background: white; }
}
