/* A short photographic preview; the complete collection lives in its own dialog. */
.gallery-dialog [hidden], .gallery-showcase [hidden] { display: none !important; }
#app .gallery-showcase {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.gallery-showcase-track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  outline-offset: 6px;
}
.gallery-showcase-track[data-preview-count="1"] { grid-template-columns: 1fr; max-width: 700px; }
.gallery-showcase-track[data-preview-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery-showcase-track[data-preview-count="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gallery-tile {
  display: block;
  position: relative;
  padding: 0;
  border: 0;
  border-radius: 15px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  min-width: 0;
  background: #eae5dc;
  cursor: zoom-in;
  isolation: isolate;
}
.gallery-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .7s cubic-bezier(.22, 1, .36, 1), filter .5s ease;
}
.gallery-tile:hover img { transform: scale(1.045); filter: saturate(1.05); }
.gallery-tile:focus-visible { outline: 3px solid #b74c1c; outline-offset: 5px; }
.gallery-showcase-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  margin-top: 8px;
}
.gallery-showcase-all {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 7px 0;
  background: transparent;
  border: 0;
  color: #173c72;
  font-size: 14px;
  font-weight: 650;
}
.gallery-showcase-all svg { width: 17px; height: 17px; }
.gallery-showcase-all:hover { color: #ab4212; }
.gallery-total {
  display: inline-grid;
  place-items: center;
  min-width: 25px;
  height: 25px;
  padding-inline: 7px;
  margin-left: 1px;
  background: #ede9e2;
  border-radius: 50px;
  font-size: 11px;
  color: #596579;
}
.gallery-showcase-pause {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #d9dce0;
  border-radius: 50%;
  background: transparent;
  color: #173c72;
}
.gallery-showcase-pause svg { width: 17px; height: 17px; }
.gallery-showcase-pause:hover { background: #eceff3; }

.gallery-dialog {
  --gallery-tone-a: 49 57 64;
  --gallery-tone-b: 62 52 43;
  --gallery-tone-c: 29 36 46;
  width: min(1280px, calc(100vw - 48px));
  height: min(940px, calc(100dvh - 48px));
  max-width: none;
  max-height: none;
  padding: 0;
  margin: auto;
  overflow: hidden;
  border: 1px solid #ffffff1a;
  border-radius: 22px;
  color: #fff;
  background: radial-gradient(ellipse at 8% 12%, rgb(var(--gallery-tone-a) / .95), transparent 70%), radial-gradient(ellipse at 100% 100%, rgb(var(--gallery-tone-b) / .9), transparent 75%), rgb(var(--gallery-tone-c));
  box-shadow: 0 32px 100px #0007;
}
.gallery-dialog::backdrop {
  background: radial-gradient(ellipse at 10% 10%, rgb(var(--gallery-tone-a) / .88), transparent 75%), radial-gradient(ellipse at 90% 95%, rgb(var(--gallery-tone-b) / .85), transparent 75%), #0c111be8;
  backdrop-filter: blur(15px);
}
.gallery-dialog[data-view="all"] { background: #faf8f4; color: #142b59; border-color: #e4e1da; }
.gallery-dialog-shell { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.gallery-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 23px 28px 20px;
  flex: 0 0 auto;
}
.gallery-dialog-header h2 { font-size: 21px; line-height: 1.25; letter-spacing: -.035em; }
.gallery-dialog-count { display: block; font-size: 12px; color: #ffffffa8; margin-top: 5px; font-variant-numeric: tabular-nums; }
.gallery-dialog[data-view="all"] .gallery-dialog-count { color: #627087; }
.gallery-dialog-tools { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.gallery-dialog-close, .gallery-dialog-arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #fff;
  border: 1px solid #ffffff26;
  border-radius: 50%;
  background: #ffffff0d;
}
.gallery-dialog-close:hover, .gallery-dialog-arrow:hover { background: #ffffff22; }
.gallery-dialog-close svg, .gallery-dialog-arrow svg { width: 20px; height: 20px; }
.gallery-dialog[data-view="all"] .gallery-dialog-close { color: #173c72; border-color: #d9dce0; background: transparent; }
.gallery-dialog[data-view="all"] .gallery-dialog-close:hover { background: #edf0f4; }
.gallery-dialog-all { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; border: 0; padding: 7px; color: #fff; background: transparent; font-size: 13px; }
.gallery-dialog-all svg { width: 17px; height: 17px; }
.gallery-dialog-all:hover { color: #ffd3b2; }
.gallery-all-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 18px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 28px 28px;
}
.gallery-grid-photo {
  display: block;
  aspect-ratio: 4 / 3;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: #e9e4db;
  cursor: zoom-in;
}
.gallery-grid-photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.22, 1, .36, 1); }
.gallery-grid-photo:hover img { transform: scale(1.035); }
.gallery-grid-photo:focus-visible { outline: 3px solid #b74c1c; outline-offset: -5px; }
.gallery-photo-view { flex: 1 1 auto; min-height: 0; padding: 0 22px 25px; }
.gallery-photo-layout { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 18px; height: 100%; min-height: 0; }
.gallery-zoom-figure { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; min-height: 0; }
.gallery-large-stage { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 0; flex: 0 1 auto; touch-action: pan-y pinch-zoom; }
.gallery-large-photo { display: block; width: auto; height: auto; max-width: 100%; max-height: var(--gallery-image-max-height, min(740px, calc(100dvh - 220px))); object-fit: contain; border-radius: 8px; }
.gallery-photo-caption { flex: 0 0 auto; width: 100%; max-width: 720px; margin-top: 18px; padding-inline: 12px; color: #f3f0eb; text-align: center; font-size: 16px; line-height: 1.5; font-weight: 450; }
.gallery-dialog button:focus-visible { outline: 3px solid #f2b487; outline-offset: 4px; }

@media (max-width: 900px) {
  .gallery-showcase-track { gap: 15px; }
  .gallery-dialog-header { padding: 20px 22px; }
  .gallery-dialog-header h2 { font-size: 19px; }
  .gallery-all-grid { gap: 14px; padding-inline: 22px; }
  .gallery-photo-layout { gap: 12px; }
}
@media (max-width: 720px) {
  .gallery-showcase-track, .gallery-showcase-track[data-preview-count] {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    border-radius: 12px;
  }
  .gallery-showcase-track::-webkit-scrollbar { display: none; }
  .gallery-tile { flex: 0 0 66%; scroll-snap-align: start; scroll-snap-stop: always; border-radius: 12px; }
  .gallery-showcase-track[data-preview-count="1"] .gallery-tile { flex-basis: 100%; }
  .gallery-showcase-footer { margin-top: 7px; min-height: 58px; }
  .gallery-showcase-all { font-size: 13px; }
  .gallery-dialog { width: 100vw; height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .gallery-dialog-header { padding: max(15px, env(safe-area-inset-top)) 17px 18px; gap: 12px; }
  .gallery-dialog-header h2 { font-size: 17px; }
  .gallery-dialog-tools { gap: 5px; }
  .gallery-dialog-all { width: 44px; justify-content: center; padding: 0; }
  .gallery-dialog-all span { display: none; }
  .gallery-all-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; padding: 0 17px max(22px, env(safe-area-inset-bottom)); }
  .gallery-grid-photo { border-radius: 9px; }
  .gallery-photo-view { padding: 0 12px max(16px, env(safe-area-inset-bottom)); }
  .gallery-photo-layout { grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr) 44px; gap: 19px 12px; }
  .gallery-zoom-figure { grid-column: 1 / -1; grid-row: 1; }
  .gallery-dialog-previous { grid-column: 1; grid-row: 2; justify-self: end; }
  .gallery-dialog-next { grid-column: 2; grid-row: 2; justify-self: start; }
  .gallery-photo-caption { font-size: 15px; margin-top: 16px; padding-inline: 10px; }
  .gallery-large-photo { border-radius: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-tile img, .gallery-grid-photo img { transition: none; }
  .gallery-tile:hover img, .gallery-grid-photo:hover img { transform: none; filter: none; }
}
