/**
 * Block-specific styles for Video Gallery theme
 */

/* ============================================
   YOUTUBE HERO BLOCK
   ============================================ */

.vg-youtube-hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  background-color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}

.vg-youtube-hero__container {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
}

.vg-youtube-hero__video-wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
  background-color: #171717;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.vg-youtube-hero__video-wrapper iframe,
.vg-youtube-hero__video-wrapper .wp-block-embed__wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.vg-youtube-hero__content {
  text-align: center;
  margin-top: 2rem;
}

.vg-youtube-hero__title {
  font-size: 2.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.vg-youtube-hero__description {
  font-size: 1.125rem;
  color: #a3a3a3;
  max-width: 42rem;
  margin: 0 auto;
  line-height: 1.6;
}

@media (min-width: 768px) {
  .vg-youtube-hero__title {
    font-size: 3rem;
  }
}

@media (min-width: 1024px) {
  .vg-youtube-hero__title {
    font-size: 3.75rem;
  }
}

/* ============================================
   NATIVE GALLERY BLOCK
   ============================================ */

.vg-gallery {
  width: 100%;
  background-color: #0a0a0a;
  padding: 5rem 1rem;
}

.vg-gallery__container {
  max-width: 80rem;
  margin: 0 auto;
}

.vg-gallery__header {
  text-align: center;
  margin-bottom: 3rem;
}

.vg-gallery__title {
  font-size: 1.875rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1rem;
}

.vg-gallery__description {
  color: #a3a3a3;
  max-width: 36rem;
  margin: 0 auto;
  line-height: 1.6;
}

/* Native Gallery Block Styles */
.wp-block-gallery.vg-native-gallery {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
  margin: 0;
}

@media (min-width: 640px) {
  .wp-block-gallery.vg-native-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .wp-block-gallery.vg-native-gallery {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Override default gallery styles */
.wp-block-gallery.vg-native-gallery.columns-4 {
  display: grid;
}

.wp-block-gallery.vg-native-gallery .blocks-gallery-grid,
.wp-block-gallery.vg-native-gallery .wp-block-image {
  margin: 0;
  width: 100% !important;
}

/* Gallery Item Styling */
.wp-block-gallery.vg-native-gallery .wp-block-image.vg-gallery-item {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 0.75rem;
  overflow: hidden;
  background-color: #171717;
  transition: box-shadow 0.3s ease;
}

.wp-block-gallery.vg-native-gallery .wp-block-image.vg-gallery-item:hover {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.wp-block-gallery.vg-native-gallery .wp-block-image.vg-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.wp-block-gallery.vg-native-gallery .wp-block-image.vg-gallery-item:hover img {
  transform: scale(1.1);
}

/* Caption Styling */
.wp-block-gallery.vg-native-gallery .wp-block-image .wp-element-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.25rem;
  margin: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.5), transparent);
  color: #d4d4d4;
  font-size: 0.875rem;
  line-height: 1.5;
  text-align: left;
}

.wp-block-gallery.vg-native-gallery .wp-block-image .wp-element-caption strong {
  display: block;
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  transition: color 0.3s ease;
}

.wp-block-gallery.vg-native-gallery .wp-block-image.vg-gallery-item:hover .wp-element-caption strong {
  color: #60a5fa;
}

/* Link overlay for gallery items */
.wp-block-gallery.vg-native-gallery .wp-block-image.vg-gallery-item > a {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
}

.wp-block-gallery.vg-native-gallery .wp-block-image.vg-gallery-item > a::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-radius: 0.75rem;
  transition: border-color 0.3s ease;
  pointer-events: none;
}

.wp-block-gallery.vg-native-gallery .wp-block-image.vg-gallery-item:hover > a::after {
  border-color: rgba(59, 130, 246, 0.5);
}

/* ============================================
   GALLERY PLACEHOLDER ITEMS
   ============================================ */

.wp-block-gallery.vg-native-gallery .wp-block-image.vg-gallery-item--placeholder {
  background-color: #171717;
  border: 2px dashed #262626;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wp-block-gallery.vg-native-gallery .wp-block-image.vg-gallery-item--placeholder img {
  display: none;
}

.wp-block-gallery.vg-native-gallery .wp-block-image.vg-gallery-item--placeholder .wp-element-caption {
  display: none;
}

.vg-gallery-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  width: 100%;
  height: 100%;
}

.vg-gallery-placeholder__icon {
  width: 4rem;
  height: 4rem;
  background-color: #262626;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #525252;
  margin-bottom: 1rem;
}

.vg-gallery-placeholder__title {
  font-size: 1.125rem;
  font-weight: 500;
  color: #525252;
  margin-bottom: 0.25rem;
}

.vg-gallery-placeholder__desc {
  font-size: 0.875rem;
  color: #525252;
}

/* ============================================
   GALLERY FOOTER
   ============================================ */

.vg-gallery__footer {
  text-align: center;
  margin-top: 3rem;
}

.vg-gallery__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #60a5fa;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.3s ease;
}

.vg-gallery__link:hover {
  color: #3b82f6;
}

.vg-gallery__link a {
  color: inherit;
  text-decoration: none;
}

/* ============================================
   WORDPRESS BLOCK OVERRIDES
   ============================================ */

/* Ensure embeds are responsive */
.wp-block-embed {
  margin: 0;
}

.wp-block-embed__wrapper {
  position: relative;
}

/* Gallery block fixes */
.wp-block-gallery {
  margin-bottom: 0;
}

.wp-block-gallery .blocks-gallery-item,
.wp-block-gallery .wp-block-image {
  margin: 0;
}

/* Remove default gallery spacing */
.wp-block-gallery.has-nested-images {
  gap: 1.5rem;
}

/* Fix for gallery caption positioning */
.wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.5), transparent);
  color: #d4d4d4;
  padding: 1.25rem;
  margin: 0;
}
