.photographs-page,
.empty-album-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.photographs-page .site-footer,
.empty-album-page .site-footer {
  display: none;
}

.photographs-main {
  --album-row-gap: clamp(12px, 3vh, 36px);
  --album-caption-space: 28px;
  height: calc(100vh - var(--header-height));
  height: calc(100dvh - var(--header-height));
  padding-block: clamp(16px, 3vh, 40px);
  container-type: size;
  position: relative;
  --album-border: #000;
}

:root[data-theme=dark] .photographs-main {
  --album-border: var(--ink);
}

.photographs-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.photographs-viewport {
  height: 100%;
  overflow: hidden;
}

.photographs-track {
  display: flex;
  height: 100%;
  transition: transform 550ms cubic-bezier(.22,.61,.36,1);
}

.photographs-grid {
  flex: 0 0 100%;
  min-width: 0;
  height: 100%;
  padding-inline: calc(48px + min(3vw, 60px));
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: var(--album-row-gap) clamp(8px, 2vw, 40px);
  align-items: center;
  justify-items: center;
}

.photograph-album {
  /* A shorter cover leaves more room around each of the four rows. */
  width: min(100%, max(0px, calc((100cqh - 3 * var(--album-row-gap) - 4 * var(--album-caption-space)) / 4 * 1.5 * .85)));
  min-width: 0;
  display: block;
  text-align: center;
}

.album-cover {
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: transparent;
  border: 1px solid var(--album-border);
}

.album-page-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.album-page-button[hidden] {
  display: none;
}

.album-page-button svg {
  width: 24px;
  height: 24px;
}

.album-page-button:hover {
  opacity: .55;
}

.album-page-previous {
  left: 0;
}

.album-page-next {
  right: 0;
}

.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.album-label {
  margin-top: 8px;
  color: var(--muted);
  font: 400 16px/20px var(--sans);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photograph-album:hover .album-label,
.photograph-album:focus-visible .album-label {
  color: var(--ink);
}

.empty-album-page main {
  height: calc(100vh - var(--header-height));
  height: calc(100dvh - var(--header-height));
}

.album-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.album-empty h1 {
  font: 400 32px/1.4 var(--sans);
}

.album-empty p {
  color: var(--muted);
}

.album-empty .text-link {
  margin-top: 12px;
}

.album-viewer-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.album-viewer-page .site-footer {
  display: none;
}

.album-viewer-main {
  height: calc(100vh - var(--header-height));
  height: calc(100dvh - var(--header-height));
  padding-block: clamp(12px, 2vh, 24px);
}

.album-viewer {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  gap: clamp(12px, 2vh, 24px);
}

.album-photo-stage {
  --shot-time-height: 0px;
  position: relative;
  flex: 1;
  min-height: 0;
}

.album-photo-stage.has-shot-time {
  --shot-time-height: 36px;
}

.album-main-photo {
  display: block;
  width: 100%;
  height: calc(100% - var(--shot-time-height));
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.album-main-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.album-main-photo:focus,
.album-main-photo:focus-visible {
  outline: none;
  box-shadow: none;
}

.album-shot-time {
  position: absolute;
  margin: 0;
  color: var(--muted);
  font-family: "SFMono-Regular", "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-weight: 300;
  line-height: 1.25;
  letter-spacing: .16em;
  white-space: nowrap;
  text-align: right;
  pointer-events: none;
}

.album-shot-time[hidden] {
  display: none;
}

.album-slideshow .site-header,
.album-slideshow .album-photo-strip {
  visibility: hidden;
}

.album-slideshow .album-photo-stage {
  position: fixed;
  inset: 0;
  z-index: 100;
  width: 100%;
  height: 100%;
  background: #000;
}

.album-slideshow .album-shot-time {
  color: rgba(255, 255, 255, .92);
}

.album-photo-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--paper);
  color: var(--muted);
}

.album-photo-error[hidden] {
  display: none;
}

.album-photo-strip {
  --thumb-width: clamp(64px, 10vw, 112px);
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: center;
  width: min(100%, 740px);
  margin-inline: auto;
  flex: none;
}

.album-thumb-viewport {
  min-width: 0;
  overflow: hidden;
  padding-block: 4px;
}

.album-thumb-track {
  display: flex;
  gap: 12px;
  width: max-content;
  transition: transform 450ms cubic-bezier(.22, .61, .36, 1);
}

.album-thumb {
  display: block;
  flex: 0 0 var(--thumb-width);
  width: var(--thumb-width);
  aspect-ratio: 16 / 9;
  padding: 3px;
  border: 1px solid transparent;
  background: transparent;
  opacity: .7;
}

.album-thumb[aria-pressed=true] {
  border-color: var(--ink);
  opacity: 1;
}

.album-thumb:hover {
  opacity: 1;
}

.album-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.album-thumb:focus-visible {
  outline-offset: 1px;
}

.album-photo-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.album-photo-arrow[hidden] {
  display: flex;
  visibility: hidden;
}

.album-photo-arrow svg {
  width: 24px;
  height: 24px;
}

.album-photo-arrow:hover {
  opacity: .55;
}

@media (max-width: 480px) {
  .album-photo-strip {
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    gap: 8px;
  }
  .album-thumb-track {
    gap: 10px;
  }
  .album-photo-arrow {
    width: 32px;
    padding: 5px;
  }
}


@media (max-width: 480px) {
  .photographs-grid {
    padding-inline: 38px;
    column-gap: 8px;
  }
  .album-page-button {
    width: 32px;
    padding: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .photographs-track,
  .album-thumb-track {
    transition: none;
  }
}

.album-original-download { position:absolute; right:0; bottom:0; padding:6px 0 6px 12px; color:var(--muted); font-size:12px; background:var(--paper); z-index:2; }
.album-original-download:hover { color:var(--ink); }
.album-original-download[hidden],.album-slideshow .album-original-download { display:none; }
