/*
 * Aimée Naturopathe — Custom styles
 * Complements TailwindCSS (loaded via CDN in head.html).
 * WCAG AA compliance is the baseline; Merriweather/Nunito typography.
 */

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

body {
  font-feature-settings: "kern", "liga", "clig", "calt";
}

/* Softer link transition baseline */
a, button {
  transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Selection uses brand accent with readable contrast */
::selection {
  background-color: #0e7490;
  color: #ffffff;
}

/* -------------------------------------------------------------
   Prose content — article body
   Readable line width, comfortable rhythm, brand accent links
   ------------------------------------------------------------- */
.prose {
  max-width: 68ch;
}
.prose h2 {
  font-size: 1.75rem;
  line-height: 1.25;
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  font-weight: 700;
  color: #0e172a;
}
.prose h3 {
  font-size: 1.375rem;
  line-height: 1.3;
  margin-top: 2.25rem;
  margin-bottom: 0.875rem;
  font-weight: 600;
  color: #1c1917;
}
.prose h4 {
  font-size: 1.125rem;
  line-height: 1.4;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #1c1917;
}
.prose p {
  margin-bottom: 1.25rem;
  line-height: 1.75;
  color: #374151;
}
.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: #374151;
}
.prose li::marker {
  color: #0891b2;
}
.prose blockquote {
  border-left: 4px solid #0891b2;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #57534e;
  background: #f5f5f4;
  border-radius: 0 0.75rem 0.75rem 0;
  quotes: "\201C" "\201D" "\2018" "\2019";
}
.prose blockquote p:last-of-type {
  margin-bottom: 0;
}
.prose a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  font-weight: 500;
  color: #0e7490; /* Meets AA on white: ~6.2:1 */
}
.prose a:hover {
  color: #0891b2;
  text-decoration-thickness: 2px;
}
.prose strong {
  font-weight: 700;
  color: #1c1917;
}
.prose em {
  font-style: italic;
}
.prose code {
  background: #f5f5f4;
  color: #0e7490;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.9em;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
.prose pre {
  background: #1c1917;
  color: #f5f5f4;
  padding: 1.25rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}
.prose pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}
.prose img {
  border-radius: 0.75rem;
  margin: 2rem 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.prose hr {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #d6d3d1, transparent);
  margin: 3rem 0;
}

/* -------------------------------------------------------------
   Tables inside prose
   ------------------------------------------------------------- */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9375rem;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 0 0 1px #e7e5e4;
}
.prose thead {
  background: #f5f5f4;
}
.prose th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #0c0a09;
  border-bottom: 2px solid #d6d3d1;
}
.prose td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #e7e5e4;
  color: #374151;
}
.prose tbody tr:last-child td {
  border-bottom: none;
}
.prose tbody tr:hover {
  background: #fafaf9;
}
@media (max-width: 640px) {
  .prose table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  .prose th, .prose td {
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
  }
}

/* -------------------------------------------------------------
   Utility: line clamp (kept for Tailwind CDN builds missing it)
   ------------------------------------------------------------- */
.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;
}

/* -------------------------------------------------------------
   Accessibility — visible focus for keyboard users (WCAG 2.4.7)
   ------------------------------------------------------------- */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #0e7490;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip-reader friendly */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* -------------------------------------------------------------
   Pagination (Hugo internal template)
   ------------------------------------------------------------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e7e5e4;
}
.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.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: "Nunito", system-ui, sans-serif;
  transition: all 0.2s;
}
.pagination a {
  color: #44403c;
  background: #f5f5f4;
  border: 1px solid #e7e5e4;
}
.pagination a:hover {
  background: #e7e5e4;
  color: #0e7490;
  border-color: #d6d3d1;
}
.pagination .active {
  color: #ffffff;
  background: #0891b2;
  border: 1px solid #0891b2;
}
.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* -------------------------------------------------------------
   Print styles — readable offline copies
   ------------------------------------------------------------- */
@media print {
  header, footer, nav, .no-print { display: none !important; }
  body { background: #ffffff; color: #000000; }
  .prose { max-width: 100%; color: #000000; }
  .prose a { color: #000000; text-decoration: underline; }
  .prose a::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #444; }
}

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