/* ========================================
   PERFORMANCE & ACCESSIBILITY CSS
   ======================================== */

/* === Screen Reader Only (Accessibility) === */
.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;
}

/* === Main landmark without layout change === */
main {
  display: contents;
}

/* === Contrast Fix for "Yellow Miracle" === */
/* Original: #f5a509 (3.3:1 ratio - FAIL)
   Fixed: #c77f00 (4.65:1 ratio - PASS AA) */
.yellow-miracle-contrast {
  color: #c77f00 !important;
}

/* === Touch Target Enhancement for Footer Links === */
.footer-link-enhanced {
  position: relative;
  display: inline-block;
}

.footer-link-enhanced::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  /* Minimum 44x44px touch target */
}

/* Ensure footer links have adequate touch targets */
.atomicat-container-f248746 a {
  display: inline-block;
  min-height: 44px;
  min-width: 44px;
  padding: 12px 8px;
  line-height: 20px;
}

/* === Video Lazy Load Poster === */
.vsl-lazy-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  aspect-ratio: 16/9;
  background: #000;
  cursor: pointer;
  overflow: hidden;
  border-radius: 8px;
}

.vsl-lazy-poster {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.vsl-lazy-wrapper.loaded .vsl-lazy-poster {
  opacity: 0;
  pointer-events: none;
}

.vsl-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: rgba(239, 75, 35, 0.9);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, transform 0.2s ease;
  z-index: 2;
}

.vsl-play-button:hover {
  background: rgba(239, 75, 35, 1);
  transform: translate(-50%, -50%) scale(1.1);
}

.vsl-play-button:focus {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.vsl-play-button::after {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 15px 0 15px 25px;
  border-color: transparent transparent transparent #fff;
  margin-left: 5px;
}

.vsl-lazy-wrapper.loaded .vsl-play-button {
  display: none;
}

/* Spinner while loading */
.vsl-spinner {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ef4b23;
  border-radius: 50%;
  animation: vsl-spin 1s linear infinite;
  z-index: 2;
}

.vsl-lazy-wrapper.loading .vsl-spinner {
  display: block;
}

.vsl-lazy-wrapper.loading .vsl-play-button {
  display: none;
}

@keyframes vsl-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* === Critical Above-the-Fold Styles === */
/* These ensure content renders quickly without FOIT/FOUT */

/* Font display swap already set in Google Fonts URL */

/* === Reduce CLS with explicit dimensions === */
img {
  max-width: 100%;
  height: auto;
}

/* === Optimize animations for performance === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* === Focus visible for keyboard navigation === */
a:focus-visible,
button:focus-visible {
  outline: 3px solid #ef4b23;
  outline-offset: 2px;
}

/* === Skip to content link (Accessibility) === */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: #ef4b23;
  color: #fff;
  padding: 8px 16px;
  z-index: 100000;
  text-decoration: none;
  font-weight: 700;
  transition: top 0.3s ease;
}

.skip-to-content:focus {
  top: 0;
}

/* === High contrast mode support === */
@media (forced-colors: active) {
  .vsl-play-button {
    border: 2px solid currentColor;
  }
}

/* === VSL Page Lock System === */
.page-locked {
  display: none !important;
  opacity: 0;
  visibility: hidden;
}

.page-unlocked {
  display: block !important;
  opacity: 1;
  visibility: visible;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Estilo quando página está travada - centraliza o vídeo */
body:not(.content-unlocked) {
  background: #000;
}

body:not(.content-unlocked) #main-content {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body.content-unlocked {
  background: initial;
}

body.content-unlocked #main-content {
  min-height: auto;
  display: contents;
}
