/* Warm, quiet memorial aesthetic. Large readable type, generous whitespace,
   muted palette, serif headings. Designed to read well on an old phone. */

:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --ink: #2c2a27;
  --muted: #7a756e;
  --accent: #6b5b4a;     /* warm taupe/brown */
  --accent-ink: #ffffff;
  --line: #e7e1d8;
  --danger: #9a3b3b;
  --maxw: 760px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.125rem;
  line-height: 1.7;
}

h1, h2, h3, .brand {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }

.muted { color: var(--muted); }
.center { text-align: center; }

/* Header / nav */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .5rem 1.5rem;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { font-size: 1.35rem; text-decoration: none; color: var(--ink); }
.site-header nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.site-header nav a { text-decoration: none; color: var(--muted); font-family: system-ui, sans-serif; font-size: .95rem; }
.site-header nav a[aria-current="page"], .site-header nav a:hover { color: var(--accent); }

/* Layout */
.container { max-width: var(--maxw); margin: 0 auto; padding: 2.5rem 1.5rem; }
.narrow { max-width: 620px; }
section + section { border-top: 1px solid transparent; }

/* Hero */
.hero { text-align: center; padding: 3rem 1.5rem 2.5rem; }
.hero-photo {
  width: 220px; height: 220px; margin: 0 auto 1.5rem;
  border-radius: 50%;
  background: #ece6dd center/cover no-repeat;
  box-shadow: 0 6px 24px rgba(0,0,0,.12);
}
.hero h1 { font-size: 2.6rem; margin: 0 0 .25rem; }
.hero .dates { font-size: 1.2rem; color: var(--muted); margin: 0 0 1rem; letter-spacing: .02em; }
.hero .tagline { font-style: italic; color: var(--muted); margin: 0 0 2rem; }

/* Buttons */
.btn {
  display: inline-block; cursor: pointer;
  font-family: system-ui, sans-serif; font-size: 1rem;
  padding: .7rem 1.4rem; border-radius: 999px;
  border: 1px solid var(--accent); background: transparent; color: var(--accent);
  text-decoration: none; transition: all .15s ease;
}
.btn:hover { background: var(--accent); color: var(--accent-ink); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-rsvp { background: #3f7d50; border-color: #3f7d50; color: #fff; }
.btn-rsvp:hover { filter: brightness(1.08); }
.hero-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.map-link { font-family: system-ui, sans-serif; font-size: .9rem; white-space: nowrap; }
.rsvp-attending { border: 1px solid var(--line); border-radius: 10px; padding: .6rem 1rem 1rem; }
.rsvp-attending legend { padding: 0 .4rem; font-size: .95rem; color: var(--muted); font-family: system-ui, sans-serif; }
.rsvp-attending .radio { flex-direction: row; align-items: center; gap: .5rem; font-size: 1rem; color: var(--ink); margin: .4rem 0; }
.rsvp-attending .radio input { width: auto; }
.rsvp-table { width: 100%; border-collapse: collapse; font-size: .95rem; margin-top: .5rem; }
.rsvp-table th, .rsvp-table td { border: 1px solid var(--line); padding: .5rem .7rem; text-align: left; vertical-align: top; }
.rsvp-table th { background: #f3eee6; }

/* Obituary */
.obituary p { margin: 0 0 1.1rem; }

/* Info cards (service / donation) */
.card-section { padding-top: 1rem; }
.info-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 1.75rem 2rem;
}
.info-card.subtle { background: #f3eee6; }
.info-card h2 { margin-top: 0; }

/* Memories */
.memory-list { display: flex; flex-direction: column; gap: 1.25rem; }
.memory {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 1.5rem 1.75rem;
}
.memory-body { margin-bottom: .75rem; }
.memory-by { font-style: italic; color: var(--accent); margin: 0; }

/* Gallery */
.gallery-grid {
  display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.thumb {
  display: block; aspect-ratio: 1/1; border-radius: 10px; overflow: hidden;
  background: #ece6dd;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-video {
  aspect-ratio: 16/9; position: relative;
  background: #2c2a27 center/cover no-repeat; text-decoration: none;
}
.thumb-video .play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 2.5rem; text-shadow: 0 2px 8px rgba(0,0,0,.6); opacity: .9;
}
.thumb-video:hover .play { opacity: 1; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(20,18,16,.92);
  display: flex; align-items: center; justify-content: center; padding: 2rem;
}
.lightbox img { max-width: 95vw; max-height: 90vh; border-radius: 8px; box-shadow: 0 8px 40px rgba(0,0,0,.5); }
.lightbox-video { width: min(95vw, 1100px); aspect-ratio: 16/9; }
.lightbox-video iframe { width: 100%; height: 100%; border: 0; border-radius: 8px; }
.lightbox-close {
  position: absolute; top: 1rem; right: 1.25rem;
  background: none; border: 0; color: #fff; font-size: 2.5rem; line-height: 1; cursor: pointer;
}

/* Form */
.memory-form { display: flex; flex-direction: column; gap: 1.1rem; margin-top: 1.5rem; }
.memory-form label { display: flex; flex-direction: column; gap: .35rem; font-size: .95rem; color: var(--muted); font-family: system-ui, sans-serif; }
.memory-form input, .memory-form textarea {
  font: inherit; font-size: 1.05rem; color: var(--ink);
  padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.memory-form input[type="file"] { padding: .5rem; font-size: .95rem; }
.memory-form input:focus, .memory-form textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.form-status { font-family: system-ui, sans-serif; font-size: .95rem; color: var(--accent); min-height: 1.2em; }
.form-status.error { color: var(--danger); }

/* Photo picker + per-photo cards */
.photo-field { display: flex; flex-direction: column; gap: .5rem; }
.photo-field .field-label { font-size: .95rem; color: var(--muted); font-family: system-ui, sans-serif; }
.small { font-size: .85rem; margin: 0; }
.btn-small { padding: .4rem .7rem; font-size: .85rem; }
.photo-list { display: flex; flex-direction: column; gap: .75rem; margin-top: .25rem; }
.photo-card {
  display: flex; gap: .9rem; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .75rem;
}
.photo-thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; flex: none; background: #ece6dd; }
.photo-card-body { display: flex; flex-direction: column; gap: .5rem; flex: 1; min-width: 0; }
.photo-card .photo-caption {
  font: inherit; font-size: 1rem; color: var(--ink);
  padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 100%;
}
.photo-card .photo-caption:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.photo-card-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Crop / rotate editor */
.editor-modal {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  background: rgba(20,18,16,.92); padding: 1rem;
}
.editor-box {
  background: var(--surface); border-radius: 14px; padding: 1rem;
  width: min(680px, 100%); max-height: 90vh; display: flex; flex-direction: column; gap: .9rem;
}
.editor-canvas { background: #2c2a27; border-radius: 8px; overflow: hidden; }
.editor-canvas .editor-img { display: block; max-width: 100%; max-height: 62vh; }
.editor-controls { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.editor-spacer { flex: 1; }

/* Admin */
.hero-admin { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; margin-top: .5rem; }
.hero-admin-current { width: 120px; height: 120px; object-fit: cover; border-radius: 50%; border: 1px solid var(--line); background: #ece6dd; }
.hero-admin-controls { flex: 1; min-width: 240px; }
.hero-pick { display: flex; flex-direction: column; gap: .4rem; align-items: center; }
.hero-pick img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.mod-item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: 1rem; }
.mod-item form { margin-right: .5rem; }

.lightbox-caption {
  color: #f3eee6; font-family: system-ui, sans-serif; font-size: 1rem;
  text-align: center; max-width: 90vw; margin: 1rem auto 0; text-shadow: 0 1px 4px rgba(0,0,0,.6);
}

/* CTA */
.cta { background: var(--surface); border-radius: 16px; }

/* Footer */
.site-footer { text-align: center; padding: 2.5rem 1.5rem; color: var(--muted); border-top: 1px solid var(--line); font-size: .95rem; }
.site-footer p { margin: .25rem 0; }

@media (max-width: 520px) {
  body { font-size: 1.06rem; }
  .hero h1 { font-size: 2.1rem; }
  .hero-photo { width: 170px; height: 170px; }
}
