:root {
  --cream: #f3efe6;
  --paper: #fbf8f1;
  --stone: #5c5148;
  --ink: #3b332c;
  --gold: #d39f42;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "freight-big-pro", "Playfair Display", Georgia, serif;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--ink);
}

main {
  flex: 1 0 auto;
  padding-top: 129px;
  background: var(--cream);
}

@media (max-width: 1284px) {
  main {
    padding-top: 97px;
  }
}

h1,
p {
  margin: 0;
}

/* locks page scroll while a photo is open */
html.is-locked {
  overflow: hidden;
}

/* ---------- Hero ---------- */
.AlbumHero {
  position: relative;
  overflow: hidden;
  padding: 72px 24px 120px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(211, 159, 66, 0.1), transparent 60%),
    var(--cream);
}

.AlbumHero_kicker {
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.78rem;
  color: var(--stone);
}

.AlbumHero h1 {
  font-weight: 300;
  font-size: clamp(2.2rem, 4.4vw, 3.3rem);
  line-height: 1.1;
  color: var(--ink);
}

.AlbumHero h1 em {
  display: block;
  font-family: "Parisienne", cursive;
  font-style: normal;
  font-size: 1.2em;
  color: var(--stone);
}

.AlbumHero_lead {
  max-width: 520px;
  margin: 22px auto 0;
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--stone);
}

.AlbumHero_flower {
  position: absolute;
  top: 40px;
  width: 170px;
  height: 190px;
  object-fit: cover;
  mix-blend-mode: multiply;
  opacity: 0.55;
  pointer-events: none;
}

.AlbumHero_flower--left {
  left: max(16px, calc(50% - 520px));
  transform: scaleX(-1) rotate(-12deg);
}

.AlbumHero_flower--right {
  right: max(16px, calc(50% - 520px));
  transform: rotate(-12deg);
}

/* torn paper edge into the board below */
.AlbumHero_tear {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 70px;
  background-color: #ebe4d6;
  -webkit-mask-image: url(../images/ripped-bg-3.png);
  mask-image: url(../images/ripped-bg-3.png);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-position: center bottom;
  mask-position: center bottom;
}

/* ---------- Mural (linen board, same as the notes wall) ---------- */
.Mural {
  padding: 56px min(6vw, 80px) 104px;
  background-color: #ebe4d6;
  background-image:
    radial-gradient(rgba(92, 81, 72, 0.08) 1px, transparent 1px),
    radial-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1px);
  background-size: 18px 18px, 18px 18px;
  background-position: 0 0, 9px 9px;
}

.Mural_list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 1240px;
  columns: 4 220px;
  column-gap: 30px;
}

.Mural_empty {
  padding: 48px 24px;
  text-align: center;
  font-family: "Parisienne", cursive;
  font-size: 1.8rem;
  color: var(--stone);
}

/* ---------- Photos as taped polaroids ---------- */
.Polaroid {
  --tilt: -1.4deg;
  position: relative;
  display: inline-block;
  width: 100%;
  margin: 14px 0 34px;
  padding: 10px;
  break-inside: avoid;
  background: #fff;
  border-radius: 3px;
  box-shadow:
    0 1px 2px rgba(60, 45, 30, 0.1),
    0 14px 28px rgba(60, 45, 30, 0.16);
  transform: rotate(var(--tilt));
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.Polaroid::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  z-index: 1;
  width: 84px;
  height: 24px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(233, 214, 170, 0.8);
  box-shadow: 0 1px 2px rgba(60, 45, 30, 0.14);
}

.Polaroid:nth-child(even)::before {
  transform: translateX(-50%) rotate(4deg);
}

.Polaroid:nth-child(5n + 1) { --tilt: -1.4deg; }
.Polaroid:nth-child(5n + 2) { --tilt: 1.2deg; }
.Polaroid:nth-child(5n + 3) { --tilt: -0.7deg; }
.Polaroid:nth-child(5n + 4) { --tilt: 1.7deg; }
.Polaroid:nth-child(5n + 5) { --tilt: -1.9deg; }

.Polaroid:hover {
  z-index: 2;
  transform: rotate(0deg) translateY(-6px) scale(1.02);
  box-shadow:
    0 2px 4px rgba(60, 45, 30, 0.1),
    0 22px 40px rgba(60, 45, 30, 0.22);
}

.Polaroid_btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #eee;
  cursor: zoom-in;
  line-height: 0;
}

.Polaroid_btn:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.Polaroid_btn img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- Photo viewer ---------- */
.Lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 64px;
  background: rgba(30, 22, 15, 0.93);
}

.Lightbox.is-open {
  display: flex;
}

.Lightbox_figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 100%;
}

.Lightbox_figure img {
  display: block;
  max-width: min(92vw, 1000px);
  max-height: calc(100vh - 110px);
  width: auto;
  height: auto;
  border-radius: 3px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  background: #222;
}

.Lightbox_count {
  letter-spacing: 0.25em;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
}

.Lightbox_btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0 0 4px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 30px;
  line-height: 1;
  color: #fff;
  transition: background 0.2s, border-color 0.2s;
}

.Lightbox_btn:hover,
.Lightbox_btn:focus-visible {
  background: rgba(211, 159, 66, 0.55);
  border-color: #e9c770;
}

.Lightbox_close {
  top: 16px;
  right: 16px;
}

.Lightbox_prev {
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.Lightbox_next {
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

/* ---------- Tablet & phone ---------- */
@media (max-width: 900px) {
  .AlbumHero {
    padding: 56px 24px 100px;
  }

  .AlbumHero_flower {
    top: 12px;
    width: 96px;
    height: 108px;
    opacity: 0.4;
  }

  .Mural {
    padding: 44px 22px 80px;
  }

  .Mural_list {
    columns: 3 180px;
    column-gap: 22px;
  }
}

@media (max-width: 600px) {
  .Mural {
    padding: 38px 16px 72px;
  }

  .Mural_list {
    columns: 2;
    column-gap: 16px;
  }

  .Polaroid {
    padding: 7px;
    margin: 12px 0 26px;
  }

  .Polaroid::before {
    width: 60px;
    height: 18px;
    top: -9px;
  }

  .Lightbox {
    padding: 56px 8px 24px;
  }

  .Lightbox_figure img {
    max-width: 96vw;
    max-height: calc(100vh - 150px);
  }

  .Lightbox_btn {
    width: 42px;
    height: 42px;
  }

  .Lightbox_prev {
    left: 6px;
    top: auto;
    bottom: 16px;
    transform: none;
  }

  .Lightbox_next {
    right: 6px;
    top: auto;
    bottom: 16px;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .Polaroid {
    transition: none;
  }
}
