/* Local, presentation-only styles for client/legacyGallery.bundle.mjs. */
.image-gallery-backdrop,
.legacy-gallery-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgb(6 20 39 / .82);
  overscroll-behavior: contain;
}

.image-gallery,
.legacy-image-gallery {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1020px, 100%);
  max-height: min(94vh, 880px);
  overflow: hidden;
  border: 1px solid #b6c6db;
  border-radius: 14px;
  background: #fff;
  color: #172b49;
  box-shadow: 0 24px 70px rgb(1 16 38 / .58);
}

.legacy-gallery-header,
.legacy-gallery-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  background: #fff;
}

.legacy-gallery-header {
  border-bottom: 1px solid #dbe4ef;
}

.legacy-gallery-header b,
.legacy-gallery-header small {
  display: block;
}

.legacy-gallery-header b {
  font-size: 15px;
}

.legacy-gallery-header small {
  margin-top: 3px;
  color: #60738c;
  font-size: 12px;
}

.legacy-gallery-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #edf3fa;
  color: #183f72;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

.legacy-gallery-close:hover {
  background: #dcecff;
  color: #0e55af;
}

.legacy-gallery-main {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  min-height: 250px;
  overflow: hidden;
  background: #0c1e38;
}

.legacy-gallery-main figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
}

.legacy-gallery-main figure img {
  display: block;
  width: 100%;
  min-width: 0;
  height: min(66vh, 640px);
  max-height: 100%;
  object-fit: contain;
  background: #0c1e38;
}

.legacy-gallery-main figcaption {
  padding: 8px 12px;
  overflow: hidden;
  background: #142a49;
  color: #e6effc;
  font-size: 12px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legacy-gallery-nav {
  border: 0;
  background: #ffffff12;
  color: #fff;
  font-size: 37px;
  cursor: pointer;
  transition: background .15s ease;
}

.legacy-gallery-nav:hover:not(:disabled) {
  background: #ffffff29;
}

.legacy-gallery-nav:disabled {
  cursor: default;
  opacity: .3;
}

.legacy-gallery-footer {
  align-items: flex-end;
  flex-wrap: wrap;
  border-top: 1px solid #dbe4ef;
}

.legacy-gallery-thumbs {
  display: flex;
  flex: 1 1 260px;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding: 1px;
}

.legacy-gallery-thumbs button {
  display: grid;
  grid-template-columns: 40px minmax(46px, 1fr);
  flex: 0 0 132px;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  border: 1px solid #cbd8e7;
  border-radius: 7px;
  padding: 3px;
  background: #fff;
  color: #34506f;
  text-align: left;
  cursor: pointer;
}

.legacy-gallery-thumbs button.active,
.legacy-gallery-thumbs button[aria-current="true"] {
  border-color: #1768d8;
  box-shadow: 0 0 0 2px #1768d822;
}

.legacy-gallery-thumbs img {
  width: 40px;
  height: 34px;
  border-radius: 4px;
  object-fit: cover;
  background: #edf3f9;
}

.legacy-gallery-thumbs span {
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legacy-gallery-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.legacy-gallery-actions button {
  border: 1px solid #1768d8;
  border-radius: 7px;
  padding: 8px 10px;
  background: #1768d8;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.legacy-gallery-actions button[data-gallery-close] {
  background: #fff;
  color: #1559b2;
}

.legacy-gallery-actions button:hover:not(:disabled) {
  filter: brightness(.96);
}

.legacy-gallery-actions button:disabled {
  cursor: wait;
  opacity: .65;
}

@media (max-width: 560px) {
  .image-gallery-backdrop,
  .legacy-gallery-backdrop { padding: 0; }
  .image-gallery,
  .legacy-image-gallery { width: 100%; height: 100%; max-height: 100%; border: 0; border-radius: 0; }
  .legacy-gallery-main { grid-template-columns: 38px minmax(0, 1fr) 38px; }
  .legacy-gallery-main figure img { height: min(70vh, 590px); }
  .legacy-gallery-footer { align-items: stretch; padding: 10px; }
  .legacy-gallery-thumbs { flex-basis: 100%; }
  .legacy-gallery-actions { width: 100%; }
  .legacy-gallery-actions button { flex: 1; }
}
