/* =========================
   FILTROS
   ========================= */
   .gallery-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
  }
  
  .filter-btn {
    padding: .5rem 1.2rem;
    border: none;
    background: #eaeaea;
    cursor: pointer;
    border-radius: 4px;
    transition: background .25s ease, color .25s ease, transform .12s ease;
  }
  
  .filter-btn:active { transform: translateY(1px); }
  
  .filter-btn.active,
  .filter-btn:hover {
    background: #000;
    color: #fff;
  }
  
  /* =========================
     GRID
     ========================= */
  .gallery-section {
    padding: 4rem 0rem;
  }
  
  .gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
  }
  
  /* Ajuste clave: permitir que el contenido llene el item para evitar franjas */
  .gallery-item {
    overflow: hidden;
    cursor: pointer;
    border-radius: 6px;
    position: relative;
    background: #111; /* fallback while image loads */
    min-height: 180px;
    display: flex;
    align-items: stretch; /* <-- changed: stretch so wrappers llenen la altura */
    justify-content: center;
  }
  
  /* Imagenes normales (llenan el item) */
  .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease, opacity .25s ease;
    position: relative;
    z-index: 1; /* por debajo del play */
  }
  
  .gallery-item:hover img {
    transform: scale(1.05);
  }
  
  /* =========================
     BOTON PLAY (mask method)
     Cambiá --play-color para cambiar color
     ========================= */
  :root {
    --play-size: 64px;
    --play-color: rgba(255,255,255,0.95);
  }
  
  .gallery-item[data-type="youtube"],
  .gallery-item[data-type="video"] {
    position: relative;
  }
  
  /* Pseudo-elemento play (sigue siendo compatible) */
  .gallery-item[data-type="youtube"]::after,
  .gallery-item[data-type="video"]::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--play-size);
    height: var(--play-size);
    transform: translate(-50%, -50%);
    background-color: var(--play-color);
    /* Ajustá la ruta si es necesario: prueba "/img/play.svg" si ../ no funciona */
    mask: url("../img/play.svg") center/contain no-repeat;
    -webkit-mask: url("../img/play.svg") center/contain no-repeat;
    opacity: 0.95;
    transition: transform .25s ease, opacity .25s ease;
    pointer-events: none;
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(0,0,0,0.45);
    z-index: 5; /* asegurar que esté por encima de la imagen */
  }
  
  .gallery-item[data-type="youtube"]:hover::after,
  .gallery-item[data-type="video"]:hover::after {
    transform: translate(-50%, -50%) scale(1.06);
    opacity: 1;
  }
  
  /* Fallback si el navegador no soporta mask: usar imagen SVG como background */
  @supports not (mask: url("../img/play.svg")) {
    .gallery-item[data-type="youtube"]::after,
    .gallery-item[data-type="video"]::after {
      background-color: transparent;
      background-image: url("../img/play.svg");
      background-repeat: no-repeat;
      background-position: center;
      background-size: contain;
      filter: drop-shadow(0 6px 12px rgba(0,0,0,0.45));
    }
  }
  
  /* =========================
     LIGHTBOX
     ========================= */
  .lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 2rem;
    box-sizing: border-box;
  }
  
  .lightbox-content {
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }
  
  .lightbox-img {
    display: none;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  }
  
  .lightbox-video {
    display: none;
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    object-fit: contain;
    background: black;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  }
  
  .lightbox-iframe {
    display: none;
    width: 100%;
    max-width: 1200px;
    height: 70vh;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  }
  
  .lightbox-close {
    position: absolute;
    top: 24px;
    right: 28px;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    z-index: 10010;
    background: rgba(0,0,0,0.25);
    padding: 6px 10px;
    border-radius: 6px;
    transition: background .18s ease, transform .12s ease;
  }
  
  .lightbox-close:hover { background: rgba(255,255,255,0.06); transform: translateY(-1px); }
  
  /* =========================
     VIDEO THUMBNAILS: uniform size for videos only
     ========================= */
  
  /* Wrapper que ocupa todo el .gallery-item y evita franjas */
  .video-thumb-wrapper {
    width: 100%;
    height: 100%; /* ocupa toda la altura del gallery-item */
    overflow: hidden;
    background: transparent; /* deja que el fondo del item sea visible */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
  }
  
  /* Si quieres forzar una relación fija solo para el contenido visual,
     usa un elemento interno con aspect-ratio; aquí mantenemos la estructura
     para que no aparezcan franjas y la imagen se recorte con object-fit */
  .video-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease, opacity .25s ease;
    position: relative;
    z-index: 1;
  }
  
  /* Placeholder/fallback dentro del wrapper */
  .thumb-placeholder,
  .thumb-fallback {
    width: 100%;
    height: 100%;
    display: block;
    background: #111;
  }
  
  /* Si prefieres que los videos tengan una relación fija (opcional),
     descomenta la regla siguiente y ajusta la relación:
  .video-thumb-wrapper { aspect-ratio: 16 / 9; }
  */
  
  /* Ocultar el play cuando el item está reproduciéndose (lightbox abierto) */
  .gallery-item.playing::after {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
    transition: opacity .18s ease, transform .18s ease;
    pointer-events: none;
  }
  
  /* =========================
     RESPONSIVE
     ========================= */
  @media (max-width: 900px) {
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    :root { --play-size: 56px; }
  }
  
  @media (max-width: 600px) {
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; }
    .gallery-item { min-height: 140px; }
    .lightbox-iframe { height: 60vh; }
    .lightbox-video, .lightbox-img { max-height: 70vh; }
    :root { --play-size: 48px; }
  
    .gallery-section {
      padding: 2rem 0rem;
    }
  }
  
  /* =========================
     ACCESIBILIDAD Y DETALLES
     ========================= */
  .gallery-item, .filter-btn { -webkit-tap-highlight-color: transparent; }
  
  .lightbox.fade-in { animation: fadeIn .18s ease both; }
  .lightbox.fade-out { animation: fadeOut .12s ease both; }
  
  @keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
  @keyframes fadeOut { from { opacity: 1 } to { opacity: 0 } }
  