.gallery-section {
  background: var(--alternate-background);
  padding-block: clamp(2.5rem, 4vw, 3rem);
}
.gallery-section + .contact-section { background: var(--background); }
#gallery-map-help { margin: .65rem 0 0; font-size: 1rem; }
.gallery-map { max-width: 56rem; margin: 0 auto; }
.gallery-stage { height: clamp(20rem, 42vw, 33rem); }
#gallery-globe { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#gallery-globe:active { cursor: grabbing; }
#gallery-globe:focus-visible { outline-offset: -4px; }
.gallery-sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.map-foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .5rem; }
.map-key, .map-source { font: 400 .8rem/1.4 var(--sans); }
.map-key { grid-column: 1; }
.map-key::before {
  content: ''; display: inline-block; width: .65rem; height: .65rem; margin-right: .4rem;
  background: #ad8e9f; border-radius: 50%;
}
.map-source { grid-column: 3; justify-self: end; text-underline-offset: .2em; }
.map-controls {
  grid-column: 2; display: flex; overflow: hidden; border: 1px solid var(--rule); border-radius: 3px;
  background: rgb(255 255 255 / 25%);
}
.gallery-section button, .gallery-section input { font-family: var(--sans); color: var(--text); }
.gallery-section button { cursor: pointer; }
.gallery-section button:disabled { cursor: default; opacity: .45; }
.map-controls button {
  min-width: 2.75rem; min-height: 2.75rem; border: 0;
  background: transparent; font-size: 1.2rem;
}
.map-controls button + button { border-left: 1px solid var(--rule); }
.map-controls button:last-child { padding-inline: .78rem; font-size: .85rem; }
.map-controls button:hover:enabled { background: #eee8ef; }
.map-controls button:focus-visible { outline-offset: -4px; }
.gallery-section dialog {
  max-height: 90vh; border: 1px solid var(--rule); border-radius: 4px; background: var(--background);
  color: var(--text); box-shadow: 0 16px 52px rgb(57 48 61 / 14%);
}
.gallery-section dialog::backdrop { background: rgb(49 41 52 / 42%); }
#region-album { width: min(32rem, calc(100% - 2rem)); padding: clamp(1.2rem, 3vw, 2rem); }
.album-header { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
#album-country { margin: 0 0 .2rem; font-size: .9rem; }
#album-name { font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.2; }
#album-status { margin: .85rem 0 0; }
#album-cities:not(:empty) { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
#album-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-top: 1rem; }
#album-photos:empty { display: none; }
#album-photos button { padding: 0; border: 0; background: transparent; }
#album-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; border-radius: 2px; }
#gallery-editor { display: grid; gap: .85rem; border-top: 1px solid var(--rule); margin-top: 1.25rem; padding-top: 1rem; }
#gallery-editor[hidden] { display: none; }
#gallery-editor h4 { margin: 0; font: 500 1.2rem/1.4 var(--serif); }
#gallery-editor label { display: grid; gap: .3rem; font-size: .9rem; }
#gallery-editor input {
  width: 100%; min-width: 0; padding: .55rem .7rem; border: 1px solid var(--rule);
  border-radius: 3px; background: #faf8fa; font-size: 1rem;
}
.editor-actions, .photo-controls { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.gallery-section dialog button { border: 1px solid var(--rule); border-radius: 3px; background: #faf8fb; padding: .45rem .75rem; }
#editor-status { margin: 0; font-size: .92rem; }
#editor-status:empty { display: none; }
#gallery-viewer { max-width: min(92vw, 60rem); padding: 1rem; }
#gallery-viewer::backdrop { background: rgb(44 38 47 / 76%); }
.photo-controls { font-size: .9rem; }
#photo-close { margin-left: auto; }
#gallery-viewer figure { margin: .8rem 0 0; }
#photo-full { display: block; max-width: 100%; max-height: 72vh; margin-inline: auto; object-fit: contain; }
#photo-caption:not(:empty) { padding-top: .5rem; }
@media (max-width: 580px) {
  .site-header nav { width: 100%; justify-content: space-between; column-gap: .3rem; }
  .gallery-stage { height: clamp(17rem, 84vw, 26rem); }
  .map-foot { grid-template-columns: auto 1fr; row-gap: .6rem; }
  .map-controls { grid-column: 1 / -1; grid-row: 1; justify-self: center; }
  .map-key, .map-source { grid-row: 2; }
  .map-source { grid-column: 2; }
}
