/**
 * StrassBlog - Custom CSS
 * Styles additionnels pour complémenter TailwindCSS
 */

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

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Selection color */
::selection {
  background-color: rgba(180, 83, 9, 0.2);
  color: #1f2937;
}

/* Focus states pour accessibilité */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #b45309;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================
   TYPOGRAPHY - PROSE
   ============================================ */

.prose {
  max-width: 65ch;
}

.prose h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.prose h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

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

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

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

.prose blockquote {
  border-left: 4px solid #b45309;
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #4b5563;
  background-color: #fef3c7;
  padding: 1rem 1.5rem;
  border-radius: 0 0.5rem 0.5rem 0;
}

.prose a {
  color: #b45309;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.prose a:hover {
  border-bottom-color: #b45309;
}

.prose img {
  border-radius: 0.75rem;
  margin: 2rem 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.prose 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.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.prose pre code {
  background-color: transparent;
  padding: 0;
}

/* ============================================
   UTILITIES
   ============================================ */

/* Line clamp */
.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;
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

/* Animation fade in */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

/* Animation slide up */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-up {
  animation: slideUp 0.6s ease-out forwards;
}

/* ============================================
   COMPONENTS
   ============================================ */

/* Article cards hover effect */
.article-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
  transform: translateY(-4px);
}

/* Category badge */
.category-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
  .prose h2 {
    font-size: 1.5rem;
  }

  .prose h3 {
    font-size: 1.25rem;
  }

  .prose blockquote {
    padding: 0.75rem 1rem;
    margin: 1.5rem 0;
  }
}

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

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

  .prose {
    max-width: 100%;
  }

  a {
    color: inherit;
    text-decoration: underline;
  }

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

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background-color: #b45309;
  color: white;
  padding: 0.5rem 1rem;
  z-index: 100;
  transition: top 0.2s ease;
}

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

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