/* Public memorial page */

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 72px var(--gutter) 56px;
}
.hero__floral {
  position: absolute;
  width: clamp(110px, 24vw, 280px);
  height: auto;
  pointer-events: none;
  z-index: 0;
}
.hero__floral--tl { top: 0; left: 0; }
.hero__floral--tr { top: 0; right: 0; }
.hero__floral--bl { bottom: 0; left: 0; }
.hero__floral--br { bottom: 0; right: 0; }

.hero__inner { position: relative; z-index: 1; max-width: 820px; margin: 0 auto; }

.hero__eyebrow {
  font-size: clamp(1.1rem, 4vw, 1.6rem);
  letter-spacing: 0.3em;
  margin-bottom: 28px;
}

.portrait {
  width: clamp(200px, 55vw, 300px);
  aspect-ratio: 1;
  margin: 0 auto 32px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--lavender-tint);
  box-shadow: 0 6px 24px rgba(63, 91, 130, 0.18);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }

.hero__name {
  font-size: clamp(2.2rem, 9vw, 4.2rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink);
  font-weight: 500;
}
.hero__dates {
  margin: 18px 0 26px;
  font-size: clamp(0.72rem, 2.6vw, 1rem);
  letter-spacing: 0.28em;
}
.hero__tagline { max-width: 28em; margin: 0 auto; font-size: 1.25rem; }

/* ---------- Divider ---------- */
.divider { display: block; width: min(320px, 70%); height: 24px; margin: 0 auto; color: var(--copper); }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section__title {
  text-align: center;
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  color: var(--ink);
  margin-bottom: 8px;
}
.section__lead { text-align: center; margin: 0 auto 32px; max-width: 34em; }

/* ---------- Service details ---------- */
.services { display: grid; gap: 20px; margin-top: 28px; }
.service {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 28px 24px;
  text-align: center;
}
.service__label { margin-bottom: 10px; display: block; }
.service__when { font-size: 1.4rem; color: var(--copper); margin: 0 0 6px; line-height: 1.3; }
.service__place { margin: 0 0 16px; }
.service__note { font-style: italic; margin: 0 0 16px; }
.service .btn { margin-top: 4px; }

@media (min-width: 720px) {
  .services { grid-template-columns: 1fr 1fr; }
}

/* ---------- Obituary ---------- */
.story { max-width: 40em; margin: 0 auto; }
.story p { margin: 0 0 1.1em; }
.placeholder { text-align: center; font-style: italic; color: #7d7d85; }

/* ---------- Gallery (static placeholder for Phase 1) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 28px; }
.chip {
  font-family: var(--font-label);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.7em 1.2em;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--lavender-tint); border-color: var(--lavender); color: var(--slate-blue); }

.gallery { column-count: 2; column-gap: 12px; }
@media (min-width: 720px) { .gallery { column-count: 3; } }
@media (min-width: 1000px) { .gallery { column-count: 4; } }
.gallery__item {
  break-inside: avoid;
  margin: 0 0 12px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--lavender-tint), #dfe7f1);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--lavender);
  font-family: var(--font-label);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.gallery__item:nth-child(3n+1) { aspect-ratio: 3 / 4; }
.gallery__item:nth-child(3n+2) { aspect-ratio: 1; }
.gallery__item:nth-child(3n)   { aspect-ratio: 4 / 3; }
.gallery-note { text-align: center; margin-top: 20px; }

/* ---------- Tributes ---------- */
.tributes { display: grid; gap: 16px; }
@media (min-width: 720px) { .tributes { grid-template-columns: 1fr 1fr; } }
.tribute {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--lavender);
  border-radius: 4px;
  padding: 20px 22px;
}
.tribute__msg { margin: 0 0 12px; font-style: italic; }
.tribute__by { margin: 0; }

/* ---------- Share a memory form ---------- */
.form {
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 28px 24px;
  display: grid;
  gap: 18px;
}
.field { display: grid; gap: 6px; }
.field label { font-family: var(--font-label); font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--copper); }
.field input[type="text"],
.field textarea {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
}
.field textarea { min-height: 130px; resize: vertical; }
.field input[type="file"] { font-family: var(--font-label); font-size: 0.85rem; }
.field small { color: #7d7d85; font-size: 0.9rem; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 48px var(--gutter) 64px; }
.footer p { margin: 14px 0 0; font-style: italic; }

/* =====================================================================
   Phase 3-7 additions
   ===================================================================== */
.center { text-align: center; margin-top: 20px; }
.small { font-size: 0.95rem; color: #7d7d85; margin: 0; }
.extras { margin-top: 24px; text-align: center; }
.extras p { margin: 12px 0 0; white-space: pre-line; }

/* Gallery (real photos) */
.gallery__item { padding: 0; display: block; width: 100%; overflow: hidden; cursor: zoom-in; font: inherit; }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery__item:hover img { opacity: 0.92; }

/* Tributes */
.tribute__by { margin: 0; line-height: 1.5; }
.tribute__date { display: block; margin-top: 4px; font-family: var(--font-label); font-size: 0.7rem; letter-spacing: 0.15em; color: #9a9aa2; text-transform: uppercase; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; background: #14141c; }
.lightbox[hidden] { display: none; }
.lightbox__stage { position: relative; flex: 1; min-height: 0; padding: 56px 12px 0; touch-action: pan-y; }
.lightbox__img { width: 100%; height: 100%; background-repeat: no-repeat; background-position: center; background-size: contain; }
img.lightbox__img { object-fit: contain; }
.lightbox__bar { color: #eee; text-align: center; padding: 14px 20px 22px; min-height: 84px; }
.lightbox__caption { margin: 0 0 4px; font-size: 1.1rem; }
.lightbox__credit { margin: 0; font-style: italic; color: #bfbfc9; font-size: 0.95rem; }
.lightbox__count { margin: 6px 0 0; font-family: var(--font-label); font-size: 0.7rem; letter-spacing: 0.2em; color: #9a9aa8; }
.lightbox__btn { position: absolute; z-index: 2; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.14); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.lightbox__btn:hover { background: rgba(255,255,255,0.28); }
.lightbox__close { top: 8px; right: 8px; }
.lightbox__prev, .lightbox__next { top: 50%; transform: translateY(-50%); }
.lightbox__prev { left: 8px; }
.lightbox__next { right: 8px; }
@media (max-width: 600px) { .lightbox__prev, .lightbox__next { top: auto; bottom: 14px; transform: none; } }
body.lightbox-open { overflow: hidden; }

/* Share form extras */
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-top: 10px; }
.preview { position: relative; display: grid; gap: 6px; }
.preview__img { aspect-ratio: 1; border-radius: 4px; background: var(--lavender-tint) center / cover no-repeat; display: grid; place-items: center; font-size: 0.75rem; color: var(--lavender); text-align: center; padding: 6px; overflow-wrap: anywhere; }
.preview input { width: 100%; font: inherit; font-size: 0.9rem; padding: 6px 8px; border: 1px solid var(--line); border-radius: 3px; background: var(--paper); }
.preview__x { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,0.6); color: #fff; cursor: pointer; font-size: 1rem; line-height: 1; }
.form__error { color: #b3261e; margin: 0; font-size: 1rem; }
.progress { height: 8px; background: var(--lavender-tint); border-radius: 99px; overflow: hidden; }
.progress__bar { height: 100%; width: 0; background: var(--slate-blue); transition: width 0.2s; }
.thanks { text-align: center; }
.thanks h3 { font-size: 1.8rem; margin-bottom: 8px; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* ---------- No-save mode ---------- */
.no-save [data-protect] { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.no-save [data-protect] img { pointer-events: none; -webkit-user-drag: none; }
.no-save .gallery__item { -webkit-touch-callout: none; }
@media print { .no-save .gallery, .no-save .lightbox, .no-save .portrait { display: none !important; } }

/* Warning bar shown only if a data file has a typo */
.problem { position: sticky; top: 0; z-index: 200; background: #fff3cd; color: #5c4400; border-bottom: 1px solid #e6cf84; padding: 10px 44px 10px 16px; font: 0.95rem/1.4 var(--font-label); }
.problem button { position: absolute; right: 8px; top: 6px; border: 0; background: none; font-size: 1.4rem; cursor: pointer; color: inherit; }
