/* Optimisations CSS pour le SEO et les performances */

/* Amélioration de l'accessibilité - Focus visible */
a:focus, button:focus, input:focus, textarea:focus {
  outline: 2px solid #2193b0;
  outline-offset: 2px;
}

/* Skip to content pour l'accessibilité */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: #2193b0;
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-to-content:focus {
  top: 0;
}

/* Optimisation du chargement des images */
img {
  height: auto;
  max-width: 100%;
}

img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* Performance - Will-change pour les animations */
.project__card,
.qualification__data,
.header__container img {
  will-change: transform, opacity;
}

/* Indicateur de chargement pour meilleure UX */
.loading-spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #2193b0;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive images avec aspect-ratio */
.project__card img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.header__container img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* Print styles pour meilleure compatibilité */
@media print {
  nav, footer, .header__btns {
    display: none;
  }
  
  body {
    background: white;
    color: black;
  }
  
  a {
    text-decoration: underline;
    color: black;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --text-color: #f5f5f5;
  }
}

/* Reduced motion pour l'accessibilité */
@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;
  }
}

/* Blog styles */
.blog-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.blog-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.blog-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.blog-card-content {
  padding: 1.5rem;
}

.blog-card h3 {
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

.blog-card .blog-meta {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.blog-card p {
  color: #444;
  line-height: 1.6;
}

.blog-card a {
  color: #2193b0;
  text-decoration: none;
  font-weight: 600;
}

.blog-card a:hover {
  text-decoration: underline;
}
