/* ===== Fit Screen image gallery popup ===== */
.ccc-gallery-overlay{
  position:fixed;
  inset:0;
  z-index:2450;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(0,0,0,.68);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}
.ccc-gallery-overlay.open{ display:flex; }
.ccc-gallery-modal{
  width:min(94vw, 920px);
  max-height:min(90vh, 900px);
  max-height:min(90dvh, 900px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.14);
  background:linear-gradient(180deg, rgba(21,23,26,.96) 0%, rgba(16,17,20,.98) 100%);
  box-shadow:0 24px 70px rgba(0,0,0,.58);
}
.ccc-gallery-toolbar{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border-bottom:1px solid var(--border);
}
.ccc-gallery-rotate,
.ccc-gallery-close{
  border:none;
  background:transparent;
  color:var(--text);
  box-shadow:none;
}
.ccc-gallery-rotate.is-active{
  color:#fff;
  opacity:1;
}
.ccc-gallery-rotate.is-active .material-symbols-outlined{
  font-variation-settings:'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}
.ccc-gallery-rotate:disabled{
  opacity:.35;
  cursor:not-allowed;
  color:var(--muted);
}
.ccc-gallery-stage-wrap{
  flex:1 1 auto;
  min-height:0;
  padding:14px 14px 8px;
  display:grid;
  place-items:center;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}
.ccc-gallery-stage{
  width:100%;
  min-height:260px;
  max-height:min(66vh, 620px);
  max-height:min(66dvh, 620px);
  display:grid;
  place-items:center;
  overflow:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  background:rgba(255,255,255,.025);
  border:1px solid rgba(255,255,255,.08);
}
.ccc-gallery-stage img{
  max-width:100%;
  max-height:min(64vh, 600px);
  max-height:min(64dvh, 600px);
  width:auto;
  height:auto;
  object-fit:contain;
  display:block;
  transform-origin:center center;
  transform:translate3d(0,0,0) rotate(0deg) scale(1);
  transition:transform 420ms cubic-bezier(.22,.8,.2,1);
  will-change:transform;
  backface-visibility:hidden;
  -webkit-backface-visibility:hidden;
}
.ccc-gallery-thumbs{
  flex:0 0 auto;
  display:flex;
  justify-content:center;
  align-items:center;
  gap:8px;
  padding:10px 12px 14px;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  border-top:1px solid var(--border);
}
.ccc-gallery-thumb{
  flex:0 0 auto;
  width:56px;
  height:72px;
  padding:2px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.035);
  color:var(--text);
  cursor:pointer;
}
.ccc-gallery-thumb:hover,
.ccc-gallery-thumb[aria-selected="true"]{
  border-color:rgba(255,255,255,.62);
  background:rgba(255,255,255,.10);
}
.ccc-gallery-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
@media (max-width:780px){
  .ccc-gallery-overlay{ padding:10px; }
  .ccc-gallery-modal{ width:100%; max-height:min(92vh, 920px); max-height:min(92dvh, 920px); }
  .ccc-gallery-stage{ min-height:220px; max-height:min(60vh, 520px); max-height:min(60dvh, 520px); }
  .ccc-gallery-stage img{ max-height:min(58vh, 500px); max-height:min(58dvh, 500px); }
  .ccc-gallery-thumb{ width:52px; height:68px; }
}
