/**
 * Mercerie à Tout Fil - Custom CSS
 * Complément à TailwindCSS (chargé via CDN)
 * Anti-footprint: styles uniques et spécifiques
 */

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

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

/* Selection styling */
::selection {
  background-color: rgba(8, 145, 178, 0.2);
  color: inherit;
}

/* ========================================
   PROSE (Contenu Markdown)
======================================== */

.prose {
  max-width: 65ch;
}

.prose h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  scroll-margin-top: 5rem;
}

.prose h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  scroll-margin-top: 5rem;
}

.prose p {
  margin-bottom: 1.25rem;
}

.prose ul,
.prose ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.prose li {
  margin-bottom: 0.5rem;
}

.prose blockquote {
  border-left-width: 4px;
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 0.5rem 0.5rem 0;
}

.prose code:not(pre code) {
  background-color: #f3f4f6;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
}

.prose pre {
  background-color: #1f2937;
  border-radius: 0.75rem;
  padding: 1.25rem;
  overflow-x: auto;
}

.prose img {
  border-radius: 0.75rem;
  margin: 2rem auto;
}

/* ========================================
   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;
}

/* ========================================
   FOCUS STATES (Accessibilité)
======================================== */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #0891b2;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #0891b2;
  color: white;
  padding: 8px 16px;
  z-index: 100;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}

/* ========================================
   TRANSITIONS
======================================== */

a,
button {
  transition-property: color, background-color, border-color, transform, box-shadow;
  transition-duration: 200ms;
  transition-timing-function: ease;
}

/* ========================================
   SCROLLBAR STYLING (optionnel, subtil)
======================================== */

@supports (scrollbar-width: thin) {
  html {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
  }
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: #d1d5db;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #9ca3af;
}

/* ========================================
   PRINT STYLES
======================================== */

@media print {
  header,
  footer,
  nav,
  .no-print {
    display: none !important;
  }

  .prose {
    max-width: 100%;
  }

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

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  h1, h2, h3 {
    page-break-after: avoid;
  }

  img {
    max-width: 100% !important;
  }
}

/* ========================================
   REDUCED MOTION (Accessibilité)
======================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
