/* Concert photographs as loose instant prints. Recorder component preserved separately. */
.gallery-section { padding-block: 80px; }
.gallery-section .section-head { margin-bottom: 60px; }
.gallery-section .section-head h2 { font-size: clamp(62px, 6.8vw, 98px); }
.gallery-section .section-head p { max-width: 340px; }
.gallery.gallery-polaroid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px 5%;
  align-items: start;
  padding: 20px 12px 10px;
}
.gallery-polaroid .polaroid-print:nth-child(n) {
  --tilt: -3.5deg;
  width: 100%;
  min-width: 0;
  justify-self: center;
  margin: 0;
}
.gallery-polaroid .polaroid-print:nth-child(6n + 2) { --tilt: 4deg; width: 74%; margin-top: 4px; }
.gallery-polaroid .polaroid-print:nth-child(6n + 3) { --tilt: -2.5deg; width: 95%; margin-top: 48px; }
.gallery-polaroid .polaroid-print:nth-child(6n + 4) { --tilt: 2.5deg; width: 95%; margin-top: 10px; }
.gallery-polaroid .polaroid-print:nth-child(6n + 5) { --tilt: -4deg; margin-top: 30px; }
.gallery-polaroid .polaroid-print:nth-child(6n) { --tilt: 3deg; width: 96%; margin-top: 4px; }
.gallery-polaroid .polaroid-print.print-portrait { width: 74%; }
.gallery-polaroid .polaroid-print.print-panorama { grid-column: span 2; width: 92%; --tilt: -2deg; }
.polaroid-print .polaroid-photo {
  position: relative;
  display: block;
  padding: clamp(9px, 1.1vw, 15px);
  background: #fff;
  color: #000;
  text-decoration: none;
  box-shadow: 0 2px 2px #0005, 0 14px 24px #0006;
  transform: rotate(var(--tilt));
  transform-origin: center;
  transition: transform .22s ease;
}
.polaroid-print .polaroid-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  background: transparent;
  transition: none;
}
.polaroid-print .polaroid-photo:hover img { opacity: 1; }
.polaroid-label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 4px 12px;
  padding: 17px 3px 9px;
  min-height: 77px;
}
.polaroid-venue { font: clamp(22px, 2.1vw, 31px)/1.05 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.polaroid-date { grid-column: 1; font: 14px/1.25 var(--body); }
.polaroid-open { grid-column: 2; grid-row: 1 / 3; align-self: center; font: 27px/1 var(--body); }
.gallery-polaroid .polaroid-print figcaption {
  max-width: none;
  margin: 25px 4px 0;
  color: #cfcfcf;
  font: 12px/1.5 var(--body);
}
.polaroid-print:focus-within { position: relative; z-index: 2; }
.polaroid-photo:focus-visible { outline: 3px solid var(--orange); outline-offset: 6px; transform: rotate(0); }
@media (hover: hover) and (pointer: fine) {
  .polaroid-photo:hover { transform: rotate(0) translateY(-4px); }
}
.gallery-section .more-photos { margin-top: 48px; padding-inline: 25px; min-height: 52px; }
.gallery-section .more-photos:hover { background: white; color: black; }

/* Quiet viewing surface with familiar photo navigation. */
.lightbox { background: white; color: black; padding: 20px; border: 0; border-radius: 0; }
.lightbox::backdrop { background: #000e; }
.lightbox .dialog-bar { gap: 18px; margin-bottom: 18px; }
.lightbox h2 { font: clamp(24px, 3vw, 34px)/1.1 var(--display); text-transform: uppercase; }
.lightbox .dialog-bar button, .lightbox .dialog-controls button {
  background: white;
  color: black;
  border: 1px solid black;
  border-radius: 0;
  min-height: 44px;
  padding: 10px 16px;
}
.lightbox .dialog-bar button { flex-shrink: 0; }
.lightbox .dialog-bar button:hover, .lightbox .dialog-controls button:hover { background: black; color: white; }
.lightbox img { max-height: 61dvh; }
.lightbox figcaption { font-size: 14px; line-height: 1.5; }
.lightbox .dialog-controls { gap: 12px; }
.lightbox .dialog-controls button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.lightbox #dialog-status { text-align: center; margin-top: 12px; color: #575757; }

@media (max-width: 960px) {
  .gallery.gallery-polaroid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 42px 8%; }
  .gallery-polaroid .polaroid-print:nth-child(n) { width: 96%; margin-top: 0; }
  .gallery-polaroid .polaroid-print:nth-child(even) { margin-top: 38px; }
  .gallery-polaroid .polaroid-print.print-portrait { width: 76%; }
  .gallery-polaroid .polaroid-print.print-panorama { width: 94%; }
  .polaroid-venue { font-size: 25px; }
}
@media (max-width: 600px) {
  .gallery-section { padding-block: 56px; }
  .gallery-section .section-head { margin-bottom: 30px; }
  .gallery-section .section-head h2 { font-size: clamp(58px, 12vw, 72px); }
  .gallery.gallery-polaroid { grid-template-columns: minmax(0, 1fr); gap: 36px; padding: 16px 7px; }
  .gallery-polaroid .polaroid-print:nth-child(n) { width: 93%; margin: 0; justify-self: start; --tilt: -2.5deg; }
  .gallery-polaroid .polaroid-print:nth-child(even) { justify-self: end; --tilt: 2.5deg; }
  .gallery-polaroid .polaroid-print.print-portrait { width: 78%; }
  .gallery-polaroid .polaroid-print.print-panorama { grid-column: auto; width: 96%; }
  .polaroid-print .polaroid-photo { padding: 10px; }
  .polaroid-label { padding: 15px 2px 7px; min-height: 72px; }
  .polaroid-venue { font-size: 26px; }
  .polaroid-date { font-size: 13px; }
  .gallery-polaroid .polaroid-print figcaption { margin-top: 20px; font-size: 12px; }
  .gallery-section .more-photos { width: 100%; margin-top: 32px; }
  .lightbox { padding: 14px; }
  .lightbox .dialog-bar button, .lightbox .dialog-controls button { font-size: 13px; padding: 10px 12px; }
  .lightbox figcaption { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .polaroid-print .polaroid-photo { transition: none; }
}

/* Keep the photograph, credit and controls inside the available screen. */
@media (max-width: 760px), (max-height: 600px) {
  .lightbox[open] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 12px;
    width: min(1200px, calc(100vw - 24px));
    height: calc(100dvh - 24px);
    max-height: calc(100dvh - 24px);
    padding: 14px;
  }
  .lightbox .dialog-bar, .lightbox .dialog-controls, .lightbox #dialog-status { margin: 0; }
  .lightbox figure { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 12px; min-height: 0; }
  .lightbox img { width: 100%; height: 100%; min-height: 0; max-height: 100%; object-fit: contain; }
  .lightbox figcaption { margin: 0; font-size: 13px; }
  .lightbox .dialog-controls { justify-content: stretch; }
  .lightbox .dialog-controls button { flex: 1; }
}
@media (max-height: 480px) and (min-width: 501px) {
  .lightbox[open] { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); }
  .lightbox .dialog-bar { grid-column: 1 / -1; }
  .lightbox figure { display: contents; }
  .lightbox img { grid-column: 1; grid-row: 2 / 5; }
  .lightbox figcaption { grid-column: 2; align-self: center; }
  .lightbox .dialog-controls, .lightbox #dialog-status { grid-column: 2; }
  .lightbox .dialog-controls { gap: 8px; }
  .lightbox .dialog-controls button { padding-inline: 8px; gap: 6px; font-size: 12px; }
}
