

/* === extracted from gallery.php === */

/* --- block 1 --- */
  .gallery-section {
    padding: 6vw 5vw;
    background: #000;
  }

  .gallery-section .gallery-head {
    text-align: center;
    margin-bottom: 4vw;
  }

  .gallery-section .gallery-head h2 {
    color: #fff;
    font-size: 3vw;
    margin-bottom: 1vw;
  }

  .gallery-section .gallery-head p {
    color: #cfcfcf;
    max-width: 50vw;
    margin: 0 auto;
    font-size: 1.05vw;
    line-height: 1.6;
  }

  .gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2vw;
  }

  .gallery-item {
    position: relative;
    overflow: hidden;
    border: 1px solid #2a2a2a;
    background: #0a0a0a;
    border-radius: 6px;
    cursor: pointer;
  }

  .gallery-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
  }

  .gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
  }

  .gallery-item:hover .gallery-thumb img { transform: scale(1.05); }

  .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5vw;
    height: 5vw;
    transform: translate(-50%, -50%);
    background: rgba(255, 45, 55, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background 0.3s ease;
    pointer-events: none;
  }

  .gallery-item:hover .play-icon {
    transform: translate(-50%, -50%) scale(1.1);
    background: #ff2d37;
  }

  .play-icon::before {
    content: "";
    width: 0;
    height: 0;
    border-left: 1.4vw solid #fff;
    border-top: 0.9vw solid transparent;
    border-bottom: 0.9vw solid transparent;
    margin-left: 0.3vw;
  }

  .gallery-item .gallery-caption {
    padding: 1.2vw 1.5vw;
    color: #fff;
    font-size: 1.1vw;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-top: 1px solid #2a2a2a;
  }

  /* Lightbox — matches homepage video-modal visual style
     (decorative corner brackets + circular white close button). */
  .video-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    /* Above .mainheader (z-index 50) so the header doesn't poke through. */
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
    /* Top padding ≥ header height so the close button sits clear of the
       fixed header on large viewports; symmetrical bottom for visual balance. */
    padding: clamp(96px, 11vh, 140px) 32px clamp(48px, 8vh, 96px);
  }

  .video-lightbox.active {
    display: flex;
    opacity: 1;
  }

  .video-lightbox-inner {
    position: relative;
    width: 100%;
    /* Cap the width by both an absolute max AND by what fits vertically given
       the 16:9 ratio plus the surrounding padding/close-button gap. The min()
       ensures the player shrinks before its top edge reaches the header. */
    max-width: min(1080px, calc((100vh - 320px) * 16 / 9));
    aspect-ratio: 16 / 9;
    background: #000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  }

  .video-lightbox-inner video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
    object-fit: contain;
  }

  /* Decorative L-bracket corners (lifted from homepage modal). */
  .video-lightbox .cuadrado {
    position: absolute;
    width: 35px;
    height: 35px;
    z-index: 2;
    pointer-events: none;
  }

  .video-lightbox .cuadrado1 { top: -1px; left: -1px; }
  .video-lightbox .cuadrado2 { top: -1px; right: -1px; transform: rotate(90deg); }
  .video-lightbox .cuadrado3 { bottom: -1px; left: -1px; transform: rotate(270deg); }
  .video-lightbox .cuadrado4 { bottom: -1px; right: -1px; transform: rotate(180deg); }

  /* Circular white close button positioned just above the player. */
  .video-lightbox-close {
    position: absolute;
    top: -56px;
    right: 0;
    width: 44px;
    height: 44px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    z-index: 3;
  }

  .video-lightbox-close:hover,
  .video-lightbox-close:focus-visible {
    background: #ff2d37;
    color: #fff;
    transform: scale(1.05);
    outline: none;
  }

  body.lightbox-open {
    overflow: hidden;
  }

  /* === Tablet (768–1024) === */
  @media (min-width: 768px) and (max-width: 1024.98px) {
    .video-lightbox {
      padding: 24px;
    }
    .video-lightbox-close {
      top: -64px;
      width: 56px;
      height: 56px;
      font-size: 28px;
    }
    .video-lightbox .cuadrado {
      width: 30px;
      height: 30px;
    }
  }

  /* === Mobile responsive overrides for gallery thumbs === */
  @media (max-width: 1024.98px) {
    .gallery-section { padding: 12vw 5vw; }
    .gallery-section .gallery-head h2 { font-size: 7vw; }
    .gallery-section .gallery-head p { font-size: 3.5vw; max-width: 90vw; }
    .gallery-grid { grid-template-columns: 1fr; gap: 5vw; }
    .gallery-item .gallery-caption { font-size: 3.8vw; padding: 3vw 4vw; }
    .play-icon { width: 14vw; height: 14vw; }
    .play-icon::before { border-left-width: 4vw; border-top-width: 2.5vw; border-bottom-width: 2.5vw; margin-left: 1vw; }
  }

  /* === Mobile (≤767) — bigger close, tighter padding === */
  @media (max-width: 767.98px) {
    .video-lightbox {
      padding: 16px;
    }
    .video-lightbox-close {
      top: -60px;
      width: 52px;
      height: 52px;
      font-size: 26px;
    }
    .video-lightbox .cuadrado {
      width: 24px;
      height: 24px;
    }
  }
