/* ============================================================
   Nancy Gratta — Celebration of Life
   Palette: white + soft blues
   ============================================================ */

:root {
  --white: #ffffff;
  --cloud: #f4f8fc;        /* tinted section background */
  --sky: #dce9f5;          /* light accent */
  --blue: #5b82a6;         /* primary dusty blue */
  --blue-deep: #3d5f80;    /* headings */
  --ink: #34404c;          /* body text */
  --ink-soft: #64707c;     /* secondary text */
  --line: #e3ecf4;

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1.075rem;
  line-height: 1.75;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Hero ---------- */

.hero {
  background: linear-gradient(180deg, var(--cloud) 0%, var(--white) 100%);
  padding: 7rem 1.5rem 2.5rem;
  text-align: center;
}

.hero-inner { max-width: 720px; margin: 0 auto; }

.hero-eyebrow {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.8rem, 8vw, 4.5rem);
  color: var(--blue-deep);
  line-height: 1.1;
}

.hero-dates {
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--ink-soft);
  margin-top: 0.9rem;
  letter-spacing: 0.06em;
}

.hero-line {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--blue);
  margin-top: 1.75rem;
}

.divider {
  color: var(--blue);
  opacity: 0.55;
  margin-top: 2.5rem;
}

/* ---------- Sections ---------- */

.section { padding: 5rem 1.5rem; }

.section-tinted { background: var(--cloud); }

#story { padding-top: 2.5rem; }

.section-inner { max-width: 960px; margin: 0 auto; }

.section-inner.narrow { max-width: 680px; }

.section h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 2.1rem;
  color: var(--blue-deep);
  text-align: center;
  margin-bottom: 2.25rem;
}

.section h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--blue-deep);
  margin-bottom: 1rem;
}

.section-intro {
  text-align: center;
  color: var(--ink-soft);
  max-width: 560px;
  margin: -1rem auto 2.5rem;
}

#story-portrait {
  margin: 0 auto 2.5rem;
  max-width: 320px;
  text-align: center;
}

#story-portrait img {
  display: block;
  width: 100%;
  border-radius: 8px;
  background: var(--white);
  padding: 10px;
  border: 1px solid var(--line);
  box-shadow: 0 6px 26px rgba(61, 95, 128, 0.16);
}

#story-portrait figcaption {
  margin-top: 0.9rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

#story-text p + p { margin-top: 1.25rem; }

#story-text a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

#story-text a:hover { color: var(--blue-deep); }

/* ---------- Slideshow ---------- */

.slideshow {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(61, 95, 128, 0.14);
  background: linear-gradient(160deg, var(--sky) 0%, #cddff0 100%);
}

.slides { position: relative; aspect-ratio: 4 / 5; }

.slides img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 1.1s ease;
}

.slides img.active { opacity: 1; }

.slide-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.slide-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--blue);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 3px;
  flex: none;
}

.slide-btn:hover {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}

.slide-dots {
  display: flex;
  justify-content: center;
  gap: 9px;
}

.slide-dots button {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: none;
  background: var(--sky);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}

.slide-dots button.active {
  background: var(--blue);
  transform: scale(1.25);
}

.slide-caption {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink-soft);
  margin-top: 1.25rem;
  min-height: 1.5em;
}

/* ---------- Video ---------- */

.video-wrap {
  max-width: 760px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(61, 95, 128, 0.14);
  background: var(--sky);
}

.video-wrap iframe { width: 100%; height: 100%; display: block; }

/* ---------- Letter ---------- */

.letter-reveal { text-align: center; }

.letter-toggle {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--blue);
  background: var(--white);
  border: 1px solid var(--blue);
  border-radius: 30px;
  padding: 0.7rem 2rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.letter-toggle:hover {
  background: var(--blue);
  color: var(--white);
}

.letter-card {
  margin-top: 2rem;
  background: var(--cloud);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2.75rem 2.5rem;
  box-shadow: 0 4px 22px rgba(61, 95, 128, 0.08);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.letter-card.open { opacity: 1; transform: none; }

.letter-card p {
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.75;
  color: var(--ink);
}

.letter-card p + p { margin-top: 1.15rem; }

.letter-card .letter-signature {
  margin-top: 1.5rem;
  font-size: 1.6rem;
  font-style: italic;
  color: var(--blue-deep);
}

@media (max-width: 600px) {
  .letter-card { padding: 1.75rem 1.35rem; }
}

/* ---------- Memories ---------- */

.memory-wall { display: grid; gap: 1.25rem; margin-bottom: 3.5rem; }

.memory-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.6rem 1.8rem;
  box-shadow: 0 2px 14px rgba(61, 95, 128, 0.06);
}

.memory-card .memory-photo {
  display: block;
  max-width: 100%;
  max-height: 340px;
  border-radius: 8px;
  margin-bottom: 1.1rem;
  box-shadow: 0 2px 10px rgba(61, 95, 128, 0.1);
}

.memory-card blockquote {
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--ink);
}

.memory-card cite {
  display: block;
  margin-top: 0.9rem;
  font-style: normal;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
}

.memory-form-wrap {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2.25rem 2rem;
  box-shadow: 0 2px 14px rgba(61, 95, 128, 0.06);
}

.form-row { margin-bottom: 1.25rem; }

.form-row label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--blue-deep);
  margin-bottom: 0.4rem;
}

.form-row input,
.form-row textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  background: var(--cloud);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--white);
}

.hidden-field { display: none; }

.form-row .optional {
  font-weight: 300;
  color: var(--ink-soft);
  text-transform: none;
}

.form-row input[type="file"] {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.form-row input[type="file"]::file-selector-button {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--blue);
  background: var(--white);
  border: 1px solid var(--blue);
  border-radius: 6px;
  padding: 0.5rem 1.2rem;
  margin-right: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.form-row input[type="file"]::file-selector-button:hover {
  background: var(--blue);
  color: var(--white);
}

.photo-preview { margin-top: 1rem; }

.photo-preview img {
  display: block;
  max-width: 220px;
  max-height: 220px;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(61, 95, 128, 0.1);
}

.photo-remove {
  margin-top: 0.5rem;
  background: none;
  border: none;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.photo-remove:hover { color: var(--blue-deep); }

.btn {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--white);
  background: var(--blue);
  border: none;
  border-radius: 6px;
  padding: 0.75rem 2.25rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn:hover { background: var(--blue-deep); }

.form-note {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--blue);
  min-height: 1.4em;
}

/* ---------- Footer ---------- */

.footer {
  background: linear-gradient(180deg, var(--white) 0%, var(--cloud) 100%);
  padding: 5rem 1.5rem 4rem;
  text-align: center;
}

.footer-inner { max-width: 620px; margin: 0 auto; }

.footer-wings { color: var(--blue); opacity: 0.5; margin-bottom: 1.5rem; }

.footer-quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--blue-deep);
  line-height: 1.5;
}

.footer-family {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- Small screens ---------- */

@media (max-width: 600px) {
  .hero { padding: 4.5rem 1.25rem 3.5rem; }
  .section { padding: 3.5rem 1.25rem; }
  .slide-btn { width: 38px; height: 38px; }
  .memory-form-wrap { padding: 1.75rem 1.25rem; }
}
