/* niwe-video.css - accessible video player (scoped; does not touch existing .video-wrapper rules) */

/* 1. Fix cut-off video and hidden heading (video column only) */
.niw-video-col .gallery-slider,
.niw-video-col .carousel-wrap,
.niw-video-col .item,
.niw-video-col .gly-card,
.niw-video-col .video-wrapper {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.niw-video-col .gly-card h2 {
  display: block;
  margin: 0 0 10px;
}

/* 2. Player container and video */
.niw-player {
  position: relative;
  background: #000;
  /* no overflow:hidden here, it would clip the focus ring */
}

.niw-player video {
  display: block;
  width: 100%;
  height: auto !important;       /* override any fixed height */
  aspect-ratio: 16 / 9;
  object-fit: contain;           /* never crop the frame */
  background: #000;
  cursor: pointer;
}

/* Captions: keep them readable */
.niw-player video::cue {
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 16px;
}

/* 3. Control bar */
.niw-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;            /* keeps focus rings away from the edges */
  background: #000;
  color: #fff;
}

.niw-btn {
  background: transparent;
  color: #fff;
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
}

.niw-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.niw-seek {
  flex: 1;
  min-width: 0;
  accent-color: #ffbf00;
}

.niw-time {
  font-size: 14px;
  white-space: nowrap;
}

/* 4. STQC FIX: clearly visible keyboard focus (yellow ring + black halo) */
.niw-btn:focus-visible,
.niw-seek:focus-visible {
  outline: 3px solid #ffbf00;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px #000;
}

/* 5. Fullscreen */
.niw-player:fullscreen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #000;
}

.niw-player:fullscreen video {
  max-height: calc(100vh - 70px);
}
/* Let the player and its controls take their natural height */
.niw-video-col .video-wrapper {
  position: static !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 0 !important;
  overflow: visible !important;
  display: block !important;
}

.niw-video-col .niw-player {
  position: relative;
  height: auto !important;
  overflow: visible !important;
}

.niw-video-col .niw-player video {
  position: static !important;
  top: auto;
  left: auto;
  width: 100% !important;
  height: auto !important;
}

.niw-video-col .niw-controls {
  position: static !important;
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

/* The card must grow with its content */
.niw-video-col .card,
.niw-video-col .gly-card {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}


/* Photo gallery: match the video card's size */
.niw-photo-col .card,
.niw-photo-col .gly-card {
  height: auto !important;
  max-height: none !important;
}

.niw-photo-col .index-gallery .item img {
  display: block;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 6 / 5;           /* about the same shape as the video card */
  object-fit: cover;             /* fills the frame, no stretching */
  object-position: center top;   /* keeps faces from being cropped */
}

@media (min-width: 992px) {
  .niw-photo-col .index-gallery .item img {
    aspect-ratio: auto;
    height: 295px !important;    /* set to your video card's height */
  }
}


@media (max-width: 575px) {
  .niw-controls {
    flex-wrap: wrap;
    gap: 4px 6px;
    padding: 8px;
  }

  .niw-seek {
    order: -1;            /* seek bar goes on top */
    flex: 1 1 100%;       /* full width row */
    width: 100%;
    margin: 4px 0 2px;
  }

  .niw-btn {
    width: 36px;
    height: 36px;
  }

  .niw-time {
    font-size: 12px;
  }
}