/*
 * ma-fraise.fr — Styles éditoriaux additionnels
 * Tailwind CDN gère la majorité des utilitaires (cf. head.html).
 * Ce fichier complète : typographie de prose, accessibilité, navigation.
 */

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

/* ---------- Skip link (a11y) ---------- */
.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: #111827;
  color: #ffffff;
  font-weight: 600;
  border-radius: 0.25rem;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0.5rem;
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

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

/* ---------- Focus visible accessible (contraste 3:1 mini) ---------- */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 3px;
  border-radius: 3px;
}
.bg-gray-900 a:focus-visible, .bg-gray-900 button:focus-visible {
  outline-color: #67e8f9;
}

/* ---------- Editorial typography for prose (single article) ---------- */
.prose { max-width: 68ch; }
.prose h2 {
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  font-size: 1.625rem;
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.25;
  color: #111827;
  position: relative;
  padding-left: 1rem;
  border-left: 3px solid #dc2626;
}
.prose h3 {
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: #1f2937;
}
.prose p {
  margin-bottom: 1.5rem;
  line-height: 1.75;
  color: #1f2937;
}
.prose > p:first-of-type::first-letter {
  font-family: 'Lora', Georgia, serif;
  font-size: 3.25rem;
  font-weight: 700;
  float: left;
  line-height: 1;
  margin: 0.25rem 0.5rem 0 0;
  color: #dc2626;
}
.prose ul, .prose ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}
.prose ul { list-style-type: disc; }
.prose ol { list-style-type: decimal; }
.prose li {
  margin-bottom: 0.5rem;
  color: #1f2937;
  line-height: 1.65;
}
.prose blockquote {
  border-left: 4px solid #dc2626;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #1f2937;
  background: #fafaf9;
  border-radius: 0 0.375rem 0.375rem 0;
  font-family: 'Lora', Georgia, serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}
.prose blockquote strong {
  color: #b91c1c;
  font-style: normal;
}
.prose a {
  color: #b91c1c;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  font-weight: 500;
}
.prose a:hover {
  text-decoration-thickness: 2px;
  color: #7f1d1d;
}
.prose strong {
  color: #111827;
  font-weight: 600;
}
.prose img {
  border-radius: 0.5rem;
  margin: 1.75rem 0;
}

/* ---------- Tables (used in articles) ---------- */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9375rem;
  display: block;
  overflow-x: auto;
  font-family: 'Inter', system-ui, sans-serif;
}
.prose thead {
  border-bottom: 2px solid #b91c1c;
}
.prose th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #111827;
  background: #f5f5f4;
  white-space: nowrap;
}
.prose td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e7e5e4;
  color: #1f2937;
  vertical-align: top;
}
.prose tbody tr:hover {
  background: #fafaf9;
}
@media (max-width: 640px) {
  .prose th, .prose td {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }
}

/* ---------- Line clamp utilities ---------- */
.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 (Hugo internal template) ---------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
  flex-wrap: wrap;
}
.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.875rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'Inter', system-ui, sans-serif;
  transition: all 0.2s;
}
.pagination a {
  color: #1f2937;
  background: #f5f5f4;
  border: 1px solid #e7e5e4;
}
.pagination a:hover {
  background: #e7e5e4;
  border-color: #d6d3d1;
}
.pagination .active {
  color: #ffffff;
  background: #dc2626;
  border: 1px solid #dc2626;
}
.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ---------- Editorial helpers ---------- */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #b91c1c;
}
.kicker::before {
  content: "";
  display: inline-block;
  width: 1.75rem;
  height: 2px;
  background: currentColor;
}
.kicker--light {
  color: #67e8f9;
}
.kicker--center::before {
  display: none;
}

.rule-x {
  display: block;
  width: 3rem;
  height: 3px;
  background: #dc2626;
  margin: 0 0 1.5rem;
  border: 0;
}
.rule-x--center { margin-left: auto; margin-right: auto; }

/* ---------- Print ---------- */
@media print {
  header, footer, nav, .no-print { display: none !important; }
  .prose { max-width: 100%; color: #000; }
  a { text-decoration: underline; }
}
