/* Cairo Sax Gallery Player 2.23.0 — reproductor adaptativo por proporción */
html.gallery-player-lock,
html.gallery-player-lock body{overflow:hidden !important}

#gallery-modal.gallery-player-open{
  position:fixed !important;
  inset:0 !important;
  z-index:2147483000 !important;
  display:grid !important;
  place-items:center !important;
  padding:clamp(12px,2.5vw,30px) !important;
  background:rgba(0,0,0,.93) !important;
  backdrop-filter:blur(8px);
}
#gallery-modal.gallery-player-open[hidden]{display:none !important}
#gallery-modal.gallery-player-open .modal-media{
  position:relative !important;
  width:min(1180px,94vw) !important;
  max-width:94vw !important;
  max-height:90vh !important;
  margin:0 !important;
  display:grid !important;
  place-items:center !important;
}
#gallery-modal .gallery-social-player[hidden]{display:none !important}
#gallery-modal .gallery-social-player{
  width:100%;
  max-width:100%;
  display:grid;
  justify-items:center;
  align-items:center;
  gap:9px;
}
#gallery-modal .gallery-social-stage{
  position:relative;
  overflow:hidden;
  border-radius:14px;
  border:1px solid rgba(216,160,58,.62);
  background:#000;
  box-shadow:0 30px 100px rgba(0,0,0,.78),0 0 30px rgba(216,160,58,.10);
  transition:width .22s ease,height .22s ease,aspect-ratio .22s ease;
}

/* 16:9 — YouTube normal y videos horizontales */
#gallery-modal .gallery-social-player--landscape .gallery-social-stage{
  width:min(1120px,92vw,calc(78vh * 16 / 9));
  aspect-ratio:16/9;
}

/* 9:16 — TikTok, Shorts y Reels */
#gallery-modal .gallery-social-player--portrait .gallery-social-stage{
  width:min(430px,84vw,calc(78vh * 9 / 16));
  aspect-ratio:9/16;
}

/* 1:1 — publicaciones compactas de Instagram */
#gallery-modal .gallery-social-player--square .gallery-social-stage{
  width:min(680px,86vw,76vh);
  aspect-ratio:1/1;
}

/* Los Reels de Facebook deben sentirse como video, no como una tarjeta alta vacía. */
#gallery-modal .gallery-social-player--facebook.gallery-social-player--portrait .gallery-social-stage{
  width:min(440px,84vw,calc(76vh * 9 / 16));
}

#gallery-modal .gallery-social-frame{
  position:absolute;
  inset:0;
  display:block;
  width:100%;
  height:100%;
  border:0;
  background:#000;
}
#gallery-modal .gallery-social-loading{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  padding:18px;
  text-align:center;
  color:#f3c66e;
  font-weight:700;
  letter-spacing:.04em;
  background:radial-gradient(circle at center,rgba(216,160,58,.08),rgba(0,0,0,.98) 68%);
}
#gallery-modal .gallery-social-fallback{
  width:min(560px,92vw);
  padding:20px;
  border:1px solid rgba(216,160,58,.35);
  border-radius:12px;
  background:#05101a;
  color:#d8e0e8;
  text-align:center;
}
#gallery-modal .gallery-social-fallback[hidden]{display:none !important}
#gallery-modal .gallery-social-external,
#gallery-modal .gallery-social-source{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:38px;
  padding:8px 15px;
  border:1px solid rgba(216,160,58,.55);
  border-radius:8px;
  color:#f2bb50;
  text-decoration:none;
  font-weight:700;
  background:rgba(3,10,17,.86);
}
#gallery-modal .gallery-social-source{font-size:12px;opacity:.88}
#gallery-modal.gallery-player-open .modal-close{
  position:fixed !important;
  top:18px !important;
  right:22px !important;
  z-index:2147483001 !important;
  display:grid !important;
  place-items:center !important;
  width:46px !important;
  height:46px !important;
  padding:0 !important;
  border:1px solid rgba(216,160,58,.72) !important;
  border-radius:50% !important;
  background:rgba(3,10,17,.96) !important;
  color:#fff !important;
  font:400 30px/1 Arial,sans-serif !important;
  cursor:pointer !important;
  box-shadow:0 8px 28px rgba(0,0,0,.42) !important;
}
#gallery-modal.gallery-player-open .modal-close:hover{
  border-color:#f0b84b !important;
  box-shadow:0 0 22px rgba(216,160,58,.24) !important;
}
.gallery-card{cursor:pointer !important}
.gallery-card .gallery-play{pointer-events:none}

@media (max-width:700px){
  #gallery-modal.gallery-player-open{padding:8px !important}
  #gallery-modal.gallery-player-open .modal-media{width:96vw !important;max-width:96vw !important}
  #gallery-modal .gallery-social-stage{border-radius:10px}
  #gallery-modal .gallery-social-player--landscape .gallery-social-stage{
    width:min(96vw,calc(72vh * 16 / 9));
  }
  #gallery-modal .gallery-social-player--portrait .gallery-social-stage{
    width:min(88vw,calc(78vh * 9 / 16));
  }
  #gallery-modal .gallery-social-player--square .gallery-social-stage{
    width:min(90vw,72vh);
  }
  #gallery-modal.gallery-player-open .modal-close{
    top:9px !important;
    right:9px !important;
    width:42px !important;
    height:42px !important;
  }
}

@media (max-height:640px) and (orientation:landscape){
  #gallery-modal .gallery-social-player--portrait .gallery-social-stage{
    width:min(330px,calc(72vh * 9 / 16));
  }
  #gallery-modal .gallery-social-player--landscape .gallery-social-stage{
    width:min(86vw,calc(72vh * 16 / 9));
  }
  #gallery-modal .gallery-social-player--square .gallery-social-stage{
    width:min(70vh,70vw);
  }
}

/* Cairo Sax V2.23 — Facebook: respetar el lienzo real del Embedded Video Player */
#gallery-modal .gallery-social-player--facebook[data-content-kind="reel"] .gallery-social-stage{
  width:min(940px,92vw,calc(78vh * 16 / 9)) !important;
  aspect-ratio:16/9 !important;
}
@media (max-width:700px){
  #gallery-modal .gallery-social-player--facebook[data-content-kind="reel"] .gallery-social-stage{
    width:min(96vw,calc(72vh * 16 / 9)) !important;
    aspect-ratio:16/9 !important;
  }
}
