/* =========================================================
   X10 Gallery (Campaign Owner) + dialog phóng to screenshot
   ========================================================= */
#gallery{width:min(980px,96vw)}
.gallery-head,.zoom-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
#galleryCaptionTitle{text-align:center;font-size:24px;font-weight:700;margin:14px 0 4px}

/* Chọn mặt */
.gallery-modes{display:flex;justify-content:center;gap:4px;margin:8px auto;max-width:360px;padding:4px;border:1px solid var(--line);border-radius:10px}
.gallery-modes button{flex:1;min-height:44px;padding:6px 12px;background:transparent;color:var(--ink);border:0}
.gallery-modes button[aria-pressed=true]{background:var(--olive-dark);color:#fff}

/* Sân khấu: nút tròn hai bên (desktop) */
.gallery-stage{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:8px}
.nav-round{width:44px;height:44px;border-radius:50%;padding:0;font-size:32px;line-height:1;background:var(--olive-dark);border-color:var(--olive-dark);color:#fff}

/* Khung cố định 7:5, ảnh contain, không crop */
.gallery-frame{position:relative;width:100%;max-width:84dvh;justify-self:center;min-width:0;overflow:hidden;border-radius:8px}
.gallery-image{aspect-ratio:7/5;width:100%;margin:0;min-height:0;touch-action:pan-y pinch-zoom}
.gallery-image.is-loaded{display:block;background:#f3e9d7}
.gallery-image img{display:block;width:100%;height:100%;object-fit:contain}

/* Chấm + counter */
#galleryDots{display:flex;justify-content:center;flex-wrap:wrap;gap:0;margin-top:6px}
#galleryDots button{width:24px;height:44px;min-height:44px;padding:0;border:0;background:transparent;display:grid;place-items:center}
#galleryDots button::after{content:'';width:7px;height:7px;border-radius:50%;background:#b6b2a5}
#galleryDots button[aria-current=true]::after{width:10px;height:10px;background:var(--olive-dark)}
#counter{text-align:center;font-size:13px;color:var(--muted)}
.gallery-head-actions{display:flex;gap:8px;flex:none}
.gallery-head-actions .btn,.gallery-head-actions button{padding:9px 14px}

/* Dialog phóng to screenshot: ảnh full width, screenshot dài thì cuộn dọc */
#zoomDialog{width:min(820px,94vw);max-height:92dvh;padding:14px;display:none;flex-direction:column}
#zoomDialog[open]{display:flex}
.zoom-body{overflow:auto;margin-top:10px;min-height:0}
.zoom-body img{display:block;width:100%;height:auto;border-radius:6px}

@media (max-width:700px){
  #gallery{width:100vw;max-width:100vw;max-height:100dvh;border-radius:0;padding:10px 10px calc(10px + env(safe-area-inset-bottom))}
  #galleryCaptionTitle{font-size:20px}
  /* Mobile: nút điều hướng dưới ảnh */
  .gallery-stage{grid-template-columns:1fr 1fr;gap:8px}
  .gallery-stage .gallery-frame{grid-column:1/-1;grid-row:1;max-width:100%}
  .gallery-stage #prev{grid-column:1;grid-row:2;justify-self:end}
  .gallery-stage #next{grid-column:2;grid-row:2;justify-self:start}
  #galleryDots button{width:22px}
  .gallery-head strong{font-size:14px;line-height:1.3}
  .gallery-head-actions .btn,.gallery-head-actions button{padding:8px 11px;font-size:14px}
}
