/* Always By My Side — shared styles for memorial pages */
:root {
  --cream: #F7F2EA;
  --cream-deep: #f3ebe0;
  --ink: #3d3429;
  --ink-soft: #5c5246;
  --muted: #8a7e6e;
  --blush: #e8d5c4;
  --rose: #c4a484;
  --sage: #9aab8e;
  --sage-deep: #6f8263;
  --white: #ffffff;
  --line: rgba(196, 164, 132, 0.35);
  --shadow: 0 12px 40px rgba(61, 52, 41, 0.08);
  --shadow-soft: 0 4px 16px rgba(61, 52, 41, 0.05);
  --radius: 20px;
  --font: "Georgia", "Times New Roman", "Palatino Linotype", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.65;
  font-size: 17px;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--sage-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid rgba(111, 130, 99, 0.45); outline-offset: 2px; border-radius: 6px; }

.wrap { width: min(960px, calc(100% - 2.5rem)); margin: 0 auto; }
.wrap-narrow { width: min(720px, calc(100% - 2.5rem)); margin: 0 auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.paw-bg {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Cellipse cx='40' cy='52' rx='14' ry='16' fill='%233d3429'/%3E%3Ccircle cx='22' cy='30' r='8' fill='%233d3429'/%3E%3Ccircle cx='40' cy='22' r='8' fill='%233d3429'/%3E%3Ccircle cx='58' cy='30' r='8' fill='%233d3429'/%3E%3Ccircle cx='28' cy='44' r='6.5' fill='%233d3429'/%3E%3Ccircle cx='52' cy='44' r='6.5' fill='%233d3429'/%3E%3C/svg%3E");
  background-size: 120px 120px;
}
header, main, footer { position: relative; z-index: 1; }

/* Header */
.site-header { padding: 1.5rem 0 0.5rem; }
.header-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.85rem; text-decoration: none; color: inherit; }
.brand:hover { color: inherit; }
.brand-mark { width: 48px; height: 48px; flex-shrink: 0; object-fit: contain; }
.brand-name { font-family: var(--font); font-size: 1.15rem; font-weight: 600; letter-spacing: 0.02em; color: var(--ink); }
.brand-tag { font-size: 0.78rem; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.site-nav { display: flex; align-items: center; gap: 0.35rem 1.15rem; flex-wrap: wrap; }
.site-nav a {
  font-size: 0.95rem; font-weight: 600; color: var(--sage-deep); text-decoration: none; white-space: nowrap;
  padding: 0.3rem 0;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"] { border-bottom: 2px solid var(--rose); }
.site-nav a.nav-cta {
  background: var(--sage-deep); color: var(--white); padding: 0.45rem 0.95rem; border-radius: 999px;
}
.site-nav a.nav-cta:hover { background: #5e7154; color: var(--white); }
@media (max-width: 640px) {
  .header-bar { justify-content: center; text-align: left; }
  .site-nav { justify-content: center; width: 100%; }
}

/* Type */
.page-head { text-align: center; padding: 2.75rem 0 1.75rem; }
.eyebrow { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.6rem; }
.page-title { font-family: var(--font); font-weight: 500; font-size: clamp(1.7rem, 4vw, 2.35rem); line-height: 1.25; margin-bottom: 0.75rem; }
.page-lede { color: var(--ink-soft); max-width: 36rem; margin: 0 auto; font-size: 1.05rem; }
.divider { width: 48px; height: 2px; background: var(--rose); margin: 1.5rem auto; border-radius: 2px; opacity: 0.7; }
h2.section-title { font-family: var(--font); font-weight: 500; font-size: clamp(1.3rem, 3vw, 1.6rem); margin-bottom: 0.5rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.5rem; background: var(--sage-deep); color: var(--white);
  border: none; border-radius: 12px; font-size: 1rem; font-weight: 600; font-family: inherit;
  cursor: pointer; text-decoration: none; transition: background 0.15s, transform 0.1s;
}
.btn:hover { background: #5e7154; color: var(--white); }
.btn:active { transform: scale(0.99); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn-soft { background: var(--white); color: var(--sage-deep); border: 1.5px solid var(--sage); }
.btn-soft:hover { background: var(--cream-deep); color: var(--ink); }
.btn-quiet { background: transparent; color: var(--muted); border: 1px solid var(--line); font-weight: 500; }
.btn-quiet:hover { background: var(--cream-deep); color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }

/* Cards */
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.75rem 1.5rem;
}
@media (min-width: 640px) { .card { padding: 2.25rem 2.25rem; } }

/* Forms */
fieldset { border: none; margin: 0 0 1.75rem; }
legend { font-family: var(--font); font-size: 1.2rem; font-weight: 500; color: var(--ink); margin-bottom: 0.25rem; }
.legend-hint { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.1rem; }
label, .label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 0.35rem; letter-spacing: 0.02em; }
.opt { font-weight: 400; color: var(--muted); }
.field { margin-bottom: 1.15rem; }
.field-row { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
@media (min-width: 640px) { .field-row.two { grid-template-columns: 1fr 1fr; } .field-row.three { grid-template-columns: 1fr 1fr 1fr; } }
input[type="text"], input[type="email"], input[type="date"], select, textarea {
  width: 100%; padding: 0.8rem 1rem; border: 1.5px solid var(--blush); border-radius: 12px;
  background: var(--cream); color: var(--ink); font-size: 1rem; font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 9rem; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px rgba(154, 171, 142, 0.25); background: var(--white);
}
.help { font-size: 0.82rem; color: var(--muted); margin-top: 0.35rem; }
.counter { float: right; font-weight: 400; color: var(--muted); }
.error-msg { color: #9a5b4a; font-size: 0.88rem; margin-top: 0.35rem; }

/* Privacy choice */
.choice-group { display: grid; gap: 0.75rem; }
@media (min-width: 640px) { .choice-group { grid-template-columns: 1fr 1fr; } }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label {
  display: block; height: 100%; cursor: pointer; margin: 0; padding: 1rem 1.1rem 1rem 3rem;
  border: 1.5px solid var(--blush); border-radius: 14px; background: var(--cream);
  font-weight: 400; letter-spacing: 0; color: var(--ink-soft); font-size: 0.92rem; line-height: 1.5;
}
.choice label strong { display: block; color: var(--ink); font-size: 1rem; margin-bottom: 0.15rem; }
.choice label::before {
  content: ""; position: absolute; left: 1.1rem; top: 1.15rem; width: 18px; height: 18px;
  border-radius: 50%; border: 2px solid var(--rose); background: var(--white);
}
.choice input:checked + label { border-color: var(--sage-deep); background: var(--white); box-shadow: 0 0 0 3px rgba(154, 171, 142, 0.2); }
.choice input:checked + label::before { border-color: var(--sage-deep); background: radial-gradient(circle, var(--sage-deep) 45%, var(--white) 50%); }
.choice input:focus-visible + label { outline: 3px solid rgba(111, 130, 99, 0.45); outline-offset: 2px; }

/* Photo picker */
.photo-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  border: 2px dashed var(--rose); border-radius: 16px; padding: 1.5rem 1rem; background: var(--cream);
  color: var(--ink-soft); cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.photo-drop:hover, .photo-drop.dragover { background: var(--white); border-color: var(--sage-deep); }
.photo-drop svg { width: 34px; height: 34px; color: var(--sage-deep); margin-bottom: 0.4rem; }
.photo-drop .label { margin: 0; color: var(--ink); font-size: 1rem; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.75rem; margin-top: 1rem; }
.photo-grid:empty { display: none; }
.thumb { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 1; background: var(--cream-deep); border: 2px solid transparent; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.is-cover { border-color: var(--sage-deep); }
.thumb .cover-tag {
  position: absolute; left: 6px; top: 6px; background: var(--sage-deep); color: var(--white);
  font-size: 0.68rem; font-weight: 600; padding: 0.1rem 0.45rem; border-radius: 999px; letter-spacing: 0.03em;
}
.thumb-actions { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; padding: 6px; gap: 4px; }
.thumb-actions button {
  border: none; background: rgba(255, 255, 255, 0.92); color: var(--ink-soft); font-size: 0.72rem; font-weight: 600;
  border-radius: 999px; padding: 0.2rem 0.55rem; cursor: pointer; font-family: inherit;
}
.thumb-actions button:hover { background: var(--white); color: var(--ink); }

/* Notices */
.notice {
  display: flex; gap: 0.85rem; align-items: flex-start; background: var(--cream-deep);
  border: 1px solid var(--line); border-radius: 14px; padding: 0.95rem 1.1rem; color: var(--ink-soft); font-size: 0.92rem;
}
.notice svg { flex-shrink: 0; width: 22px; height: 22px; color: var(--sage-deep); margin-top: 2px; }
.notice strong { color: var(--ink); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; padding: 0.3rem 0.75rem; border-radius: 999px;
  background: var(--cream-deep); color: var(--sage-deep); border: 1px solid var(--line);
}
.badge svg { width: 13px; height: 13px; }
.badge.private { color: #8a6a55; background: #f6ebe2; }

/* Memorial view */
.memorial-hero { padding: 2rem 0 1rem; text-align: center; }
.hero-frame {
  position: relative; width: min(560px, 100%); margin: 0 auto 1.75rem; border-radius: 28px; overflow: hidden;
  box-shadow: var(--shadow); border: 8px solid var(--white); background: var(--cream-deep); aspect-ratio: 4 / 3;
}
.hero-frame img { width: 100%; height: 100%; object-fit: cover; }
.hero-frame.no-photo { display: flex; align-items: center; justify-content: center; }
.hero-frame.no-photo img { width: 46%; height: auto; object-fit: contain; opacity: 0.9; }
.memorial-name { font-family: var(--font); font-weight: 500; font-size: clamp(2.2rem, 6vw, 3.2rem); line-height: 1.1; letter-spacing: -0.01em; }
.memorial-species { color: var(--muted); font-size: 0.95rem; letter-spacing: 0.06em; text-transform: uppercase; margin-top: 0.5rem; }
.memorial-span { font-family: var(--font); font-size: 1.15rem; color: var(--ink-soft); margin-top: 0.6rem; }
.memorial-tagline { font-family: var(--font); font-style: italic; color: var(--ink-soft); font-size: clamp(1.1rem, 2.6vw, 1.3rem); max-width: 30rem; margin: 1rem auto 0; }
.memorial-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-top: 1.25rem; }
.memorial-byline { color: var(--muted); font-size: 0.9rem; margin-top: 0.85rem; }

.memorial-layout { display: grid; gap: 1.5rem; padding: 1.5rem 0 1rem; }
@media (min-width: 860px) { .memorial-layout { grid-template-columns: 1.6fr 1fr; align-items: start; } }

.story h2, .side-card h2, .gallery-section h2, .guestbook h2 { font-family: var(--font); font-weight: 500; font-size: 1.35rem; margin-bottom: 0.85rem; }
.story-body p { color: var(--ink-soft); margin-bottom: 1rem; font-size: 1.04rem; line-height: 1.8; }
.story-body p:first-child::first-letter { font-family: var(--font); font-size: 3rem; float: left; line-height: 0.9; padding: 0.25rem 0.5rem 0 0; color: var(--sage-deep); }
.side-card { padding: 1.5rem; }
.date-list { list-style: none; display: grid; gap: 0.9rem; }
.date-list li { display: flex; gap: 0.8rem; align-items: flex-start; }
.date-list .ic { flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--cream-deep); display: grid; place-items: center; color: var(--sage-deep); }
.date-list .ic svg { width: 18px; height: 18px; }
.date-list .k { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.date-list .v { font-family: var(--font); color: var(--ink); font-size: 1.05rem; }
.date-list .soon { font-size: 0.82rem; color: var(--sage-deep); }
.side-note { margin-top: 1.15rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: 0.86rem; color: var(--muted); }

.gallery-section { padding: 1rem 0; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.85rem; }
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.gallery button {
  border: 6px solid var(--white); padding: 0; border-radius: 16px; overflow: hidden; cursor: zoom-in;
  aspect-ratio: 1; background: var(--cream-deep); box-shadow: var(--shadow-soft);
}
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.gallery button:hover img { transform: scale(1.03); }

.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(61, 52, 41, 0.82); display: none;
  align-items: center; justify-content: center; padding: 1.5rem;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: min(1000px, 100%); max-height: 86vh; border-radius: 16px; border: 6px solid var(--white); }
.lightbox button { position: absolute; top: 1rem; right: 1rem; background: var(--white); border: none; border-radius: 999px; padding: 0.5rem 1rem; font: inherit; font-weight: 600; cursor: pointer; color: var(--ink); }

/* Guestbook */
.guestbook { padding: 1.5rem 0 3rem; }
.guestbook-grid { display: grid; gap: 1.5rem; }
@media (min-width: 860px) { .guestbook-grid { grid-template-columns: 1fr 1.4fr; align-items: start; } }
.notes { list-style: none; display: grid; gap: 0.9rem; }
.note {
  background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-soft); position: relative;
}
.note::before { content: "\201C"; position: absolute; right: 1rem; top: 0.2rem; font-family: var(--font); font-size: 3rem; color: var(--blush); line-height: 1; }
.note p { color: var(--ink-soft); white-space: pre-line; }
.note .who { margin-top: 0.6rem; font-family: var(--font); color: var(--ink); font-size: 0.98rem; }
.note .when { color: var(--muted); font-size: 0.8rem; margin-left: 0.4rem; font-family: var(--sans); }
.note.fresh { animation: settle 0.6s ease; }
@keyframes settle { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.empty { color: var(--muted); text-align: center; padding: 1.5rem; border: 1.5px dashed var(--blush); border-radius: 16px; }

/* Directory */
.garden-tools { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-bottom: 1.75rem; }
.garden-tools input { max-width: 340px; }
.garden { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.25rem; }
.plot {
  display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft);
  transition: transform 0.2s, box-shadow 0.2s;
}
.plot:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: inherit; }
.plot .ph { aspect-ratio: 4 / 3; background: var(--cream-deep); display: flex; align-items: center; justify-content: center; }
.plot .ph img { width: 100%; height: 100%; object-fit: cover; }
.plot .ph img.emblem { width: 45%; height: auto; object-fit: contain; }
.plot .body { padding: 1rem 1.15rem 1.2rem; text-align: center; }
.plot .nm { font-family: var(--font); font-size: 1.35rem; color: var(--ink); }
.plot .sp { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.plot .yrs { font-family: var(--font); color: var(--ink-soft); font-size: 0.95rem; margin-top: 0.25rem; }
.plot .tl { font-style: italic; font-family: var(--font); color: var(--ink-soft); font-size: 0.92rem; margin-top: 0.5rem; }
.plot .tags { margin-top: 0.6rem; display: flex; gap: 0.35rem; justify-content: center; flex-wrap: wrap; }

.section-gap { padding: 2rem 0; }
.center { text-align: center; }
.muted { color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 2.5rem; margin-top: 2rem; text-align: center; color: var(--muted); font-size: 0.85rem; }
.site-footer .name { font-family: var(--font); color: var(--ink-soft); margin-bottom: 0.35rem; }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; justify-content: center; margin: 0.5rem 0; }

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--ink); color: var(--cream); padding: 0.75rem 1.25rem; border-radius: 999px; font-size: 0.92rem;
  transition: opacity 0.3s, transform 0.3s; z-index: 60; pointer-events: none; max-width: calc(100% - 2rem); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-header .site-nav, .guestbook form, .site-footer .links, .paw-bg, .owner-tools { display: none !important; } }

/* Image frames: keep fixed proportions whatever the photo shape */
.hero-frame img, .plot .ph img:not(.emblem) { position: absolute; inset: 0; }
.hero-frame.no-photo img { position: static; }
.plot .ph { position: relative; overflow: hidden; }
.photo-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.garden { align-items: start; }

/* Tall (portrait) cover photos: give the hero a portrait frame and keep faces in view in cards */
.hero-frame.tall { aspect-ratio: 4 / 5; width: min(460px, 100%); }
.hero-frame.tall img, .plot .ph img, .gallery img { object-position: 50% 30%; }
