/* =========================================================
   Soul Dog Stones: public memorial page
   Warm, personal tribute design (desktop + mobile)
   ========================================================= */

/* Brittany Signature for the dog's name.
   Put the licensed web font files in public/assets/fonts/ */
@font-face {
  font-family: 'Brittany Signature';
  src: url('../fonts/BrittanySignature.woff2') format('woff2'),
       url('../fonts/BrittanySignature.woff') format('woff'),
       url('../fonts/BrittanySignature.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --sds-ivory: #FAF7F1;
  --sds-card: #FFFFFF;
  --sds-sage: #A8B69A;
  --sds-teal: #54CDC5;
  --sds-terracotta: #C66D4F;
  --sds-text: #39342F;
  --sds-muted: #7A7069;
  --sds-line: #EFE8DD;

  --sds-wash-beige: #F3E4CD;
  --sds-wash-blue: #DCE9F0;
  --sds-wash-sage: #E4EBDD;

  --sds-script: 'Brittany Signature', 'Great Vibes', cursive;
  --sds-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sds-sans: 'Nunito Sans', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --sds-radius: 16px;
  --sds-shadow: 0 1px 2px rgba(57, 52, 47, .04), 0 8px 24px rgba(57, 52, 47, .06);
}

/* ---------- page ---------- */
.sds-page *, .sds-page *::before, .sds-page *::after { box-sizing: border-box; }

body.sds-body { background: var(--sds-ivory); }

.sds-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(1200px 500px at 15% -10%, #F6EBDD 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 0%, #EEF2E8 0%, transparent 55%),
    var(--sds-ivory);
  color: var(--sds-text);
  font-family: var(--sds-sans);
  font-size: 15px;
  line-height: 1.7;
}

/* botanical sprigs in the corners (decoration only) */
.sds-sprig {
  position: absolute;
  width: 220px; height: 320px;
  background: url('../img/memorial/sprig.svg') no-repeat center / contain;
  pointer-events: none;
  z-index: 0;
  opacity: .9;
}
.sds-sprig--tl { top: -30px; left: -40px; transform: rotate(-12deg); }
.sds-sprig--tr { top: 140px; right: -60px; transform: scaleX(-1) rotate(-8deg); opacity: .75; }
.sds-sprig--ml { top: 52%; left: -70px; transform: rotate(8deg); opacity: .55; }
.sds-sprig--br { bottom: 40px; right: -50px; transform: scaleX(-1) rotate(20deg); opacity: .7; }

.sds-wrap {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 24px 24px;
}

/* ---------- hero ---------- */
.sds-hero {
  display: flex;
  align-items: center;
  gap: 36px;
  margin-bottom: 28px;
  padding: 30px 34px;
  border-radius: 24px;
  background: linear-gradient(120deg, rgba(243, 228, 205, .55) 0%, rgba(250, 247, 241, .6) 55%, rgba(228, 235, 221, .45) 100%);
  border: 1px solid rgba(231, 214, 191, .45);
}

.sds-portrait {
  flex: 0 0 auto;
  width: 220px; height: 220px;
  border-radius: 50%;
  padding: 8px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--sds-line), 0 14px 34px rgba(57, 52, 47, .14);
  position: relative;
}
.sds-portrait::after {           /* thin warm ring */
  content: '';
  position: absolute; inset: -9px;
  border-radius: 50%;
  border: 1.5px solid #E7D6BF;
}
.sds-portrait img,
.sds-portrait .sds-portrait-empty {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.sds-portrait .sds-portrait-empty {
  display: flex; align-items: center; justify-content: center;
  background: var(--sds-wash-beige);
  color: #C9AE8C;
}

.sds-hero-text { min-width: 0; }

.sds-eyebrow {
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--sds-muted);
  margin-bottom: 10px;
}

.sds-name {
  font-family: var(--sds-script);
  font-weight: normal;
  font-size: clamp(50px, 5.6vw, 80px);
  line-height: 1.05;
  color: var(--sds-text);
  margin: 0 0 12px;
  padding-top: .08em;            /* room for the script's tall capitals */
  overflow-wrap: break-word;     /* only very long single words wrap */
}
.sds-name-last { white-space: nowrap; }
.sds-name--long { font-size: clamp(42px, 4.4vw, 64px); }
.sds-name--xl   { font-size: clamp(36px, 3.6vw, 52px); }
.sds-name-heart {
  display: inline-block;
  width: 22px; height: 22px;
  margin-left: 10px;
  vertical-align: .45em;
  color: var(--sds-terracotta);
}

.sds-meta { color: var(--sds-text); font-size: 15px; }
.sds-meta div + div { margin-top: 1px; }
.sds-meta .sds-dates { color: var(--sds-muted); }

.sds-dedication {
  font-family: var(--sds-serif);
  font-style: italic;
  font-size: 21px;
  line-height: 1.45;
  color: #5A514A;
  margin: 14px 0 0;
  max-width: 560px;
}

/* ---------- cards grid ---------- */
.sds-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}
.sds-col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.sds-grid .sds-card--wide { grid-column: 1 / -1; }

.sds-card {
  position: relative;
  background: var(--sds-card);
  border-radius: var(--sds-radius);
  box-shadow: var(--sds-shadow);
  border: 1px solid rgba(239, 232, 221, .7);
  padding: 26px 28px 28px;
  overflow: hidden;
}

/* watercolor brushstroke behind each heading */
.sds-title {
  position: relative;
  display: inline-block;
  font-family: var(--sds-serif);
  font-weight: 700;
  font-size: 23px;
  line-height: 1.2;
  color: var(--sds-text);
  margin: 0 0 16px;
  padding: 6px 22px 6px 14px;
  z-index: 0;
}
.sds-title::before {
  content: '';
  position: absolute;
  inset: 2px -4px 0 -6px;
  z-index: -1;
  background: var(--wash, var(--sds-wash-beige));
  border-radius: 46% 54% 38% 62% / 62% 44% 56% 38%;
  transform: rotate(-1.2deg);
  opacity: .95;
  filter: blur(.4px);
}
.sds-title::after {              /* lighter second stroke for a painted edge */
  content: '';
  position: absolute;
  left: 10%; right: -10px; bottom: -2px; height: 45%;
  z-index: -1;
  background: var(--wash, var(--sds-wash-beige));
  border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%;
  opacity: .55;
  transform: rotate(1.5deg);
}
.sds-wash-beige { --wash: var(--sds-wash-beige); }
.sds-wash-blue  { --wash: var(--sds-wash-blue); }
.sds-wash-sage  { --wash: var(--sds-wash-sage); }

.sds-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.sds-link {
  font-size: 13px;
  color: #4C6FA8;
  text-decoration: none;
  white-space: nowrap;
  margin-top: 8px;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.sds-link:hover { text-decoration: underline; }

/* small decorations inside cards (bottom ones get room so they never cover text) */
.sds-card--doodle { padding-bottom: 56px; }
.sds-doodle {
  position: absolute;
  pointer-events: none;
  color: var(--sds-terracotta);
  opacity: .55;
}
.sds-doodle--heart { right: 22px; bottom: 18px; width: 22px; height: 22px; }
.sds-doodle--paw   { right: 20px; bottom: 14px; width: 54px; height: 54px; color: #E9E1D5; opacity: 1; }
.sds-doodle--paw-top { right: 22px; top: 20px; width: 60px; height: 60px; color: #ECE6DC; opacity: 1; }

/* ---------- rich text ---------- */
.sds-rich { color: #4A433D; position: relative; z-index: 1; }
.sds-rich p { margin: 0 0 12px; }
.sds-rich p:last-child { margin-bottom: 0; }
.sds-rich h2, .sds-rich h3 {
  font-family: var(--sds-serif); font-weight: 700; color: var(--sds-text);
  font-size: 20px; margin: 16px 0 8px;
}
.sds-rich blockquote {
  margin: 12px 0; padding: 4px 0 4px 16px;
  border-left: 3px solid var(--sds-wash-beige);
  font-family: var(--sds-serif); font-style: italic; font-size: 18px; color: #5A514A;
}
.sds-rich a { color: var(--sds-terracotta); }
.sds-rich ul, .sds-rich ol { margin: 0 0 12px; padding-left: 22px; }

/* Favorite things: each bullet gets a small paw badge */
.sds-favorites ul { list-style: none; padding-left: 0; }
.sds-favorites ul li {
  position: relative;
  padding: 6px 0 6px 40px;
  min-height: 32px;
}
.sds-favorites ul li + li { border-top: 1px dashed var(--sds-line); }
.sds-favorites ul li::before {
  content: '';
  position: absolute; left: 0; top: 7px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--sds-wash-sage) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238E9E7E'%3E%3Ccircle cx='6' cy='10' r='2.2'/%3E%3Ccircle cx='10' cy='5.5' r='2.2'/%3E%3Ccircle cx='14' cy='5.5' r='2.2'/%3E%3Ccircle cx='18' cy='10' r='2.2'/%3E%3Cpath d='M12 11c-3 0-5.5 2.8-5.5 5.2 0 1.7 1.3 2.8 3 2.8 1 0 1.6-.4 2.5-.4s1.5.4 2.5.4c1.7 0 3-1.1 3-2.8C17.5 13.8 15 11 12 11Z'/%3E%3C/svg%3E") no-repeat center / 15px;
}
.sds-favorites ul li:nth-child(3n+2)::before { background-color: var(--sds-wash-beige); }
.sds-favorites ul li:nth-child(3n)::before   { background-color: var(--sds-wash-blue); }

/* ---------- photos ---------- */
.sds-photos {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  grid-auto-rows: 118px;
  gap: 10px;
}
.sds-photos a {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  background: var(--sds-wash-beige);
  position: relative;
}
.sds-photos a img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.sds-photos a:hover img { transform: scale(1.04); }
.sds-photos a:first-child { grid-row: span 2; }
.sds-photos a:nth-child(2) { grid-column: span 2; }
.sds-photos .sds-more {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(57, 52, 47, .45);
  color: #fff; font-weight: 600; font-size: 18px;
}
/* 1 or 2 photos: simpler layouts */
.sds-photos--1 { grid-template-columns: 1fr; grid-auto-rows: 260px; }
.sds-photos--1 a:first-child { grid-row: auto; }
.sds-photos--2 { grid-template-columns: 1fr 1fr; grid-auto-rows: 220px; }
.sds-photos--2 a:first-child { grid-row: auto; }
.sds-photos--2 a:nth-child(2) { grid-column: auto; }
.sds-photos--3 a:nth-child(2) { grid-column: auto; }
.sds-photos--3 a:nth-child(3) { grid-column: auto; }
.sds-photos--3 { grid-template-columns: 1.35fr 1fr; }


/* 5 or more photos: big first photo, then a 3-column grid, ALL photos visible */
.sds-photos--many { grid-template-columns: 1fr 1fr 1fr; grid-auto-rows: 118px; grid-auto-flow: dense; }
.sds-photos--many a:first-child { grid-column: span 2; grid-row: span 2; }
.sds-photos--many a:nth-child(2) { grid-column: auto; }
/* fill the last row: 2 photos left -> last one is 2 wide, 1 left -> full width */
.sds-photos--many a:last-child:nth-child(3n+2) { grid-column: span 2; }
.sds-photos--many a:last-child:nth-child(3n+1) { grid-column: span 3; }

/* ---------- videos ---------- */
.sds-video {
  position: relative;
  padding-top: 56.25%;
  border-radius: 12px;
  overflow: hidden;
  background: #1f1b18;
}
.sds-video iframe,
.sds-video video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
  background: #000;
}
.sds-video + .sds-caption { margin-top: 8px; }
.sds-caption { font-size: 13px; color: var(--sds-muted); margin: 0 0 16px; }
.sds-caption:last-child { margin-bottom: 0; }
.sds-videos > .sds-video:not(:last-child) { margin-bottom: 16px; }

/* ---------- share ---------- */
.sds-share { display: flex; flex-wrap: wrap; gap: 10px; }
.sds-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--sds-line);
  background: #fff;
  color: var(--sds-text);
  font: 600 14px/1.2 var(--sds-sans);
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s;
}
.sds-btn:hover { background: #FBF6EE; border-color: #E4D7C4; color: var(--sds-text); transform: translateY(-1px); }
.sds-btn--teal {
  background: var(--sds-teal);
  border-color: var(--sds-teal);
  color: #fff;
}
.sds-btn--teal:hover { background: #46BDB5; border-color: #46BDB5; color: #fff; }

/* ---------- footer ---------- */
.sds-footer {
  text-align: center;
  color: var(--sds-muted);
  font-size: 13px;
  padding: 36px 16px 28px;
}
.sds-footer .sds-footer-script {
  font-family: var(--sds-serif);
  font-style: italic;
  font-size: 19px;
  color: #6E655E;
  margin-bottom: 6px;
}

/* ---------- tablet ---------- */
@media (max-width: 991.98px) {
  .sds-hero { gap: 28px; }
  .sds-portrait { width: 180px; height: 180px; }
  .sds-grid, .sds-col { gap: 18px; }
}

/* ---------- mobile ---------- */
@media (max-width: 767.98px) {
  .sds-page { font-size: 14.5px; }
  .sds-wrap { padding: 28px 16px 16px; }

  .sds-hero {
    flex-direction: column;
    text-align: center;
    gap: 18px;
    margin-bottom: 24px;
  }
  .sds-portrait { width: 168px; height: 168px; padding: 6px; }
  .sds-name { font-size: clamp(46px, 13vw, 62px); }
  .sds-name--long { font-size: clamp(38px, 10vw, 50px); }
  .sds-name--xl   { font-size: clamp(32px, 8.5vw, 42px); }
  .sds-dedication { font-size: 19px; margin-left: auto; margin-right: auto; }

  .sds-grid { grid-template-columns: 1fr; gap: 16px; }
  .sds-col { display: contents; }           /* merge columns, then put sections in reading order */
  .sds-o1 { order: 1; } .sds-o2 { order: 2; } .sds-o3 { order: 3; } .sds-o4 { order: 4; }
  .sds-o5 { order: 5; } .sds-o6 { order: 6; } .sds-o7 { order: 7; }
  .sds-hero { padding: 24px 18px; border-radius: 20px; }
  .sds-card { padding: 20px 18px 22px; }
  .sds-title { font-size: 21px; }
  .sds-doodle--paw-top { display: none; }
  .sds-card--doodle { padding-bottom: 48px; }

  .sds-photos { grid-template-columns: 1.3fr 1fr; grid-auto-rows: 100px; gap: 8px; }
  .sds-photos a:nth-child(2) { grid-column: auto; }
   .sds-photos--4 a:nth-child(4) { grid-column: span 2; }      /* 4th photo fills the last row */
  /* 5+ photos on phones: big first photo, then 2 per row */
  .sds-photos--many { grid-template-columns: 1fr 1fr; grid-auto-rows: 120px; }
  .sds-photos--many a:first-child { grid-column: span 2; grid-row: span 2; }
  .sds-photos--many a:last-child:nth-child(3n+2),
  .sds-photos--many a:last-child:nth-child(3n+1) { grid-column: auto; }
  .sds-photos--many a:last-child:nth-child(even) { grid-column: span 2; }  /* single last photo: full width */
  .sds-photos--2 { grid-template-columns: 1fr 1fr; grid-auto-rows: 150px; }
  .sds-photos--1 { grid-auto-rows: 220px; }

  .sds-sprig { width: 150px; height: 220px; }
  .sds-sprig--tr, .sds-sprig--ml { display: none; }
  .sds-sprig--tl { top: -40px; left: -55px; opacity: .7; }
  .sds-sprig--br { bottom: 10px; right: -60px; opacity: .5; }

  .sds-share { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .sds-photos a img, .sds-btn { transition: none; }
}

/* =========================================================
   Visitors: light a candle, memories from family & friends
   ========================================================= */

/* ---------- candle box (hero, right side) ---------- */
.sds-hero-text { flex: 1 1 340px; }

/* candle on top, Add a memory below, so the name keeps its room */
.sds-candle-box {
  flex: 0 0 290px;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 14px 16px 14px 14px;
  background: rgba(255, 255, 255, .85);
  border: 1px solid var(--sds-line);
  border-radius: var(--sds-radius);
  box-shadow: var(--sds-shadow);
  backdrop-filter: blur(4px);
}
.sds-candle-box form { margin: 0; }

.sds-candle {
  display: flex; align-items: center; gap: 12px;
  background: none; border: 0; padding: 0;
  text-align: left; color: var(--sds-text);
  cursor: pointer;
}
.sds-candle:disabled { cursor: default; }

.sds-candle-icon {
  flex: 0 0 auto;
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--sds-teal);
  box-shadow: 0 0 0 0 rgba(84, 205, 197, .45);
  transition: box-shadow .4s ease, transform .2s ease;
}
.sds-candle:not(:disabled):hover .sds-candle-icon { transform: scale(1.06); }

/* unlit: faint flame; lit: warm glowing flame */
.sds-flame      { fill: #ffffff; opacity: .35; transform-origin: 16px 14px; transition: fill .4s, opacity .4s; }
.sds-flame-core { fill: #ffffff; opacity: 0; transition: opacity .4s; }
.sds-candle.is-lit .sds-flame      { fill: #FFB24D; opacity: 1; animation: sds-flicker 1.6s ease-in-out infinite; }
.sds-candle.is-lit .sds-flame-core { fill: #FFF3C4; opacity: 1; }
.sds-candle.is-lit .sds-candle-icon { box-shadow: 0 0 0 6px rgba(255, 178, 77, .18), 0 0 22px rgba(255, 178, 77, .55); }

@keyframes sds-flicker {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25%      { transform: scale(1.06, .96) rotate(-2deg); }
  50%      { transform: scale(.96, 1.05) rotate(1.5deg); }
  75%      { transform: scale(1.03, .98) rotate(-1deg); }
}

.sds-candle-text { display: flex; flex-direction: column; }
.sds-candle-title {
  font-family: var(--sds-serif);
  font-style: italic;
  font-size: 19px;
  line-height: 1.2;
}
.sds-candle-count {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sds-muted);
  margin-top: 3px;
  white-space: nowrap;
}
.sds-add-memory { justify-content: center; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; padding: 11px 22px; }

/* ---------- family & friends ---------- */
.sds-note {
  background: var(--sds-wash-sage);
  color: #4F5E43;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 14px;
}

.sds-tribute-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.sds-card--wide .sds-tribute-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* first 4 show; "View all" reveals the rest */
.sds-tribute-list:not(.show-all) > .sds-tribute:nth-child(n+5) { display: none; }

.sds-tribute {
  display: flex; flex-direction: column;
  background: #FFFDF9;
  border: 1px solid var(--sds-line);
  border-radius: 12px;
  padding: 14px 16px 10px;
  min-width: 0;
}
.sds-tribute.is-new { animation: sds-in .5s ease; border-color: #CFE3D9; }
@keyframes sds-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.sds-tribute-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sds-avatar {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px;
}
.sds-tribute-who { min-width: 0; flex: 1 1 auto; }
.sds-tribute-name { font-weight: 700; font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
.sds-tribute-rel  { font-size: 12px; color: var(--sds-muted); line-height: 1.25; }
.sds-tribute-date { font-size: 11.5px; color: var(--sds-muted); white-space: nowrap; align-self: flex-start; }

.sds-tribute-text {
  font-size: 13.5px;
  line-height: 1.6;
  color: #4A433D;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sds-tribute-text.is-open { display: block; -webkit-line-clamp: unset; }
.sds-readmore {
  align-self: flex-start;
  background: none; border: 0; padding: 2px 0 0;
  font-size: 12.5px; font-weight: 600; color: #4C6FA8; cursor: pointer;
}

.sds-tribute-foot {
  margin-top: auto;
  padding-top: 8px;
  display: flex; align-items: center; justify-content: space-between;
}
.sds-heart {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; padding: 4px 6px 4px 0;
  font-size: 13px; font-weight: 600; color: var(--sds-muted);
  cursor: pointer;
}
.sds-heart svg { fill: none; stroke: var(--sds-terracotta); stroke-width: 2; transition: transform .2s, fill .2s; }
.sds-heart:not(:disabled):hover svg { transform: scale(1.15); }
.sds-heart.is-on { color: var(--sds-terracotta); cursor: default; }
.sds-heart.is-on svg { fill: var(--sds-terracotta); animation: sds-pop .35s ease; }
@keyframes sds-pop { 50% { transform: scale(1.3); } }

.sds-tribute-empty p {
  margin: 4px 0 0;
  font-family: var(--sds-serif);
  font-style: italic;
  font-size: 19px;
  color: #6E655E;
}
.sds-tribute-more { margin-top: 16px; }

/* ---------- add a memory form ---------- */
.sds-tribute-form {
  background: #FFFDF9;
  border: 1px solid var(--sds-line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
.sds-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.sds-field { display: block; margin-bottom: 12px; }
.sds-field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.sds-field em { color: var(--sds-terracotta); font-style: normal; }
.sds-field small { font-weight: 400; color: var(--sds-muted); }
.sds-field input,
.sds-field textarea {
  width: 100%;
  border: 1px solid #E4DACB;
  border-radius: 10px;
  padding: 9px 12px;
  font: 14px/1.5 var(--sds-sans);
  color: var(--sds-text);
  background: #fff;
}
.sds-field input:focus,
.sds-field textarea:focus { outline: none; border-color: var(--sds-teal); box-shadow: 0 0 0 3px rgba(84, 205, 197, .2); }
.sds-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.sds-form-hint { margin: -2px 0 12px; font-size: 12.5px; color: var(--sds-muted); }
.sds-form-errors {
  background: #FBEDE7; color: #8A3F27;
  border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: 13.5px;
}
.sds-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- candle + memories: tablet / mobile ---------- */
@media (max-width: 991.98px) {
  .sds-hero { flex-wrap: wrap; }
  .sds-candle-box { flex: 1 1 100%; margin-top: 0; flex-direction: row; align-items: center; justify-content: space-between; }
}

@media (max-width: 767.98px) {
  .sds-candle-box { width: 100%; flex-direction: column; align-items: stretch; gap: 12px; text-align: left; }
  .sds-name { overflow-wrap: anywhere; }
  .sds-hero-text { flex-basis: auto; }
  .sds-add-memory { justify-content: center; }
  .sds-tribute-list,
  .sds-card--wide .sds-tribute-list { grid-template-columns: 1fr; }
  .sds-form-row { grid-template-columns: 1fr; gap: 0; }
  .sds-form-actions .sds-btn { flex: 1 1 0; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .sds-candle.is-lit .sds-flame, .sds-tribute.is-new, .sds-heart.is-on svg { animation: none; }
}

/* =========================================================
   All memories page
   ========================================================= */
.sds-back {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: #6E655E;
  text-decoration: none;
}
.sds-back:hover { color: var(--sds-terracotta); }

.sds-hero--compact { padding: 22px 28px; gap: 24px; }
.sds-portrait--sm {
  width: 112px; height: 112px;
  padding: 5px;
  display: block;
}
.sds-portrait--sm::after { inset: -6px; }
.sds-portrait--sm .sds-portrait-empty { width: 100%; height: 100%; display: block; }
.sds-name--compact { font-size: clamp(38px, 4vw, 56px); margin-bottom: 4px; }
.sds-hero-action { flex: 0 0 auto; align-self: center; }

.sds-page-of { font-size: 13px; color: var(--sds-muted); margin-top: 8px; white-space: nowrap; }

.sds-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--sds-line);
}
.sds-pager-pages { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.sds-pager-num {
  min-width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  font-size: 14px; font-weight: 600;
  color: var(--sds-text);
  text-decoration: none;
  border: 1px solid transparent;
}
.sds-pager-num:hover { border-color: var(--sds-line); background: #fff; color: var(--sds-text); }
.sds-pager-num.is-current { background: var(--sds-teal); color: #fff; }
.sds-pager-gap { color: var(--sds-muted); padding: 0 2px; }
.sds-btn.is-disabled { opacity: .45; pointer-events: none; }

.sds-footer-link { color: #6E655E; font-weight: 600; text-decoration: none; }
.sds-footer-link:hover { color: var(--sds-terracotta); }

@media (max-width: 767.98px) {
  .sds-hero--compact { padding: 22px 16px; }
  .sds-page-of { display: none; }
  .sds-portrait--sm { width: 96px; height: 96px; }
  .sds-name--compact { font-size: clamp(34px, 10vw, 46px); }
  .sds-hero-action { width: 100%; }
  .sds-hero-action .sds-btn { width: 100%; justify-content: center; }
  .sds-pager { flex-wrap: wrap; }
  .sds-pager-pages { order: -1; flex-basis: 100%; }
  .sds-pager > .sds-btn { flex: 1 1 0; justify-content: center; }
}

/* ---------- A Legacy That Grows (bottom of every memorial page) ---------- */
.sds-wrap--legacy { padding-top: 8px; padding-bottom: 0; }

.sds-legacy {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 34px 32px 36px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(228, 235, 221, .75) 0%, rgba(250, 247, 241, .7) 55%, rgba(243, 228, 205, .6) 100%);
  border: 1px solid rgba(168, 182, 154, .35);
}
.sds-legacy .sds-title { margin-bottom: 12px; }
.sds-legacy p {
  max-width: 640px;
  margin: 0 auto;
  font-family: var(--sds-serif);
  font-style: italic;
  font-size: 20px;
  line-height: 1.55;
  color: #4F5E43;
  position: relative;
  z-index: 1;
}
/* soft leaves in the corners, like a coffee plant */
.sds-legacy-leaf,
.sds-legacy::after {
  content: '';
  position: absolute;
  width: 120px; height: 175px;
  background: url('../img/memorial/sprig.svg') no-repeat center / contain;
  opacity: .55;
  pointer-events: none;
}
.sds-legacy-leaf { left: -18px; bottom: -40px; transform: rotate(-18deg); }
.sds-legacy::after { right: -18px; top: -45px; transform: scaleX(-1) rotate(160deg); }

@media (max-width: 767.98px) {
  .sds-legacy { padding: 26px 18px 28px; border-radius: 20px; }
  .sds-legacy p { font-size: 18px; }
  .sds-legacy-leaf, .sds-legacy::after { width: 80px; height: 120px; opacity: .4; }
}