@font-face {
  font-family: "Wedding Serif";
  src: url("wedding-serif.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  color: #282520;
  background: #faf8f4;
}
* { box-sizing: border-box; }
body { margin: 0; }
h1 {
  margin: 0;
  font-family: "Songti SC", "Noto Serif CJK SC", SimSun, serif;
  font-size: clamp(1.75rem, 5vw, 3rem);
  line-height: 1.25;
}
p { color: #655b51; line-height: 1.65; }
.entrance {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}
.login-card {
  width: min(100%, 30rem);
  padding: clamp(1.5rem, 6vw, 3rem);
  background: #fffdfa;
  border: 1px solid #e6ddd1;
}
.login-card form { display: grid; gap: .75rem; margin-top: 2rem; }
input, button {
  font: inherit;
  min-height: 2.85rem;
  padding: .6rem .9rem;
  border: 1px solid #9a8b7b;
  border-radius: .25rem;
}
input { min-width: 0; background: white; }
button { color: white; background: #49382d; cursor: pointer; }
.error { margin: 0; color: #a22231; }
.album {
  --album-serif: "Wedding Serif", "Songti SC", "Noto Serif CJK SC", SimSun, serif;
  background: #f7f5ef;
}
.album-cover {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: end center;
  min-height: 24rem;
  padding: 2rem 1rem clamp(3rem, 11svh, 8rem);
  background: #241e19;
  color: #fffaf2;
}
.album-cover.with-photo { min-height: 100svh; }
.cover-photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 54% 40%;
}
.with-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, rgb(20 15 13 / 88%), rgb(20 15 13 / 56%) 25%, transparent 58%);
}
.cover-copy { text-align: center; }
.cover-label { margin: 0 0 .45rem; color: #fffaf2; letter-spacing: .3em; }
.cover-copy h1 {
  font-family: var(--album-serif);
  font-size: clamp(2.2rem, 5.4vw, 5.1rem);
  font-weight: 400;
  letter-spacing: .075em;
  line-height: 1.2;
}
.cover-copy h1 span { display: inline-block; white-space: nowrap; }
.cover-amp {
  margin-inline: .12em;
  color: #e4c59f;
  font-size: .73em;
  letter-spacing: 0;
}
.wedding-date {
  margin: .9rem 0 1.5rem;
  color: #fffaf2;
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
}
.wedding-date time { white-space: nowrap; }
.gallery-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: 1.4rem;
  border: 1px solid currentColor;
  color: inherit;
  letter-spacing: .1em;
  text-decoration: none;
}
.gallery-link:hover { background: rgb(255 250 242 / 16%); }
.album-cover :focus-visible { outline-color: #fffaf2; }
.collection {
  width: min(100% - clamp(2rem, 8vw, 8rem), 84rem);
  margin: 0 auto;
  padding-block: clamp(1.25rem, 4vw, 3.5rem) clamp(2rem, 6vw, 6rem);
}
.gallery {
  --gallery-gap: clamp(.55rem, 1.2vw, 1.1rem);
  columns: 3;
  column-gap: var(--gallery-gap);
}
.gallery a {
  display: block;
  break-inside: avoid;
  margin-bottom: var(--gallery-gap);
}
.gallery img { display: block; width: 100%; height: auto; }
.gallery a:hover img { filter: brightness(.92); }
.gallery.masonry { position: relative; }
.gallery.masonry a { position: absolute; margin: 0; }
.gallery.masonry img { height: 100%; object-fit: cover; object-position: center 40%; }
@media (max-width: 45rem) {
  .album-cover.with-photo {
    min-height: 0;
    height: min(94svh, 130vw);
    padding: 1rem .7rem clamp(1.7rem, 7vw, 3rem);
  }
  .cover-photo { object-position: 54% 50%; }
  .cover-copy h1 { font-size: clamp(1.65rem, 7.3vw, 3.35rem); }
  .wedding-date { margin: .55rem 0 1rem; }
  .gallery { columns: 2; }
}
body:has(.viewer[open]) { overflow: hidden; }
.viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #171513;
  color: #fffaf3;
}
.viewer-inner {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: .75rem;
  padding: .75rem clamp(.35rem, 2vw, 1.5rem) 1rem;
}
.viewer-toolbar { display: flex; align-items: center; gap: 1rem; padding-inline: .5rem; }
.viewer-toolbar span { margin-right: auto; font-variant-numeric: tabular-nums; }
.viewer-toolbar a { color: inherit; text-underline-offset: .25em; }
.viewer button {
  display: grid;
  place-items: center;
  width: clamp(2.75rem, 5vw, 3.5rem);
  height: clamp(2.75rem, 5vw, 3.5rem);
  padding: 0;
  border-radius: 50%;
  border-color: #72675c;
  background: #27221e;
  font-size: 1.9rem;
  line-height: 1;
}
.viewer button[hidden] { display: none; }
.viewer button:hover { background: #3d342d; }
.viewer :focus-visible { outline-color: #f2c99e; }
.viewer-stage {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(.35rem, 2vw, 1rem);
  min-height: 0;
}
.viewer-image { grid-column: 2; height: 100%; min-width: 0; touch-action: pan-y pinch-zoom; }
.viewer-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 36rem) {
  .viewer-stage {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .viewer-image { grid-area: 1 / 1 / 2 / 3; }
  #previous-photo { grid-area: 2 / 1; justify-self: end; }
  #next-photo { grid-area: 2 / 2; justify-self: start; }
}
:focus-visible { outline: 3px solid #8e4f36; outline-offset: 3px; }
.empty { padding: 2rem 0; text-align: center; }
