/*
 * Ostéopathes 95 — Custom CSS
 * TailwindCSS chargé via CDN dans head.html
 * Ce fichier : styles custom non couverts par Tailwind utilitaire
 */

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

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

*, *::before, *::after {
  box-sizing: border-box;
}

/* ── Navigation — onglets avec soulignement animé ─────────────── */

.nav-tab {
  position: relative;
}
.nav-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0.75rem;
  right: 0.75rem;
  height: 2px;
  background-color: currentColor;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
  border-radius: 1px;
}
.nav-tab:hover::after,
.nav-tab--active::after {
  transform: scaleX(1);
}
.nav-tab--active {
  color: var(--color-primary, #047857);
}

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

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

/* ── Article prose (contenu markdown) ────────────────────────── */

.article-prose {
  max-width: 68ch;
  color: #1f2937; /* gray-800 — contraste ≥ 12:1 sur blanc ✓ */
  line-height: 1.75;
  font-size: 1rem;
}

.article-prose h2 {
  font-family: Merriweather, Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.35;
}

.article-prose h3 {
  font-family: Merriweather, Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #111827;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

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

.article-prose ul,
.article-prose ol {
  margin-bottom: 1.5rem;
  padding-left: 1.75rem;
}
.article-prose ul { list-style-type: disc; }
.article-prose ol { list-style-type: decimal; }
.article-prose li {
  margin-bottom: 0.5rem;
  color: #374151;
}

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

.article-prose a {
  color: #047857; /* primary — contraste ≥ 4.6:1 sur blanc ✓ */
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}
.article-prose a:hover {
  color: #065f46;
}

.article-prose blockquote {
  border-left: 4px solid #047857;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #4b5563;
  background-color: #f0fdf4; /* green-50 */
  border-radius: 0 0.75rem 0.75rem 0;
}

.article-prose blockquote strong {
  color: #065f46;
}

.article-prose img {
  border-radius: 0.75rem;
  margin: 1.5rem 0;
  max-width: 100%;
  height: auto;
}

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

/* ── Line clamp utilitaires ───────────────────────────────────── */

.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é) ────────────────────────────── */

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

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

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.375rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #f3f4f6;
}
.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.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
}
.pagination a {
  color: #374151;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}
.pagination a:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}
.pagination .active {
  color: white;
  background: #047857; /* primary — contraste blanc/vert-700 ≥ 4.6:1 ✓ */
  border-color: #047857;
}
.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ── Carte article / catégorie (hover elevation) ───────────────── */

.card-article,
.card-category {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-article:hover,
.card-category:hover {
  transform: translateY(-2px);
}

/* ── Image couverture article ─────────────────────────────────── */

.article-cover-img {
  width: 100%;
  border-radius: 0.75rem;
  margin-bottom: 2rem;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* ── Impression ───────────────────────────────────────────────── */

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