/**
 * Video Gallery Pro - Frontend Styles
 * Blog-card layout (red accent)
 * Version 1.1.0
 */

.vgp-gallery {
  position: relative;
  margin: 30px 0 40px;
  font-family: Arial, Helvetica, sans-serif;
}

.vgp-gallery__header {
  text-align: center;
  margin-bottom: 28px;
}

.vgp-gallery__title {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  color: #111;
  line-height: 1.25;
}

.vgp-gallery__subtitle {
  margin: 0 auto;
  max-width: 640px;
  font-size: 15px;
  line-height: 1.5;
  color: #777;
}

.vgp-gallery__actions {
  margin-top: 12px;
}

.vgp-gallery__actions a {
  color: #c4161c;
  font-size: 13px;
  text-decoration: none;
}

.vgp-gallery__actions a:hover {
  text-decoration: underline;
}

.vgp-categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.vgp-categories a {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid #ddd;
  border-radius: 2px;
  color: #333;
  text-decoration: none;
  background: #fff;
  font-size: 13px;
  transition: all 0.2s ease;
}

.vgp-categories a:hover,
.vgp-categories a.is-active {
  background: #c4161c;
  border-color: #c4161c;
  color: #fff;
}

.vgp-slider {
  position: relative;
  overflow: hidden;
  padding: 4px 2px 16px;
}

.vgp-slider .swiper-slide {
  height: auto;
}

.vgp-grid {
  display: grid;
  gap: 22px;
  width: 100% !important;
  max-width: 100% !important;
}

/* 1 video = full width of content area */
.vgp-grid--1,
.vgp-gallery--count-1 .vgp-grid {
  grid-template-columns: 1fr !important;
  width: 100% !important;
}

.vgp-grid--1 .vgp-card,
.vgp-gallery--count-1 .vgp-card {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
}

.vgp-grid--1 .vgp-card__media,
.vgp-gallery--count-1 .vgp-card__media {
  width: 100% !important;
  aspect-ratio: 16 / 9;
  max-height: none;
}

.vgp-grid--1 .vgp-card__media img,
.vgp-gallery--count-1 .vgp-card__media img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

/* 2 videos = 50% / 50% */
.vgp-grid--2,
.vgp-gallery--count-2 .vgp-grid {
  grid-template-columns: repeat(2, 1fr) !important;
}

/* 3 videos = equal thirds */
.vgp-grid--3,
.vgp-gallery--count-3 .vgp-grid {
  grid-template-columns: repeat(3, 1fr) !important;
}

/* Fallback: if old Swiper still renders 1-3 slides, stretch them */
.vgp-gallery--count-1 .swiper,
.vgp-gallery--count-1 .swiper-wrapper,
.vgp-gallery--count-1 .swiper-slide {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  transform: none !important;
}

.vgp-gallery--count-1 .swiper-slide {
  flex: 0 0 100% !important;
}

/* 4+ videos use Swiper slider */

.vgp-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 0;
  border-top: 4px solid #c4161c;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: none;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.vgp-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.vgp-card__media {
  position: relative;
  display: block;
  overflow: hidden;
  background: #f3f3f3;
  aspect-ratio: 16 / 9;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

.vgp-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.vgp-card:hover .vgp-card__media img {
  transform: scale(1.03);
}

.vgp-card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: rgba(196, 22, 28, 0.92);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, background 0.2s ease;
}

.vgp-card__play:before {
  content: '';
  display: block;
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 14px solid currentColor;
}

.vgp-card:hover .vgp-card__play {
  transform: scale(1.06);
  background: #c4161c;
}

.vgp-card__duration {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 12px;
  padding: 3px 7px;
  border-radius: 2px;
  line-height: 1.2;
}

.vgp-card__body {
  padding: 22px 22px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.vgp-card__title {
  display: none !important;
}

.vgp-card__desc {
  margin: 0 0 18px;
  color: #222;
  font-size: 15px;
  line-height: 1.55;
  flex: 1;
}

.vgp-card__btn {
  display: inline-block;
  align-self: flex-start;
  background: #c4161c;
  color: #fff !important;
  border: 0;
  border-radius: 2px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none !important;
  cursor: pointer;
  transition: background 0.2s ease;
}

.vgp-card__btn:hover,
.vgp-card__btn:focus {
  background: #a61217;
  color: #fff !important;
  text-decoration: none !important;
}

.vgp-meta {
  display: none;
}

.vgp-slider .swiper-button-prev,
.vgp-slider .swiper-button-next {
  color: #fff;
  background: #c4161c;
  width: 36px;
  height: 36px;
  border-radius: 2px;
  top: 42%;
}

.vgp-slider .swiper-button-prev:after,
.vgp-slider .swiper-button-next:after {
  font-size: 14px;
  font-weight: 700;
}

.vgp-slider .swiper-pagination-bullet-active {
  background: #c4161c;
}

/* Popup */
.vgp-popup {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.vgp-popup.is-open {
  display: flex;
}

.vgp-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.vgp-popup__dialog {
  position: relative;
  z-index: 1;
  width: min(900px, 100%);
  background: #000;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.vgp-popup__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.vgp-popup__media {
  position: relative;
  width: 100%;
  background: #000;
  aspect-ratio: 16 / 9;
}

.vgp-popup__media video,
.vgp-popup__media iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

.vgp-popup__content {
  display: none;
}

.vgp-popup__loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1;
}

.vgp-video-page__player {
  margin-bottom: 20px;
  background: #000;
  overflow: hidden;
}

.vgp-video-page__player video,
.vgp-video-page__player iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  display: block;
}

body.vgp-popup-open {
  overflow: hidden;
}

@media (max-width: 991px) {
  .vgp-grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .vgp-grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .vgp-grid--1,
  .vgp-grid--2,
  .vgp-grid--3 {
    grid-template-columns: 1fr;
  }

  .vgp-grid--1 .vgp-card__media {
    aspect-ratio: 16 / 9;
    max-height: none;
  }

  .vgp-gallery__title {
    font-size: 24px;
  }

  .vgp-card__body {
    padding: 18px;
  }

  .vgp-popup {
    padding: 10px;
  }
}
