/* =============================
   VIDEOS CAROUSEL BASE STYLES
   ============================= */

.videos-carousel {
    padding-left: 0;
    padding-right: 0;
}

.wp-block-videos-carousel .swiper {
  overflow: visible;
}

.video-info {
  position: relative;
  gap: 0.748rem;
}

.video-info svg {
  width: 20px;
  height: auto;
  opacity: 0.6;
}

.video-info .duration {
  position: relative;
  font-weight: 600;
  font-size: 12px;
}

.videos-carousel .swiper-wrapper {
  align-items: stretch;
}

.videos-carousel .swiper-slide {
  display: flex;
  flex-direction: column;
  height: auto;
  border-radius: 12px;
  overflow: hidden;
}

.videos-carousel .swiper-slide .video-card {
  min-height: 100%;
  margin: 0;
  border-radius: 20px;
  aspect-ratio: 5.2 / 7.4;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  cursor: pointer;
  position: relative;
}

.videos-carousel .background-thumbnail {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.videos-carousel .swiper-slide {
  margin-right: 20px !important
}
.videos-carousel .video-overlay {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(0, 83, 136, 0) 37.5%, rgba(8, 93, 149, 0.94) 65.38%);
}

.videos-carousel .video-card-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0rem 1.4rem 1.8rem 1.4rem;
}

.videos-carousel .video-card-inner p {
  font-size: var(--font-p);
  line-height: 124%;
  font-weight: 600;
  width: 90%;
  margin: 0;
}

.videos-carousel .swiper-scrollbar.swiper-scrollbar-horizontal {
  position: relative !important;
}


/* =============================
   VIDEO MODAL STYLES
   ============================= */

.video-modal {
  position: fixed;
  background: #00131fd1;
  visibility: hidden;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: visibility 0s, opacity 0.3s ease;
  z-index: -10;
  pointer-events: none;
  display: flex;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-modal.active {
  visibility: visible;
  opacity: 1;
  z-index: 99999999999;
  pointer-events: all;
}

.video-modal-inner {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#video-wrapper {
  overflow: hidden;
  border-radius: 4px;
  background: #000;
  position: relative;
  transition: transform 0.6s ease, opacity 0.6s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

#video-wrapper video {
  width: auto;
  height: auto;
  max-height: 90vh;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

/* Embed container styles */
.modal-embed {
  width: 100%;
  height: 100%;
  min-width: 80vw;
  min-height: 45vw;
  max-height: 90vh;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Default aspect ratio for non-short videos */
.modal-embed:not(.youtube-short) {
  aspect-ratio: 16 / 9;
}

.modal-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* YouTube Shorts - same styling as regular videos since portrait forcing isn't possible */
.modal-embed.youtube-short {
  width: 100%;
  height: 100%;
  min-width: 80vw;
  min-height: 45vw;
  max-height: 90vh;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-embed.youtube-short iframe {
  width: 100%;
  height: 100%;
  border: none;
}

@media (max-width: 768px) {
  .modal-embed.youtube-short {
    width: 45vh !important;
    height: 80vh !important;
  }
}

@media (max-width: 768px) {
  .modal-embed {
    min-width: 95vw;
    min-height: 53.4vw;
  }
  
  .modal-embed.youtube-short,
  #modal-embed.youtube-short {
    width: 45vh !important;
    height: 80vh !important;
    aspect-ratio: 9 / 16 !important;
    max-width: 45vh !important;
    max-height: 80vh !important;
    min-width: auto !important;
    min-height: auto !important;
  }
}

.video-meta-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 1.2rem 1.5rem;
  color: white;
      background: linear-gradient(to bottom, rgb(1 26 41), transparent);
    transition: opacity .3s ease;
    opacity: 0;
    z-index: 10;
    pointer-events: none;
    height: 40%;
}

.video-modal-inner:hover .video-meta-overlay,
.video-modal-inner:focus-within .video-meta-overlay {
  opacity: 1;
}

.video-modal-nav {
  position: fixed; /* was absolute */
  top: 50%;
  right: 2vw; /* avoids overlap on smaller screens */
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 999999;
  opacity: 1;
  pointer-events: auto;
}

.video-modal-nav button {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  padding: 0.4rem 0.8rem;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.video-modal-nav button svg circle {
  transition: all 400ms ease;;
}
.video-modal-nav button:hover svg circle {
  fill: var(--theme-orange); 
}

.video-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 999999;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.video-modal-close svg {
  display: block;
  width: 42px;
  height: 42px;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.slide-up {
  animation: slideUp 0.6s ease forwards;
}

.slide-down {
  animation: slideDown 0.6s ease forwards;
}


#video-wrapper h3 {
    font-size: 1.24rem;
    width: 90%;
}

.video-modal-nav .arrow-button.disabled {
  opacity: 0.2;
  pointer-events: none;
}
.video-modal-nav .arrow-button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.video-modal-nav .arrow-button svg {
  width: 45px;
  height: 45px;
  display: block;
  transition: transform 0.2s ease;
}
.video-modal-nav .arrow-button {
  min-width: 45px;
  min-height: 45px;
}

/* Rotate for direction */
.video-modal-nav .arrow-button.up svg {
  transform: rotate(-90deg);
}

.video-modal-nav .arrow-button.down svg {
  transform: rotate(90deg);
}
