.video-section {
  outline: none !important;
  display: block;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.video-container {
  outline: none !important;
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
}

/* Dynamic aspect ratio classes applied by JS */
.video-container.aspect-ratio-16-9 {
  aspect-ratio: 16/9;
}

.video-container.aspect-ratio-9-16 {
  aspect-ratio: 9/16;
}

.video-container.aspect-ratio-4-3 {
  aspect-ratio: 4/3;
}

.video-container.aspect-ratio-1-1 {
  aspect-ratio: 1/1;
}

.video-container.aspect-ratio-21-9 {
  aspect-ratio: 21/9;
}

/* Fallback for browsers without aspect-ratio support */
@supports not (aspect-ratio: 16/9) {
  .video-container.aspect-ratio-16-9 {
    padding-bottom: 56.25%; /* 9/16 = 0.5625 */
  }
  
  .video-container.aspect-ratio-9-16 {
    padding-bottom: 177.78%; /* 16/9 = 1.7778 */
  }
  
  .video-container.aspect-ratio-4-3 {
    padding-bottom: 75%; /* 3/4 = 0.75 */
  }
  
  .video-container.aspect-ratio-1-1 {
    padding-bottom: 100%;
  }
  
  .video-container.aspect-ratio-21-9 {
    padding-bottom: 42.86%; /* 9/21 ≈ 0.4286 */
  }
  
  .video-section .video-section__video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
}

.video-section__video {
  outline: none !important;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background-color: #000;
}

.video-section__video[poster] {
  background-size: cover;
  background-position: center;
}

.video-section__mute-toggle {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: background 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
}

.video-section__mute-toggle:hover {
  background: rgba(0, 0, 0, 0.8);
}

.video-section__mute-toggle:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.video-section__overlay-link {  
  outline: none !important;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  text-indent: -9999px;
  overflow: hidden;
  cursor: pointer;
}

.video-section__overlay-link:focus {
  outline: 3px solid #0073aa;
  outline-offset: -3px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .video-section__video {
    animation: none !important;
    transition: none !important;
  }
}

.video-section--paused .video-section__video {
  filter: brightness(0.7);
}

.video-section__play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  border: 3px solid #fff;
  border-radius: 50%;
  width: 80px;
  height: 80px;
  font-size: 32px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.video-section__play-button:hover {
  transform: translate(-50%, -50%) scale(1.1);
  background: rgba(0, 0, 0, 0.9);
}

.video-section__play-button:focus {
  outline: 3px solid #0073aa;
  outline-offset: 3px;
}

/* Error state */
.video-section--error .video-section__video {
  opacity: 0.3;
}

.video-section__error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  background: rgba(220, 53, 69, 0.9);
  color: #fff;
  padding: 15px 25px;
  border-radius: 4px;
  font-size: 16px;
  text-align: center;
  max-width: 90%;
}

/* Loading state */
.video-section:not(.video-section--ready) .video-container::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: video-loading-spinner 1s linear infinite;
  z-index: 2;
}

@keyframes video-loading-spinner {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Screen reader text */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: #f1f1f1;
  border-radius: 3px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
  clip: auto !important;
  clip-path: none;
  color: #21759b;
  display: block;
  font-size: 14px;
  font-weight: bold;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* Mobile optimizations */
@media (max-width: 767px) {
  .video-section__mute-toggle {
    width: 36px;
    height: 36px;
    font-size: 18px;
    bottom: 12px;
    left: 12px;
  }
  
  .video-section__play-button {
    width: 60px;
    height: 60px;
    font-size: 24px;
  }
}
