/* CW Galería Flexible v1.0.3
   CSS frontend limpio, neutro y compatible con cualquier tema. */
.cwg-gallery{
  --cwg-columns:3;
  --cwg-gap:16px;
  --cwg-slider-visible-desktop:1;
  --cwg-slider-visible-tablet:1;
  --cwg-slider-visible-mobile:1;
  --cwg-slider-visible:var(--cwg-slider-visible-desktop);
  position:relative;
  width:100%;
  max-width:100%;
  box-sizing:border-box;
  clear:both;
}
.cwg-gallery,
.cwg-gallery *{
  box-sizing:border-box;
}
.cwg-gallery figure,
.cwg-item{
  margin:0;
  padding:0;
}
.cwg-item{
  position:relative;
  display:block;
  overflow:hidden;
  background:transparent;
  border:0;
  border-radius:0;
  box-shadow:none;
}
.cwg-image{
  display:block;
  width:100%;
  max-width:100%;
  height:auto;
  margin:0;
  border:0;
  border-radius:0;
  box-shadow:none;
  background:transparent;
  transition:opacity .22s ease;
}
.cwg-link,
.cwg-custom-link{
  display:block;
  color:inherit;
  text-decoration:none;
  border:0;
  outline-offset:3px;
}
.cwg-link:hover .cwg-image,
.cwg-link:focus .cwg-image{
  opacity:.92;
}
.cwg-caption{
  position:static;
  display:block;
  margin:0;
  padding:8px 0 0;
  color:inherit;
  font-size:14px;
  line-height:1.45;
  background:transparent;
  text-shadow:none;
}
.cwg-notice{
  padding:14px 16px;
  border:1px solid #dcdcde;
  border-radius:6px;
  background:#fff;
  color:#3c434a;
}

/* Layout: Grid */
.cwg-layout-grid{
  display:grid;
  grid-template-columns:repeat(var(--cwg-columns), minmax(0, 1fr));
  gap:var(--cwg-gap);
  align-items:start;
}
.cwg-layout-grid.cwg-fit-cover .cwg-item,
.cwg-layout-grid.cwg-fit-contain .cwg-item{
  aspect-ratio:1/1;
}
.cwg-layout-grid.cwg-fit-cover .cwg-image,
.cwg-layout-grid.cwg-fit-contain .cwg-image{
  width:100%;
  height:100%;
}
.cwg-layout-grid.cwg-fit-cover .cwg-image{
  object-fit:cover;
}
.cwg-layout-grid.cwg-fit-contain .cwg-image{
  object-fit:contain;
}

/* Layout: Masonry */
.cwg-layout-masonry{
  column-count:var(--cwg-columns);
  column-gap:var(--cwg-gap);
}
.cwg-layout-masonry .cwg-item{
  display:inline-block;
  width:100%;
  margin:0 0 var(--cwg-gap);
  break-inside:avoid;
}
.cwg-layout-masonry .cwg-image{
  height:auto;
  object-fit:initial;
}

/* Layout: Mosaico editorial */
.cwg-layout-mosaic{
  display:grid;
  grid-template-columns:repeat(var(--cwg-columns), minmax(0, 1fr));
  grid-auto-rows:150px;
  grid-auto-flow:dense;
  gap:var(--cwg-gap);
}
.cwg-layout-mosaic .cwg-item{
  min-height:150px;
}
.cwg-layout-mosaic .cwg-image{
  width:100%;
  height:100%;
  object-fit:cover;
}
.cwg-layout-mosaic.cwg-fit-contain .cwg-image{
  object-fit:contain;
}
.cwg-layout-mosaic .cwg-mosaic-1,
.cwg-layout-mosaic .cwg-mosaic-6{
  grid-column:span 2;
  grid-row:span 2;
}
.cwg-layout-mosaic .cwg-mosaic-3{
  grid-row:span 2;
}

/* Layout: Imagen destacada */
.cwg-layout-featured{
  display:grid;
  grid-template-columns:minmax(0, 1.35fr) minmax(240px, .65fr);
  gap:var(--cwg-gap);
  align-items:start;
}
.cwg-featured-main .cwg-item,
.cwg-featured-thumbs .cwg-item{
  background:transparent;
}
.cwg-featured-thumbs{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:var(--cwg-gap);
}
.cwg-layout-featured.cwg-fit-cover .cwg-featured-main .cwg-item,
.cwg-layout-featured.cwg-fit-contain .cwg-featured-main .cwg-item{
  min-height:360px;
}
.cwg-layout-featured.cwg-fit-cover .cwg-featured-main .cwg-image,
.cwg-layout-featured.cwg-fit-contain .cwg-featured-main .cwg-image{
  height:100%;
}
.cwg-layout-featured.cwg-fit-cover .cwg-featured-thumbs .cwg-item,
.cwg-layout-featured.cwg-fit-contain .cwg-featured-thumbs .cwg-item{
  aspect-ratio:1/1;
}
.cwg-layout-featured.cwg-fit-cover .cwg-featured-thumbs .cwg-image,
.cwg-layout-featured.cwg-fit-contain .cwg-featured-thumbs .cwg-image{
  height:100%;
}
.cwg-layout-featured.cwg-fit-cover .cwg-image{
  object-fit:cover;
}
.cwg-layout-featured.cwg-fit-contain .cwg-image{
  object-fit:contain;
}

/* Layout: Slider / carrusel */
.cwg-layout-slider{
  overflow:visible;
}
.cwg-slider{
  position:relative;
  width:100%;
  overflow:visible;
  background:transparent;
  border:0;
  border-radius:0;
  box-shadow:none;
}
.cwg-slider-viewport{
  width:100%;
  overflow:hidden;
  background:transparent;
  border:0;
  border-radius:0;
}
.cwg-slider-track{
  display:flex;
  align-items:stretch;
  gap:var(--cwg-gap);
  transition:transform .45s cubic-bezier(.22,.61,.36,1);
  will-change:transform;
}
.cwg-slide{
  flex:0 0 calc((100% - ((var(--cwg-slider-visible, var(--cwg-slider-visible-desktop, 1)) - 1) * var(--cwg-gap))) / var(--cwg-slider-visible, var(--cwg-slider-visible-desktop, 1)));
  min-width:0;
}
.cwg-slide .cwg-item,
.cwg-slide .cwg-link{
  height:100%;
}
.cwg-layout-slider.cwg-fit-cover .cwg-slide .cwg-item,
.cwg-layout-slider.cwg-fit-contain .cwg-slide .cwg-item{
  min-height:clamp(220px, 34vw, 480px);
}
.cwg-layout-slider.cwg-fit-cover .cwg-image,
.cwg-layout-slider.cwg-fit-contain .cwg-image{
  height:100%;
}
.cwg-layout-slider.cwg-fit-cover .cwg-image{
  object-fit:cover;
}
.cwg-layout-slider.cwg-fit-contain .cwg-image{
  object-fit:contain;
}
.cwg-slider-btn{
  position:absolute;
  top:50%;
  z-index:5;
  transform:translateY(-50%);
  width:44px;
  height:44px;
  padding:0;
  border:0;
  border-radius:999px;
  background:rgba(0,0,0,.45);
  color:#fff;
  font-size:32px;
  line-height:1;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:background .2s ease, opacity .2s ease;
}
.cwg-slider-btn:hover,
.cwg-slider-btn:focus{
  background:rgba(0,0,0,.68);
}
.cwg-slider-btn.is-hidden{
  display:none;
}
.cwg-slider-prev{
  left:10px;
}
.cwg-slider-next{
  right:10px;
}

/* Modo logos/clientes/patrocinadores */
.cwg-slider-logos .cwg-slide .cwg-item,
.cwg-slider-logos .cwg-link{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:96px;
  background:transparent;
  border:0;
  box-shadow:none;
}
.cwg-slider-logos .cwg-image{
  width:auto;
  max-width:100%;
  height:auto;
  max-height:110px;
  object-fit:contain;
  background:transparent;
}
.cwg-slider-logos .cwg-caption{
  display:none;
}

/* Lightbox: solo aparece al abrir una imagen. No afecta al diseño normal de la web. */
.cwg-lightbox{
  position:fixed;
  inset:0;
  z-index:999999;
  display:none;
  align-items:center;
  justify-content:center;
  padding:28px;
  background:rgba(0,0,0,.86);
}
.cwg-lightbox.is-open{
  display:flex;
}
.cwg-lightbox-inner{
  position:relative;
  max-width:min(1100px,94vw);
  max-height:90vh;
  text-align:center;
}
.cwg-lightbox img{
  display:block;
  max-width:100%;
  max-height:82vh;
  width:auto;
  height:auto;
  border-radius:0;
  box-shadow:none;
  background:transparent;
}
.cwg-lightbox-caption{
  margin-top:12px;
  color:#fff;
  font-size:15px;
  line-height:1.5;
}
.cwg-lightbox-close,
.cwg-lightbox-nav{
  position:absolute;
  border:0;
  border-radius:999px;
  background:rgba(255,255,255,.16);
  color:#fff;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:background .2s ease;
}
.cwg-lightbox-close:hover,
.cwg-lightbox-close:focus,
.cwg-lightbox-nav:hover,
.cwg-lightbox-nav:focus{
  background:rgba(255,255,255,.28);
}
.cwg-lightbox-close{
  top:-18px;
  right:-18px;
  width:44px;
  height:44px;
  font-size:28px;
}
.cwg-lightbox-nav{
  top:50%;
  width:46px;
  height:46px;
  font-size:34px;
  transform:translateY(-50%);
}
.cwg-lightbox-prev{
  left:-64px;
}
.cwg-lightbox-next{
  right:-64px;
}

@media (max-width:900px){
  .cwg-gallery{
    --cwg-slider-visible:var(--cwg-slider-visible-tablet, 2);
  }
  .cwg-layout-mosaic{
    grid-template-columns:repeat(3, minmax(0, 1fr));
    grid-auto-rows:120px;
  }
  .cwg-layout-featured{
    grid-template-columns:1fr;
  }
  .cwg-lightbox-prev{
    left:10px;
  }
  .cwg-lightbox-next{
    right:10px;
  }
}
@media (max-width:640px){
  .cwg-gallery{
    --cwg-gap:min(var(--cwg-gap),14px);
    --cwg-slider-visible:var(--cwg-slider-visible-mobile, 1);
  }
  .cwg-layout-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
  .cwg-layout-masonry{
    column-count:2;
  }
  .cwg-layout-mosaic{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    grid-auto-rows:112px;
  }
  .cwg-layout-mosaic .cwg-mosaic-1,
  .cwg-layout-mosaic .cwg-mosaic-6{
    grid-column:span 2;
    grid-row:span 2;
  }
  .cwg-layout-mosaic .cwg-mosaic-3{
    grid-row:span 1;
  }
  .cwg-featured-thumbs{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
  .cwg-slider-btn{
    width:38px;
    height:38px;
    font-size:28px;
  }
  .cwg-caption{
    font-size:13px;
  }
  .cwg-lightbox{
    padding:18px;
  }
  .cwg-lightbox-close{
    top:8px;
    right:8px;
  }
  .cwg-lightbox-nav{
    width:40px;
    height:40px;
    font-size:30px;
  }
}
@media (max-width:420px){
  .cwg-layout-grid{
    grid-template-columns:1fr;
  }
  .cwg-layout-masonry{
    column-count:1;
  }
  .cwg-layout-mosaic{
    grid-template-columns:1fr;
    grid-auto-rows:auto;
  }
  .cwg-layout-mosaic .cwg-item{
    grid-column:auto!important;
    grid-row:auto!important;
    min-height:auto;
  }
  .cwg-layout-mosaic .cwg-image{
    height:auto;
    object-fit:initial;
  }
  .cwg-featured-thumbs{
    grid-template-columns:1fr;
  }
}
