.gallery-page [hidden] {
  display: none !important;
}
.gallery-page {
  --gallery-paper: #f2eee6;
  --gallery-ink: #151512;
  --gallery-red: #ee2028;
  background: var(--gallery-paper);
  color: var(--gallery-ink);
}
.gallery-page .photo-lead,
.gallery-page .photo-collection {
  width: min(1330px, 90%);
  margin-inline: auto;
}
.gallery-page .photo-lead {
  display: grid;
  align-items: stretch;
  grid-template-columns: 0.86fr 1.14fr;
  gap: clamp(30px, 6vw, 100px);
  padding: clamp(38px, 6vw, 92px) 0;
}
.archive-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.gallery-page .archive-kicker,
.gallery-page .viewer-edition {
  font:
    700 0.85rem/1.4 "Barlow Condensed",
    "Arial Narrow",
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin: 0 0 1rem;
}
.archive-kicker span {
  color: #b71820;
  padding: 0 0.4em;
}
.gallery-page .archive-intro h1 {
  font:
    italic 900 clamp(5.2rem, 9.5vw, 9.8rem) / 0.81 "Barlow Condensed",
    Impact,
    sans-serif;
  letter-spacing: -0.035em;
  margin: 0;
}
.archive-intro h1 span {
  color: var(--gallery-red);
}
.gallery-page .archive-intro > p:last-child {
  font-size: clamp(1.08rem, 1.45vw, 1.35rem);
  line-height: 1.45;
  max-width: 36ch;
  margin: 1.5rem 0 0;
}
.archive-feature {
  min-width: 0;
  overflow: hidden;
  margin: 0;
  position: relative;
  background: #24241f;
}
.archive-feature img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1.55;
  object-fit: cover;
  display: block;
}
.archive-feature figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  max-width: 95%;
  padding: 0.6em 1em;
  color: white;
  background: #171714;
  font-size: 0.875rem;
  font-weight: 600;
}
.gallery-page .photo-collection {
  padding-bottom: clamp(50px, 7vw, 100px);
  border-top: 3px solid var(--gallery-ink);
}
.collection-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 2rem 1.5rem;
}
.gallery-page .collection-head h2 {
  font:
    900 clamp(2.45rem, 5vw, 4.2rem) / 0.98 "Barlow Condensed",
    Impact,
    sans-serif;
  margin: 0;
  letter-spacing: -0.025em;
  scroll-margin-top: 6rem;
}
.gallery-page .collection-head p {
  margin: 0.6rem 0 0;
  font-size: 1rem;
  color: #4f4b45;
}
.photo-search {
  min-width: min(100%, 18rem);
}
.gallery-page .photo-search label,
.frame-tags form label {
  display: block;
  margin-bottom: 0.42rem;
  font-size: 0.92rem;
  font-weight: 600;
}
.photo-search-box {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  border: 1px solid #827d75;
  background: #faf8f4;
  padding-inline: 0.85rem;
}
.photo-search-box:focus-within {
  outline: 2px solid #ad1720;
  outline-offset: 2px;
}
.search-symbol {
  width: 0.88rem;
  height: 0.88rem;
  border: 2px solid currentColor;
  border-radius: 50%;
  position: relative;
  flex: none;
}
.search-symbol::after {
  content: "";
  position: absolute;
  width: 0.42rem;
  height: 2px;
  background: currentColor;
  bottom: -0.18rem;
  right: -0.32rem;
  transform: rotate(45deg);
}
.gallery-page .photo-search-box input {
  width: 100%;
  min-width: 0;
  height: 46px;
  border: none;
  outline: 0;
  background: transparent;
  color: var(--gallery-ink);
  font: inherit;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.4rem 1rem;
}
.gallery-page .photo-tile {
  display: block;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--gallery-ink);
  font: inherit;
  text-align: left;
  cursor: zoom-in;
}
.photo-tile img {
  display: block;
  aspect-ratio: 1.46;
  width: 100%;
  object-fit: cover;
  background: #cecac4;
}
.photo-tile:focus-visible {
  outline: 3px solid #b71921;
  outline-offset: 4px;
}
.photo-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.5rem;
  padding: 0.57rem 0;
  border-bottom: 1px solid #b5b0a7;
}
.photo-caption span:first-child {
  font:
    700 1rem/1.25 "Barlow Condensed",
    sans-serif;
  text-transform: uppercase;
}
.photo-caption span:last-child {
  color: #56514b;
  font-size: 0.87rem;
  line-height: 1.4;
}
.photo-tile:hover .photo-caption span:first-child {
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}
.archive-controls,
#gallery-pages {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.archive-controls {
  justify-content: space-between;
  padding-top: 1.6rem;
}
.archive-controls button,
.archive-controls select,
.viewer-actions a,
.viewer-actions button,
.frame-tags form button {
  border: 1px solid #8b857b;
  background: transparent;
  color: inherit;
  padding: 0.62rem 0.86rem;
  font-family: inherit;
  font-size: 0.96rem;
  line-height: 1.25;
  font-weight: 600;
  min-height: 44px;
  cursor: pointer;
}
.archive-controls button:disabled,
.viewer-actions button:disabled {
  opacity: 0.45;
  cursor: default;
}
.archive-controls a,
.archive-source a,
.text-button,
#tag-archive-link a {
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}
.archive-controls a,
.archive-source a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.archive-source {
  margin: 0.75rem 0 0;
}
.archive-controls select {
  appearance: none;
  border-radius: 0;
  padding-right: 1.8rem;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    right 0.75rem center,
    right 0.49rem center;
  background-size: 0.28rem 0.28rem;
  background-repeat: no-repeat;
}
.text-button {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0.5rem 0;
}
.no-matches {
  padding: 2rem 0;
}
.visually-hidden-gallery {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.gallery-page.viewer-active {
  overflow: hidden;
}
#photo-dialog {
  box-sizing: border-box;
  margin: 0;
  color: #f2eee6;
  border: 0;
  width: 100vw;
  max-width: none;
  height: 100%;
  max-height: none;
  background: #10100f;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#photo-dialog::backdrop {
  background: #10100f;
}
.viewer-layout {
  width: min(1300px, 94%);
  margin: 0 auto;
  padding: 1.1rem 0;
}
.viewer-top,
.viewer-actions,
.frame-nav,
.frame-files {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.viewer-top,
.viewer-actions {
  justify-content: space-between;
}
.gallery-page .viewer-top {
  margin-bottom: 0.75rem;
}
.gallery-page .viewer-edition {
  margin: 0 0 0.3rem;
  color: #dccec2;
  font-size: 0.76rem;
}
.gallery-page .viewer-top h2 {
  font:
    900 clamp(1.7rem, 3vw, 2.6rem) / 1 "Barlow Condensed",
    Impact,
    sans-serif;
  text-transform: uppercase;
  margin: 0;
}
.viewer-close {
  color: inherit;
  border: 1px solid #8b857b;
  background: transparent;
  min-width: 46px;
  height: 46px;
  font: 400 2rem/1 sans-serif;
  cursor: pointer;
}
.frame-stage {
  position: relative;
  display: grid;
  place-items: center;
  height: clamp(230px, 58vh, 780px);
  height: clamp(230px, 58dvh, 780px);
  background: #080808;
  touch-action: pan-y pinch-zoom;
}
.frame-stage img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  object-fit: contain;
}
#frame-loading:not(:empty) {
  position: absolute;
  margin: 0;
  bottom: 0.5rem;
  left: 0.5rem;
  background: #191917;
  padding: 0.3rem 0.55rem;
  color: white;
  font-size: 0.85rem;
}
.viewer-actions {
  padding: 0.75rem 0;
  border-bottom: 1px solid #595853;
}
.viewer-actions a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.viewer-actions a:focus-visible,
.viewer-actions button:focus-visible,
#photo-dialog button:focus-visible,
#photo-dialog input:focus-visible,
#photo-dialog a:focus-visible {
  outline: 3px solid #ffd15c;
  outline-offset: 2px;
}
#frame-counter {
  min-width: 4rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.gallery-page .frame-tags h3 {
  font-size: 1.05rem;
  margin: 0.8rem 0 0.4rem;
}
#name-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-size: 0.95rem;
}
.person-tag {
  padding: 0.25rem 0.48rem;
  background: #363530;
  display: inline-flex;
  align-items: center;
}
.person-tag button {
  border: 0;
  padding: 0.2rem;
  min-width: 44px;
  min-height: 44px;
  font: inherit;
  font-weight: 700;
  color: inherit;
  background: transparent;
  cursor: pointer;
}
.frame-tags form {
  margin-top: 0.65rem;
}
.frame-tags form > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.frame-tags form input {
  font: inherit;
  color: #101010;
  background: #f2eee6;
  width: min(16rem, 100%);
  min-height: 44px;
  padding: 0.4rem;
}
#tag-archive-link,
#tag-status {
  margin: 0.6rem 0;
  font-size: 0.95rem;
}
@media (max-width: 850px) {
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 650px) {
  .gallery-page .photo-lead {
    grid-template-columns: 1fr;
    gap: 1.45rem;
    padding-block: 2rem 1.6rem;
  }
  .gallery-page .archive-intro h1 {
    font-size: clamp(4rem, 14vw, 6.2rem);
  }
  .archive-intro h1 br {
    display: none;
  }
  .gallery-page .archive-intro > p:last-child {
    margin-top: 0.9rem;
    max-width: 100%;
  }
  .archive-feature img {
    aspect-ratio: 2.3;
  }
  .collection-head {
    align-items: stretch;
    flex-direction: column;
  }
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 0.6rem;
  }
  .photo-caption {
    display: block;
  }
  .photo-caption span {
    display: block;
  }
  .archive-controls {
    align-items: start;
    flex-direction: column;
  }
  .archive-controls button,
  .archive-controls select {
    font-size: 0.875rem;
    padding-inline: 0.58rem;
  }
  .archive-controls select {
    padding-right: 1.6rem;
  }
  .viewer-layout {
    width: 92%;
  }
  .viewer-actions {
    align-items: start;
  }
  .frame-stage {
    height: 45vh;
    height: 45dvh;
  }
}
@media (max-width: 360px) {
  #gallery-pages {
    gap: 0.25rem;
  }
  .archive-controls button,
  .archive-controls select {
    padding-inline: 0.35rem;
  }
  .archive-controls select {
    padding-right: 1.4rem;
  }
}
