﻿/*
   Variables CSS por defecto.
   Si tu proyecto ya define estas variables, eliminar este bloque
   para evitar conflictos.
*/
:root {
  --lb-coal:       #1a1e24;   /* fondo del player de audio       */
  --lb-steel:      #2f4b6e;   /* fondo thumb audio / badge audio */
  --lb-blue:       #2d6fa5;   /* color principal / acento        */
  --lb-sky:        #6ab0d8;   /* icono descarga / spinner top    */
  --lb-white:      #ffffff;
  --lb-transition: .3s cubic-bezier(.4,0,.2,1);
  --lb-font-head:  'Barlow Condensed', 'Arial Narrow', sans-serif;
  --lb-font-body:  'Barlow', Arial, sans-serif;
}

/*
 * NOTA: Si tu proyecto usa variables con otros nombres
 * (ej: --primary en lugar de --lb-blue), reemplazá las
 * referencias en este archivo o reasigná las variables:
 *
 *   :root { --lb-blue: var(--primary); }
 */


/*
   1. FILTER BAR — Barra de filtros de galería
   Uso HTML:
     <div class="gallery-filter-bar">
       <button class="gf-btn active" data-filter="*">Todos</button>
       <button class="gf-btn" data-filter="fotos">Fotos</button>
     </div>
*/
.gallery-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1rem;
}

.gf-btn {
  font-family: var(--lb-font-head);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--lb-white);
  color: var(--lb-steel);
  border: 1px solid #c8dcea;
  padding: .3rem .95rem;
  cursor: pointer;
  transition:
    background var(--lb-transition),
    color      var(--lb-transition),
    border-color var(--lb-transition);
}

.gf-btn:hover,
.gf-btn.active {
  background: var(--lb-blue);
  color: var(--lb-white);
  border-color: var(--lb-blue);
}


/*
   2. GALLERY GRID — Grilla de items
   Uso HTML:
     <div class="ycrt-gallery">
       <a class="ycrt-item" data-lightbox="grupo" ...> ... </a>
     </div>
*/
.ycrt-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
}

@media (min-width: 576px) {
  .ycrt-gallery { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
@media (min-width: 992px) {
  .ycrt-gallery { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}

/* Item individual */
.ycrt-item {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  cursor: pointer;
  background: var(--lb-coal);
  text-decoration: none;
}

.ycrt-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease, filter .5s ease;
  display: block;
}

.ycrt-item:hover img {
  transform: scale(1.08);
  filter: brightness(.7);
}

/* Overlay con ícono */
.ycrt-item-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--lb-white);
  opacity: 0;
  transition: opacity var(--lb-transition);
  background: rgba(20, 40, 70, .2);
}

/*.ycrt-item:hover .ycrt-item-overlay { opacity: 1; } */
.ycrt-item-overlay:hover { opacity: 1; }

/* Badge de tipo (video / audio) — generado con CSS desde data-type */
.ycrt-item--video::after,
.ycrt-item--audio::after {
  content: attr(data-type);
  position: absolute;
  top: 8px;
  left: 8px;
  font-family: var(--lb-font-head);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: var(--lb-blue);
  color: var(--lb-white);
  padding: .15rem .5rem;
  pointer-events: none;
}

.ycrt-item--audio::after { background: var(--lb-steel); }

/* Thumbnail de audio (cuando no hay imagen) */
.ycrt-audio-thumb {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--lb-coal) 0%, var(--lb-steel) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: var(--lb-sky);
  font-size: 2.5rem;
}

.ycrt-audio-thumb span {
  font-family: var(--lb-font-head);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
}

/* ── Animaciones de filtrado ── */
.ycrt-item.ycrt-hidden  { display: none; }

.ycrt-item.ycrt-fade-in {
  animation: ycrtFadeIn .35s ease both;
}

@keyframes ycrtFadeIn {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}


/*
   3. LIGHTBOX OVERLAY — Modal de pantalla completa
   El HTML del lightbox se inyecta desde ycrt-lightbox.js,
   o podés pegarlo manualmente desde ycrt-lightbox.html
*/
#ycrtLB {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 18, 30, .96);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

#ycrtLB.lb-open {
  opacity: 1;
  pointer-events: all;
}

/* Toolbar superior */
.lb-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem 1rem;
  background: rgba(0, 0, 0, .5);
  flex-shrink: 0;
  gap: .5rem;
}

.lb-counter {
  font-family: var(--lb-font-head);
  font-size: .8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .5);
  letter-spacing: .1em;
  min-width: 60px;
}

.lb-title-top {
  font-family: var(--lb-font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--lb-white);
  flex: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-actions {
  display: flex;
  gap: .4rem;
  align-items: center;
}

.lb-btn {
  background: rgba(255, 255, 255, .08);
  border: none;
  color: var(--lb-white);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: background var(--lb-transition), color var(--lb-transition);
  border-radius: 2px;
}

.lb-btn:hover         { background: var(--lb-blue); }
.lb-btn-download      { color: var(--lb-sky); }
.lb-btn-close         { color: #f06060; }
.lb-btn-close:hover   { background: #c0392b; color: var(--lb-white); }

/* ── Stage (área de media) ── */
.lb-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: .5rem 3.5rem;
}

@media (max-width: 576px) {
  .lb-stage { padding: .5rem 2.5rem; }
}

.lb-media-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: relative;
}

/* Imagen */
.lb-media-wrap img {
  height: 100%; 
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  animation: lbMediaIn .25s ease both;
}

/* iFrame (YouTube / Vimeo / Facebook) */
.lb-media-wrap iframe {
  /*width: auto; height: 100%;*/
  /*width: 100%; height: 100%;*/
  /*width: min(900px, 96vw);
  height: min(540px, 55vh);*/
  border: none;
  animation: lbMediaIn .25s ease both;
}
.lb-media-wrap iframe.galery-facebook{
  width: auto; height: 100%;
}
.lb-media-wrap iframe.galery-youtube{
  width: 100%; height: 100%;
}

/* Video local */
.lb-media-wrap video {
  max-width: min(900px, 96vw);
  max-height: min(540px, 55vh);
  outline: none;
  animation: lbMediaIn .25s ease both;
}

/* Player de audio */
.lb-audio-player {
  background: linear-gradient(135deg, var(--lb-coal) 0%, var(--lb-steel) 100%);
  padding: 2.5rem 2rem;
  text-align: center;
  border-radius: 4px;
  min-width: min(380px, 90vw);
  animation: lbMediaIn .25s ease both;
}

.lb-audio-player i {
  font-size: 4rem;
  color: var(--lb-sky);
  margin-bottom: 1rem;
  display: block;
}

.lb-audio-player audio {
  width: 100%;
  margin-top: 1rem;
}

/* Spinner de carga */
.lb-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, .15);
  border-top-color: var(--lb-sky);
  border-radius: 50%;
  animation: lbSpin .7s linear infinite;
  position: absolute;
}

/* Flechas de navegación */
.lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, .07);
  border: none;
  color: var(--lb-white);
  width: 42px;
  height: 64px;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--lb-transition);
  z-index: 2;
}

.lb-arrow:hover    { background: var(--lb-blue); }
.lb-arrow-prev     { left: 0; }
.lb-arrow-next     { right: 0; }
.lb-arrow:disabled { opacity: .2; pointer-events: none; }

/* Caption inferior */
.lb-caption {
  flex-shrink: 0;
  padding: .7rem 1rem 1rem;
  background: rgba(0, 0, 0, .5);
  /*background: #000;*/
  background: -webkit-linear-gradient(0deg, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.5) 80%, rgba(0, 0, 0, 0) 100%);
  background: -moz-linear-gradient(0deg, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.5) 80%, rgba(0, 0, 0, 0) 100%);
  background: linear-gradient(0deg, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.5) 80%, rgba(0, 0, 0, 0) 100%);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#000000", endColorstr="#00000000", GradientType=0);

  text-align: center;

  position: fixed;
  bottom: 56px;

  width: 100%; text-align: center;
}

.lb-caption-desc {
  font-size: .82rem;
  color: rgba(255, 255, 255, .55);
  margin-top: .2rem;

  max-height: 8rem; overflow: auto;
}

.lb-btn.active {
  color: var(--lb-sky);
  background: rgba(106, 176, 216, 0.2);
}

/* Tira de miniaturas */
.lb-thumbs {
  display: flex;
  gap: 4px;
  justify-content: center;
  padding: .5rem 1rem;
  background: rgba(0, 0, 0, .6);
  overflow-x: auto;
  flex-shrink: 0;
}

.lb-thumbs::-webkit-scrollbar       { height: 3px; }
.lb-thumbs::-webkit-scrollbar-thumb { background: var(--lb-blue); }

.lb-thumb-item {
  width: 52px;
  height: 40px;
  flex-shrink: 0;
  object-fit: cover;
  opacity: .45;
  cursor: pointer;
  border: 2px solid transparent;
  transition: opacity var(--lb-transition), border-color var(--lb-transition);
}

.lb-thumb-item.lb-thumb-audio {
  background: var(--lb-steel);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--lb-sky);
  font-size: 1.1rem;
}

.lb-thumb-item:hover  { opacity: .75; }
.lb-thumb-item.active { opacity: 1; border-color: var(--lb-blue); }

/* Keyframes */
@keyframes lbSpin {
  to { transform: rotate(360deg); }
}

@keyframes lbMediaIn {
  from { opacity: 0; transform: scale(.95); }
  to   { opacity: 1; transform: scale(1); }
}


.ycrt-item-span-thumb {
  position: absolute;
  bottom: -5px;
  background-color: hsl(0deg 0% 0% / 65%);
  display: block !important;
  width: calc(100% - 8px);
  left: 4px;
  text-align: center;
  padding: 4px 4px;
  line-height: 0.95em;
  text-shadow: -1px -1px 1px #000000, 0px -1px 1px #000000, 1px -1px 1px #000000, -1px 1px 1px #000000, 0px 1px 1px #000000, 1px 1px 1px #000000, 0px 0px 2px #000000;
  color: #8acaff !important;
  letter-spacing: 0.05em !important;
}