/*
 * Titirama.fr — Styles custom
 * Palette #8 : Indigo/Vert (#4f46e5 / #4338ca / #22c55e)
 * Fonts #4 : Poppins / Source Sans Pro
 * TailwindCSS chargé via CDN Play dans head.html
 */

/* ─── Base ─────────────────────────────────────────────── */

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

/* ─── Transitions ──────────────────────────────────────── */

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

/* ─── Prose — Contenu Markdown (articles) ──────────────── */

.prose {
  max-width: 68ch;
  font-size: 1rem;
  line-height: 1.8;
  color: #374151; /* gray-700 — 4.77:1 sur blanc ✓ WCAG AA */
}

.prose h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.375rem;
  font-weight: 700;
  color: #111827; /* gray-900 */
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.prose h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937; /* gray-800 */
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.prose h4 {
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.prose p {
  margin-bottom: 1.25rem;
}

.prose a {
  color: #4f46e5; /* primary — 5.55:1 sur blanc ✓ WCAG AA */
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  font-weight: 500;
}

.prose a:hover {
  text-decoration-thickness: 2px;
  color: #4338ca; /* secondary */
}

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

/* Listes */
.prose ul, .prose ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.prose ul { list-style-type: disc; }
.prose ol { list-style-type: decimal; }

.prose li {
  margin-bottom: 0.375rem;
  color: #374151;
}

.prose li::marker {
  color: #9ca3af;
}

/* Citations */
.prose blockquote {
  border-left: 3px solid #4f46e5;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  background: #f9fafb;
  border-radius: 0 0.375rem 0.375rem 0;
  font-style: normal;
  color: #4b5563; /* gray-600 — 7.09:1 sur gray-50 ✓ */
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

/* Tableaux */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.875rem;
}

.prose thead {
  border-bottom: 2px solid #e5e7eb;
}

.prose th {
  text-align: left;
  font-weight: 600;
  padding: 0.625rem 0.75rem;
  color: #111827;
  font-size: 0.8125rem;
}

.prose td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
  vertical-align: top;
}

.prose tbody tr:last-child td {
  border-bottom: none;
}

.prose tbody tr:hover {
  background: #f9fafb;
}

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

/* Code inline */
.prose code {
  font-size: 0.875em;
  background: #f3f4f6;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  color: #1f2937;
}

/* Séparateurs */
.prose hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 2rem 0;
}

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

/* ─── Focus — Accessibilité ────────────────────────────── */

a:focus-visible,
button:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
  border-radius: 3px;
}

/* ─── Pagination ───────────────────────────────────────── */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.375rem;
  margin-top: 2.5rem;
  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.25rem;
  height: 2.25rem;
  padding: 0 0.625rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.pagination a {
  color: #374151;
  border: 1px solid #e5e7eb;
  background: white;
}

.pagination a:hover {
  border-color: #d1d5db;
  background: #f9fafb;
}

.pagination .active {
  color: white;
  background: #4f46e5;
  border: 1px solid #4f46e5;
}

.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ─── Print ────────────────────────────────────────────── */

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