/* Gallery page — builds on styles.css */
.g-head {
  text-align: center; padding: 56px 24px 40px; position: relative;
  background:
    radial-gradient(ellipse 70% 80% at 50% 30%, #fffaf1 0%, transparent 70%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  border-bottom: 1px solid var(--line);
}
.g-back {
  position: absolute; top: 22px; left: 24px; font-family: var(--sans); font-size: 13px;
  color: var(--muted); text-decoration: none; letter-spacing: .04em;
}
.g-back:hover { color: var(--ink); }
.g-head .eyebrow { margin: 18px 0 14px; }
.g-name {
  font-family: var(--serif-display); font-weight: 300; font-size: clamp(36px, 6vw, 60px);
  line-height: 1.08; margin: 0 0 12px;
}
.g-sub { max-width: 520px; margin: 0 auto 28px; }

/* upload panel */
.g-upload { padding: 50px 24px 10px; }
.g-upload .share-card { max-width: 720px; margin: 0 auto; }
.g-upload form { margin-top: 26px; }
.g-drop {
  display: grid; place-items: center; min-height: 110px; border: 1px dashed var(--gold-soft); border-radius: 6px;
  cursor: pointer; margin: 0 0 14px; transition: background .2s; position: relative;
}
.g-drop:hover, .g-drop.over { background: rgba(167,129,74,.07); }
.g-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.g-drop-prompt { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-family: var(--sans); font-size: 14px; letter-spacing: .04em; }
.g-drop-prompt em { color: var(--muted); font-style: normal; }
.g-drop-prompt svg { width: 22px; height: 22px; fill: none; stroke: var(--gold); stroke-width: 1.4; }

.g-picked { list-style: none; padding: 0; margin: 0 0 22px; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.g-picked:empty { display: none; }
.g-picked li { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--paper-2); }
.g-picked img { width: 100%; height: 100%; object-fit: cover; }
.g-picked button {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0;
  background: rgba(42,36,32,.75); color: #fff; font-size: 15px; line-height: 1; cursor: pointer;
}
.g-picked li.done::after, .g-picked li.failed::after {
  content: "✓"; position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(79,107,70,.55); color: #fff; font-size: 28px;
}
.g-picked li.failed::after { content: "!"; background: rgba(155,61,44,.6); }
.g-picked li.busy { opacity: .55; }

.g-form-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* memory wall — scattered polaroids */
.g-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.g-main { max-width: 1280px; margin: 0 auto; padding: 50px 24px 120px; }
.g-count { margin: 0 0 30px; font-family: var(--sans); letter-spacing: .08em; }
.g-grid {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start;
  gap: 34px 30px; padding: 10px 0;
}
.g-item {
  --rot: 0deg; --dy: 0px;
  width: var(--w, 250px); margin: var(--dy) 0 0; padding: 12px 12px 0;
  background: #fffdf8; cursor: zoom-in; position: relative;
  box-shadow: 0 1px 2px rgba(60,40,20,.12), 0 14px 30px -14px rgba(60,40,20,.38);
  transform: rotate(var(--rot));
  transition: transform .45s cubic-bezier(.2,.8,.3,1.2), box-shadow .45s ease;
  animation: drop-in .7s cubic-bezier(.2,.8,.3,1.1) backwards;
}
.g-item:hover, .g-item:focus-visible {
  transform: rotate(0deg) scale(1.05) translateY(-6px); z-index: 2; outline: none;
  box-shadow: 0 2px 4px rgba(60,40,20,.12), 0 30px 50px -18px rgba(60,40,20,.5);
}
/* a strip of washi tape on some photos */
.g-item.taped::before {
  content: ""; position: absolute; top: -11px; left: 50%; width: 86px; height: 24px;
  transform: translateX(-50%) rotate(calc(var(--rot) * -1.6));
  background: rgba(201,169,119,.42); box-shadow: 0 1px 2px rgba(60,40,20,.1);
}
.g-item img { width: 100%; max-height: 340px; object-fit: cover; background: var(--paper-2); filter: saturate(.92) contrast(1.02); }
.g-item figcaption {
  font-family: "Caveat", cursive; font-size: 22px; line-height: 1.15; color: #3d342e;
  text-align: center; padding: 10px 4px 14px; min-height: 52px;
}
.g-item figcaption small { display: block; font-size: 17px; color: var(--muted); margin-top: 2px; }
@keyframes drop-in {
  from { opacity: 0; transform: translateY(-24px) rotate(calc(var(--rot) * 3)) scale(1.04); }
  to { opacity: 1; transform: rotate(var(--rot)); }
}

/* slideshow */
.g-lightbox.playing figure img { animation: kenburns 6s ease-out both; }
.g-lightbox.playing figure { animation: fade 1s ease both; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.06); } }
.g-pause {
  position: absolute; top: 26px; left: 28px; background: none; border: 1px solid rgba(243,234,219,.4);
  color: #f3eadb; border-radius: 999px; padding: 8px 16px; font-size: 13px; cursor: pointer; font-family: var(--sans); letter-spacing: .1em;
}
.g-pause:hover { border-color: #f3eadb; }

/* lightbox */
.g-lightbox figure { margin: 0; display: grid; justify-items: center; gap: 14px; max-width: 100%; }
.g-lightbox figure img { max-height: 82vh; }
.g-lightbox figcaption { color: #e9dfcd; font-family: var(--sans); font-size: 14px; text-align: center; max-width: 640px; }
.g-lightbox figcaption b { font-weight: 500; }
.g-nav {
  position: absolute; top: 50%; transform: translateY(-50%); background: none; border: 0;
  color: #f3eadb; font-size: 56px; cursor: pointer; padding: 10px 18px; line-height: 1; opacity: .7;
}
.g-nav:hover { opacity: 1; }
.g-prev { left: 8px; }
.g-next { right: 8px; }

@media (max-width: 640px) {
  .g-back { position: static; display: inline-block; }
  .g-grid { gap: 22px 14px; }
  .g-item { --w: calc(50% - 10px) !important; padding: 7px 7px 0; }
  .g-item figcaption { font-size: 17px; min-height: 40px; padding: 6px 2px 9px; }
  .g-item figcaption small { font-size: 14px; }
  .g-item.taped::before { width: 56px; height: 18px; top: -8px; }
  .g-nav { font-size: 40px; padding: 6px 10px; }
}
