/*
 * Vétérinaire Paris 13 — Styles personnalisés
 * TailwindCSS chargé via CDN dans head.html (avec plugin typography)
 * Ce fichier complète les utilitaires Tailwind avec des styles spécifiques.
 */

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

body {
  /* Léger anti-aliasing supplémentaire pour Merriweather/Nunito */
  font-feature-settings: "kern" 1, "liga" 1;
}

/* ── Transitions globales ────────────────────────────────────────── */
a,
button {
  transition: color 0.15s ease, background-color 0.15s ease,
              border-color 0.15s ease, box-shadow 0.15s ease;
}

/* ── Navigation active ───────────────────────────────────────────── */
/* Soulignement état actif du menu (renforcement du style inline Hugo) */
.nav-item {
  position: relative;
}
.nav-item--active {
  color: var(--tw-color-secondary, #047857);
}

/* ── Hero ──────────────────────────────────────────────────────── */
/* S'assure que le contenu hero reste lisible quelle que soit la bg */
#site-header {
  /* Ombre dynamique ajoutée via JS au scroll */
}

/* ── Prose article ───────────────────────────────────────────────── */
.prose-article {
  max-width: 68ch;
  line-height: 1.8;
}
.prose-article h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: #111827;
}
.prose-article h3 {
  font-size: 1.2rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: #1f2937;
}
.prose-article p {
  margin-bottom: 1.5rem;
  line-height: 1.8;
  color: #374151;
}
.prose-article ul,
.prose-article ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}
.prose-article ul {
  list-style-type: disc;
}
.prose-article ol {
  list-style-type: decimal;
}
.prose-article li {
  margin-bottom: 0.5rem;
  color: #374151;
  line-height: 1.7;
}

/* Blockquote — fond vert très clair, bordure gauche secondaire */
.prose-article blockquote {
  border-left: 4px solid #059669;
  background-color: #f0fdf4;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  border-radius: 0 0.75rem 0.75rem 0;
  color: #374151;
  font-style: normal;
}
.prose-article blockquote p:last-child {
  margin-bottom: 0;
}

.prose-article strong {
  font-weight: 700;
  color: #111827;
}
.prose-article a {
  color: #047857;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  font-weight: 500;
}
.prose-article a:hover {
  color: #059669;
  text-decoration-thickness: 2px;
}
.prose-article img {
  border-radius: 0.75rem;
  margin: 1.75rem 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ── Tables ──────────────────────────────────────────────────────── */
.prose-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9rem;
  overflow-x: auto;
  display: block;
  border-radius: 0.5rem;
  /* Overflow scroll sur petits écrans */
}
.prose-article thead {
  background-color: #f0fdf4;
  border-bottom: 2px solid #d1fae5;
}
.prose-article th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #064e3b;
  white-space: nowrap;
}
.prose-article td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
}
.prose-article tbody tr:hover {
  background-color: #f9fafb;
}
@media (max-width: 640px) {
  .prose-article th,
  .prose-article td {
    padding: 0.6rem 0.75rem;
    font-size: 0.8125rem;
  }
}

/* ── Utilitaires 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 visible (accessibilité WCAG AA) ───────────────────────── */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #047857;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Pagination Hugo ─────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  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.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.15s ease;
}
.pagination a {
  color: #4b5563;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
}
.pagination a:hover {
  background-color: #f0fdf4;
  color: #047857;
  border-color: #a7f3d0;
}
.pagination .active {
  color: white;
  background-color: #047857;
  border: 1px solid #047857;
  font-weight: 600;
}
.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ── Cartes hover ────────────────────────────────────────────────── */
/* Amélioration subtile du transform sur hover des cartes article */
@media (hover: hover) {
  article.group:hover,
  a.group:hover {
    transform: translateY(-1px);
  }
}

/* ── Header scroll shadow ────────────────────────────────────────── */
/* Renforcé via JS dans scripts.html mais déclaré ici pour cohérence */
#site-header.scrolled {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* ── Impression ──────────────────────────────────────────────────── */
@media print {
  header,
  footer,
  nav,
  #reading-progress,
  .pagination {
    display: none !important;
  }
  .prose-article {
    max-width: 100%;
  }
  body {
    font-size: 12pt;
    line-height: 1.6;
  }
}
