
/* Step121 — user blog galleries + full lightbox. */

.blog-simple-field--gallery{
  margin-top:18px;
  padding:16px;
  border:1px solid #e5e7eb;
  border-radius:16px;
  background:#fafafa;
}
.blog-simple-field--gallery > label{
  display:block;
  margin-bottom:8px;
  font-weight:700;
}
.blog-simple-field--gallery > label span,
.blog-gallery-help{
  color:#6b7280;
  font-weight:400;
}
.blog-simple-field--gallery input[type="file"]{
  width:100%;
  max-width:100%;
}
.blog-gallery-help{
  display:block;
  margin-top:7px;
  font-size:13px;
  line-height:1.45;
}
.blog-gallery-editor-list,
.blog-gallery-new-preview{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(132px,1fr));
  gap:10px;
  margin-top:14px;
}
.blog-gallery-editor-item,
.blog-gallery-new-preview__item{
  min-width:0;
  overflow:hidden;
  border:1px solid #e1e5ea;
  border-radius:13px;
  background:#fff;
}
.blog-gallery-editor-item.is-delete{
  opacity:.42;
}
.blog-gallery-editor-item.is-dragging{
  opacity:.45;
  outline:2px dashed #64748b;
}
.blog-gallery-editor-item img,
.blog-gallery-new-preview__item img{
  display:block;
  width:100%;
  aspect-ratio:4/3;
  object-fit:cover;
  background:#eef0f2;
}
.blog-gallery-editor-item__tools{
  display:grid;
  grid-template-columns:34px 34px minmax(0,1fr);
  gap:5px;
  align-items:center;
  padding:7px;
}
.blog-gallery-editor-item__tools button{
  width:34px;
  height:32px;
  border:1px solid #d9dee5;
  border-radius:9px;
  background:#fff;
  cursor:pointer;
}
.blog-gallery-delete{
  display:flex !important;
  align-items:center;
  justify-content:flex-end;
  gap:5px;
  margin:0 !important;
  color:#6b7280;
  font-size:12px;
  white-space:nowrap;
}
.blog-gallery-new-preview__item small{
  display:block;
  overflow:hidden;
  padding:7px 8px;
  color:#667085;
  font-size:11px;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* Gallery in the published post. */
.blog-post-gallery{
  width:100%;
  margin:22px 0 26px;
}
.blog-post-gallery__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:0 0 10px;
  color:#475467;
  font-size:14px;
}
.blog-post-gallery__head strong{
  color:#111827;
  font-size:16px;
}
.blog-post-gallery__grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.blog-post-gallery__item{
  min-width:0;
  margin:0;
}
.blog-post-gallery__open{
  display:block;
  width:100%;
  padding:0;
  overflow:hidden;
  border:0;
  border-radius:12px;
  background:#eef1f4;
  cursor:zoom-in;
}
.blog-post-gallery__open img{
  display:block;
  width:100%;
  aspect-ratio:4/3;
  object-fit:cover;
  transition:transform .16s ease;
}
.blog-post-gallery__open:hover img{ transform:scale(1.015); }
.blog-post-gallery__item figcaption{
  margin-top:6px;
  color:#667085;
  font-size:13px;
  line-height:1.4;
}
.blog-detail-cover[data-blog-lightbox]{
  cursor:zoom-in;
}

/* Pro blog lightbox */
body.has-blog-gallery-lightbox{ overflow:hidden !important; }
.blog-gallery-lightbox[hidden]{ display:none !important; }
.blog-gallery-lightbox{
  position:fixed;
  inset:0;
  z-index:100500;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto auto;
  width:100vw;
  height:100dvh;
  background:rgba(3,7,18,.97);
  color:#fff;
  touch-action:none;
}
.blog-gallery-lightbox__backdrop{
  position:absolute;
  inset:0;
  z-index:0;
}
.blog-gallery-lightbox__topbar,
.blog-gallery-lightbox__stage,
.blog-gallery-lightbox__caption,
.blog-gallery-lightbox__thumbs{
  position:relative;
  z-index:1;
}
.blog-gallery-lightbox__topbar{
  min-height:58px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:8px max(12px,env(safe-area-inset-right)) 8px max(12px,env(safe-area-inset-left));
  background:rgba(3,7,18,.72);
  backdrop-filter:blur(16px);
}
.blog-gallery-lightbox__counter{
  color:#e5e7eb;
  font-size:14px;
  font-variant-numeric:tabular-nums;
}
.blog-gallery-lightbox__tools{
  display:flex;
  align-items:center;
  gap:5px;
}
.blog-gallery-lightbox__tools button{
  min-width:40px;
  height:40px;
  padding:0 8px;
  border:1px solid rgba(255,255,255,.13);
  border-radius:11px;
  background:rgba(255,255,255,.08);
  color:#fff;
  font:inherit;
  cursor:pointer;
}
.blog-gallery-lightbox__tools button:hover{ background:rgba(255,255,255,.15); }
.blog-gallery-lightbox__tools [data-blog-lb-reset]{
  min-width:58px;
  font-size:12px;
}
.blog-gallery-lightbox__tools .blog-gallery-lightbox__close{
  width:42px;
  min-width:42px;
  border-radius:50%;
  font-size:29px;
  line-height:1;
}
.blog-gallery-lightbox__stage{
  min-height:0;
  display:grid;
  place-items:center;
  overflow:hidden;
  touch-action:none;
}
.blog-gallery-lightbox__figure{
  width:100%;
  height:100%;
  display:grid;
  place-items:center;
  margin:0;
  overflow:hidden;
}
.blog-gallery-lightbox__image{
  max-width:calc(100vw - 118px);
  max-height:calc(100dvh - 188px);
  object-fit:contain;
  border-radius:8px;
  box-shadow:0 20px 70px rgba(0,0,0,.35);
  transform-origin:center center;
  will-change:transform;
  user-select:none;
  -webkit-user-drag:none;
  cursor:zoom-in;
}
.blog-gallery-lightbox__nav{
  position:absolute;
  top:50%;
  z-index:3;
  width:52px;
  height:74px;
  transform:translateY(-50%);
  border:1px solid rgba(255,255,255,.13);
  border-radius:17px;
  background:rgba(17,24,39,.55);
  color:#fff;
  font-size:42px;
  backdrop-filter:blur(12px);
  cursor:pointer;
}
.blog-gallery-lightbox__nav--prev{ left:18px; }
.blog-gallery-lightbox__nav--next{ right:18px; }
.blog-gallery-lightbox__caption{
  min-height:42px;
  padding:7px 16px 8px;
  text-align:center;
  background:rgba(3,7,18,.67);
}
.blog-gallery-lightbox__caption strong{
  display:block;
  overflow:hidden;
  font-size:13px;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.blog-gallery-lightbox__caption span{
  display:block;
  margin-top:2px;
  color:#b9c0ca;
  font-size:12px;
}
.blog-gallery-lightbox__thumbs{
  min-height:72px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  overflow-x:auto;
  padding:6px 12px max(8px,env(safe-area-inset-bottom));
  background:rgba(3,7,18,.74);
  scrollbar-width:none;
  touch-action:pan-x;
}
.blog-gallery-lightbox__thumbs::-webkit-scrollbar{ display:none; }
.blog-gallery-lightbox__thumbs button{
  flex:0 0 auto;
  width:56px;
  height:54px;
  padding:2px;
  overflow:hidden;
  border:2px solid transparent;
  border-radius:9px;
  background:rgba(255,255,255,.08);
  opacity:.55;
  cursor:pointer;
}
.blog-gallery-lightbox__thumbs button.is-active{
  border-color:#fff;
  opacity:1;
}
.blog-gallery-lightbox__thumbs img{
  display:block;
  width:100%;
  height:100%;
  border-radius:5px;
  object-fit:cover;
}
.blog-gallery-lightbox__hint{
  position:absolute;
  left:50%;
  bottom:78px;
  z-index:2;
  transform:translateX(-50%);
  padding:4px 8px;
  border-radius:999px;
  background:rgba(0,0,0,.35);
  color:#9ca3af;
  font-size:10px;
  pointer-events:none;
}

@media(max-width:760px){
  .blog-simple-field--gallery{ padding:13px; border-radius:14px; }
  .blog-gallery-editor-list,.blog-gallery-new-preview{grid-template-columns:repeat(2,minmax(0,1fr));}
  .blog-post-gallery__grid{ gap:5px; }
  .blog-post-gallery__open{ border-radius:8px; }
  .blog-gallery-lightbox__topbar{ min-height:54px; }
  .blog-gallery-lightbox__tools [data-blog-lb-zoom-out],
  .blog-gallery-lightbox__tools [data-blog-lb-zoom-in],
  .blog-gallery-lightbox__tools [data-blog-lb-fullscreen],
  .blog-gallery-lightbox__tools [data-blog-lb-rotate]{ display:none; }
  .blog-gallery-lightbox__image{
    max-width:100vw;
    max-height:calc(100dvh - 166px);
    border-radius:0;
    box-shadow:none;
  }
  .blog-gallery-lightbox__nav{ display:none; }
  .blog-gallery-lightbox__caption{ min-height:38px; padding:5px 12px; }
  .blog-gallery-lightbox__thumbs{ min-height:64px; justify-content:flex-start; }
  .blog-gallery-lightbox__thumbs button{ width:48px; height:48px; }
  .blog-gallery-lightbox__hint{ display:none; }
}
