/* ==========================================================================
   image_zoom – large view of a picture (T335; formerly profile_zoom, reference
   "Profilbild · Großansicht"): dark glass layer, picture in its own aspect
   ratio as large as the window allows, optional title / description /
   actions, round close control top right. Variant image_zoom_round: the
   circular profile picture.
   T530: image_zoom_gallery – several pictures: round arrows left and right
   (image_zoom_nav, _nav_prev / _nav_next), "Bild n von m" (image_zoom_counter).
   ========================================================================== */
.image_zoom {
  position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px;
  background: rgba(16, 49, 78, .85); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: q-fade 150ms var(--ease-out);
}
.image_zoom_close {
  position: absolute; top: 22px; right: 22px; z-index: 1; width: 40px; height: 40px; border: 2px solid var(--q-white); border-radius: 50%; cursor: pointer;
  background: var(--q-white); color: var(--q-highlight-2); display: flex; align-items: center; justify-content: center; transition: background var(--dur-base) ease, color var(--dur-base) ease;
}
.image_zoom_close::before { content: ""; width: 14px; height: 14px; background: currentColor; -webkit-mask: url("../../assets/icons/close_dark.svg") center / 14px no-repeat; mask: url("../../assets/icons/close_dark.svg") center / 14px no-repeat; }
.image_zoom_close:hover { background: transparent; color: var(--q-white); }
.image_zoom_close:focus-visible { outline: 2px solid var(--q-highlight-1); outline-offset: 2px; }
.image_zoom_picture {
  flex: 0 1 auto; display: block; min-height: 0; width: auto; height: auto; max-width: min(1400px, 100%); max-height: calc(100vh - 180px); max-height: calc(100dvh - 180px);
  object-fit: contain; border-radius: var(--radius-lg); background: var(--q-highlight-4); box-shadow: 0 0 6px 6px rgba(0, 0, 0, .2); animation: q-in 200ms var(--ease-out);
}
.image_zoom_body { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; max-width: 720px; }
.image_zoom_title { font-family: var(--font-display); font-size: var(--fs-21); font-weight: 600; color: var(--q-white); }
.image_zoom_description { font-size: var(--fs-13); color: var(--q-highlight-1); text-wrap: pretty; }
.image_zoom_controls { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.image_zoom_title[hidden] { display: none; }
/* T530: gallery – arrows at the sides (as ✕), the count below the title */
.image_zoom_counter { font-size: var(--fs-13); color: var(--q-highlight-1); }
.image_zoom_nav {
  position: absolute; top: 50%; z-index: 1; width: 44px; height: 44px; margin-top: -22px; border: 2px solid var(--q-white); border-radius: 50%; cursor: pointer;
  background: var(--q-white); color: var(--q-highlight-2); display: flex; align-items: center; justify-content: center; transition: background var(--dur-base) ease, color var(--dur-base) ease;
}
.image_zoom_nav_prev { left: 22px; }
.image_zoom_nav_next { right: 22px; }
.image_zoom_nav::before { content: ""; width: 18px; height: 18px; background: currentColor; -webkit-mask: url("../../assets/icons/triangle_right_dark.svg") center / 18px no-repeat; mask: url("../../assets/icons/triangle_right_dark.svg") center / 18px no-repeat; }
.image_zoom_nav_prev::before { -webkit-mask-image: url("../../assets/icons/triangle_left_dark.svg"); mask-image: url("../../assets/icons/triangle_left_dark.svg"); }
.image_zoom_nav:hover { background: transparent; color: var(--q-white); }
.image_zoom_nav:focus-visible { outline: 2px solid var(--q-highlight-1); outline-offset: 2px; }
.image_zoom_gallery .image_zoom_picture { max-width: min(1400px, calc(100% - 132px)); }

/* T468: swipe down closes (viewer/swipe_surface.js, as in the viewer T370) – no panning of the page, two fingers still zoom;
   while pulled the layer, its blur, ✕, caption and actions fade with --image-zoom-dismiss (0 … 1) */
.image_zoom_swipeable { touch-action: pinch-zoom; overscroll-behavior: contain; }
.image_zoom_swipeable .image_zoom_picture { cursor: grab; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.image_zoom_dragging, .image_zoom_dragging * { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.image_zoom_dismissing {
  background: rgba(16, 49, 78, calc(.85 * (1 - var(--image-zoom-dismiss, 0) * .9)));
  -webkit-backdrop-filter: blur(calc(10px * (1 - var(--image-zoom-dismiss, 0)))); backdrop-filter: blur(calc(10px * (1 - var(--image-zoom-dismiss, 0))));
}
.image_zoom_dismissing > :not(.image_zoom_picture) { opacity: calc(1 - var(--image-zoom-dismiss, 0) * 2.5); transition: none; }

/* round: the profile picture */
.image_zoom_round .image_zoom_picture { flex: none; width: min(440px, 70vmin, calc(100vh - 220px)); height: auto; max-height: none; aspect-ratio: 1; border-radius: 50%; object-fit: cover; background: var(--q-highlight-2); }

@media (max-width: 719px) {
  .image_zoom { padding: 16px; gap: 16px; }
  .image_zoom_close { top: 14px; right: 14px; }
  /* T530: on small screens the arrows sit at the bottom corners – the picture keeps the width, swiping is the main way */
  .image_zoom_nav { top: auto; bottom: 14px; margin-top: 0; width: 40px; height: 40px; }
  .image_zoom_nav_prev { left: 14px; }
  .image_zoom_nav_next { right: 14px; }
  .image_zoom_gallery .image_zoom_picture { max-width: 100%; }
  .image_zoom:not(.image_zoom_round) .image_zoom_picture { border-radius: var(--radius-md); max-height: calc(100dvh - 160px); }
  .image_zoom_title { font-size: var(--fs-18); }
}
@media (prefers-reduced-motion: reduce) { .image_zoom, .image_zoom_picture { animation: none; } }
