.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-link {
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  color: var(--green);
  font: 12px sans-serif;
  text-decoration: none;
  white-space: nowrap;
}

.admin-link:hover { background: #e9ecdf; }

@media (max-width: 650px) {
  .header-actions .stamp { display: none; }
}

.gallery {
  align-items: start;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gallery .photo {
  min-width: 0;
  padding: clamp(8px, 1vw, 14px);
  padding-bottom: clamp(14px, 2vw, 24px);
  transform: none;
}

.paper-frame {
  background: #ede7dc;
}

.gallery .photo.portrait {
  width: 68%;
  justify-self: center;
}

.landscape .paper-frame { aspect-ratio: 86 / 54; }
.portrait .paper-frame { aspect-ratio: 54 / 86; }

.photo:is(.landscape, .portrait) .paper-frame img {
  height: 100%;
}

.orientation {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.orientation legend { font: 11px sans-serif; color: #6a715f; margin-bottom: 8px; }
.orientation label { display: flex; align-items: center; gap: 6px; margin: 0; padding: 10px; border: 1px solid var(--line); }
.orientation label:has(:checked) { border-color: var(--green); background: #e9ecdf; }
.orientation input { width: auto; margin: 0; accent-color: var(--green); }

.photo img {
  aspect-ratio: auto;
  height: auto;
  object-fit: contain;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

.intro h1 {
  font-size: clamp(36px, 6vw, 72px);
}

.intro-copy > p:last-child {
  font: 14px/2 sans-serif;
  color: #777b6f;
}

.photo-stack {
  position: relative;
  width: min(100%, 470px);
  aspect-ratio: 1.65;
  justify-self: center;
  isolation: isolate;
  container-type: inline-size;
}

.photo-stack > span {
  position: absolute;
  display: grid;
  place-items: center;
  width: 46%;
  height: 59%;
  left: 26%;
  top: 18%;
  transform: rotate(7deg);
}

.photo-stack > span:nth-last-child(2) { left: 10%; top: 24%; transform: rotate(-16deg); }
.photo-stack > span:nth-last-child(3) { left: 47%; top: 26%; transform: rotate(16deg); }
.photo-stack > span:nth-last-child(4) { left: 16%; top: 8%; transform: rotate(-8deg); }
.photo-stack > span:nth-last-child(5) { left: 37%; top: 6%; transform: rotate(12deg); }

.photo-stack > .blank-paper {
  background: #fffcf6;
  border: 1px solid #e5dfd0;
  box-shadow: 0 8px 18px #38321c29;
}

.photo-stack img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 36cqw;
  object-fit: contain;
  padding: 6px 6px 10px;
  background: #fffcf6;
  box-shadow: 0 8px 18px #38321c29;
  border: 1px solid #e5dfd0;
}

@media (max-width: 650px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intro { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .photo-stack { width: min(100%, 330px); }
}
