/*
 * Myrtillethe — Styles personnalisés
 * Complète TailwindCSS CDN. Pas de déclarations redondantes.
 */

/* ================================================================
   BASE
   ================================================================ */

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

/* Transitions globales sur les éléments interactifs */
a,
button {
  transition: color 0.15s ease, background-color 0.15s ease, opacity 0.15s ease;
}

/* Focus visible accessible (WCAG AA) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #059669;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ================================================================
   TYPOGRAPHIE PROSE — Corps des articles
   Appliquée via classe .article-content
   ================================================================ */

.article-content {
  max-width: 68ch;
  color: #1f2937;
  line-height: 1.8;
}

/* Titres */
.article-content h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  color: #111827;
  margin-top: 2.75rem;
  margin-bottom: 1rem;
}

.article-content h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  color: #1f2937;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article-content h4 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.0625rem;
  font-weight: 600;
  color: #374151;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

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

/* Listes */
.article-content ul,
.article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  color: #374151;
}

.article-content ul {
  list-style-type: disc;
}

.article-content ol {
  list-style-type: decimal;
}

.article-content li {
  margin-bottom: 0.45rem;
  line-height: 1.75;
}

/* Liens dans le contenu */
.article-content a {
  color: #047857;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #059669;
  font-weight: 500;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.article-content a:hover {
  color: #065f46;
  text-decoration-thickness: 2px;
}

/* Gras */
.article-content strong {
  font-weight: 700;
  color: #111827;
}

/* Italique */
.article-content em {
  font-style: italic;
  color: #374151;
}

/* Blockquote */
.article-content blockquote {
  border-left: 3px solid #059669;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #4b5563;
  background: #f0fdf4;
  border-radius: 0 0.5rem 0.5rem 0;
}

.article-content blockquote p {
  margin-bottom: 0;
  color: inherit;
}

/* Images dans le contenu */
.article-content img {
  border-radius: 0.625rem;
  margin: 1.75rem 0;
  max-width: 100%;
  height: auto;
}

/* Code inline */
.article-content code {
  background: #f3f4f6;
  color: #374151;
  font-size: 0.875em;
  padding: 0.15em 0.4em;
  border-radius: 0.25rem;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", monospace;
}

/* Blocs de code */
.article-content pre {
  background: #1f2937;
  color: #f9fafb;
  padding: 1.25rem;
  border-radius: 0.625rem;
  overflow-x: auto;
  margin: 1.75rem 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

.article-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

/* Tableaux */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9375rem;
  display: block;
  overflow-x: auto;
}

.article-content thead {
  background: #f0fdf4;
  border-bottom: 2px solid #d1fae5;
}

.article-content th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #065f46;
  white-space: nowrap;
  font-family: system-ui, sans-serif;
}

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

.article-content tbody tr:hover {
  background: #fafafa;
}

@media (max-width: 640px) {
  .article-content th,
  .article-content td {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }
}

/* Séparateur horizontal */
.article-content hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 2.5rem 0;
}

/* ================================================================
   UTILITAIRES
   ================================================================ */

/* Tronquage multi-lignes */
.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: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid #f3f4f6;
  list-style: none;
  padding-left: 0;
}

.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 ease;
}

.pagination a {
  color: #374151;
  background: #f3f4f6;
}

.pagination a:hover {
  background: #e5e7eb;
  color: #111827;
}

.pagination .active {
  color: #ffffff;
  background: #059669;
}

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

/* ================================================================
   IMPRESSION
   ================================================================ */

@media print {
  header,
  footer,
  nav,
  [aria-label="Articles connexes"] {
    display: none !important;
  }

  .article-content {
    max-width: 100%;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #6b7280;
  }
}
