/* Phase 2: Accessibility & Performance Improvements */

/* Skip to Content Link */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000;
  color: #fff;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 10000;
  border-radius: 0 0 4px 0;
  font-weight: 600;
  transition: top 0.2s ease;
}

.skip-to-content:focus {
  top: 0;
  outline: 3px solid #4CAF50;
  outline-offset: 2px;
}

/* Image Lazy Load - Fade In Effect */
img[data-src] {
  opacity: 0;
  transition: opacity 0.3s ease-in;
}

img.loaded,
img:not([data-src]) {
  opacity: 1;
}

/* Ad Loading State */
.ad-container[data-lazy="true"]:not(.ad-loaded)::before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Focus Visible for Keyboard Navigation */
*:focus-visible {
  outline: 3px solid #4CAF50;
  outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .skip-to-content {
    border: 2px solid #fff;
  }
  
  *:focus-visible {
    outline-width: 4px;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  img[data-src],
  .ad-container::before {
    transition: none !important;
    animation: none !important;
  }
}
