/* ======================================================================
 * Casa Bonciani — main.css
 * Custom CSS additionnel par-dessus TailwindCSS (chargé en CDN dans head).
 * Palette : primary #ea580c · secondary #c2410c · accent #14b8a6 · ink #1f2937
 * Polices : Merriweather (headings) · Nunito (body)
 * Contraste : tous les textes ont été audités pour WCAG AA.
 * ====================================================================== */

/* ---------- 1. Base ---------- */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body {
  font-feature-settings: "kern", "liga", "calt";
}

/* Sélection : couleur de marque */
::selection { background: #ea580c; color: #ffffff; }

/* ---------- 2. Transitions globales ---------- */
a, button {
  transition: color .2s ease, background-color .2s ease,
              border-color .2s ease, transform .2s ease, opacity .2s ease;
}

/* ---------- 3. Focus accessible (WCAG) ---------- */
*:focus { outline: none; }
*:focus-visible {
  outline: 2px solid #ea580c;
  outline-offset: 3px;
  border-radius: 3px;
}

/* ---------- 4. Article (.prose) — typographie magazine ---------- */
.article-content {
  color: #1f2937;
  font-size: 1.0625rem;
  line-height: 1.75;
}
.article-content > p:first-of-type::first-letter {
  font-family: 'Merriweather', Georgia, serif;
  font-weight: 900;
  font-size: 4em;
  line-height: 0.85;
  float: left;
  padding: 0.25rem 0.75rem 0 0;
  color: #c2410c;
  font-style: italic;
}

.article-content h2 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 700;
  margin: 3rem 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
  color: #1f2937;
  line-height: 1.25;
}
.article-content h3 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2rem 0 .75rem;
  color: #1f2937;
  line-height: 1.3;
}

.article-content p { margin-bottom: 1.5rem; }
.article-content ul,
.article-content ol { margin: 1.25rem 0 1.75rem; padding-left: 1.5rem; }
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li { margin-bottom: .5rem; }
.article-content li::marker { color: #ea580c; }

.article-content a {
  color: #c2410c;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  font-weight: 600;
}
.article-content a:hover {
  color: #ea580c;
  text-decoration-thickness: 2px;
}

.article-content blockquote {
  border-left: 4px solid #ea580c;
  background: #fff7ed;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  border-radius: 0 .5rem .5rem 0;
  font-style: normal;
  color: #1f2937;
}
.article-content blockquote p:last-child { margin-bottom: 0; }

.article-content strong { color: #1f2937; font-weight: 700; }

.article-content img {
  border-radius: .5rem;
  margin: 1.5rem auto;
  display: block;
  max-width: 100%;
  height: auto;
  box-shadow: 0 8px 30px -12px rgba(31,41,55,.18);
}

/* Tables magazine */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: .95rem;
  background: #ffffff;
  border-radius: .5rem;
  overflow: hidden;
  box-shadow: 0 4px 24px -8px rgba(31,41,55,.10);
}
.article-content thead {
  background: #1f2937;
  color: #ffffff;
}
.article-content th {
  padding: .85rem 1rem;
  text-align: left;
  font-weight: 700;
  font-family: 'Merriweather', Georgia, serif;
  font-size: .9rem;
  letter-spacing: .02em;
}
.article-content td {
  padding: .85rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
}
.article-content tbody tr:hover { background: #fff7ed; }

/* Code inline + bloc */
.article-content code {
  font-family: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
  font-size: .9em;
  background: #fff7ed;
  color: #c2410c;
  padding: .15em .4em;
  border-radius: .25rem;
}
.article-content pre {
  background: #1f2937;
  color: #f9fafb;
  padding: 1rem 1.25rem;
  border-radius: .5rem;
  overflow-x: auto;
  font-size: .9rem;
  margin: 1.5rem 0;
}
.article-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* ---------- 5. Utilitaires line-clamp (fallback) ---------- */
.line-clamp-2,
.line-clamp-3,
.line-clamp-4 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-2 { -webkit-line-clamp: 2; }
.line-clamp-3 { -webkit-line-clamp: 3; }
.line-clamp-4 { -webkit-line-clamp: 4; }

/* ---------- 6. Pagination (Hugo internal template) ---------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
  flex-wrap: wrap;
}
.pagination li { list-style: none; }
.pagination a,
.pagination .active,
.pagination .disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 .85rem;
  border-radius: .375rem;
  font-size: .9rem;
  font-weight: 600;
  font-family: 'Nunito', system-ui, sans-serif;
}
.pagination a {
  color: #1f2937;
  background: #ffffff;
  border: 1px solid #e5e7eb;
}
.pagination a:hover {
  background: #fff7ed;
  border-color: #ea580c;
  color: #c2410c;
}
.pagination .active {
  color: #ffffff;
  background: #ea580c;
  border: 1px solid #ea580c;
}
.pagination .disabled {
  color: #9ca3af;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  pointer-events: none;
}

/* ---------- 7. Liens dans les blocs sombres ---------- */
.bg-ink a:focus-visible,
footer a:focus-visible {
  outline-color: #14b8a6;
}

/* ---------- 8. Mobile menu animation ---------- */
#mobile-menu:not(.hidden) {
  animation: cb-fade-in .15s ease-out both;
}
@keyframes cb-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* ---------- 9. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 10. Print ---------- */
@media print {
  header, footer, nav, .no-print { display: none !important; }
  body { background: #ffffff; color: #000000; }
  .article-content { max-width: 100%; font-size: 11pt; }
  .article-content a { color: #000000; text-decoration: underline; }
  .article-content a::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #444444;
  }
}
