/* Eturnal Rest -- obituary pages: the create form, the detail page, and the
   guestbook. Additive on top of tokens.css + base.css + info.css, and it
   deliberately reuses tribute.css for anything the memorial pages already
   solved (portrait, life dates, memory wall spacing).

   MOBILE FIRST, and not as a slogan. Nearly every visit to an obituary arrives
   from a text message or a Facebook post on a phone, often from someone in
   their seventies. Tap targets are finger-sized, the type does not shrink, and
   nothing important is behind a hover. */

/* ---- hero ---- */
.obit-hero {
  max-width: 640px;
}
.obit-portrait {
  width: 180px;
  height: 180px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin: var(--space-4) 0 var(--space-5);
  box-shadow: var(--shadow-md);
  background: var(--blue-50);
}
.obit-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.obit-dates {
  color: var(--ink-2);
  margin: 0 0 var(--space-2);
}

/* ---- held notice ---- */
.obit-held {
  background: var(--blue-25);
  border: 1px solid var(--line-cool);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  color: var(--ink-2);
  font-size: 0.95rem;
  margin: 0;
}

/* ---- services ---- */
.obit-services {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-5);
}
.obit-services h2 {
  margin-top: 0;
}
.obit-services__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.obit-service + .obit-service {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line-soft);
}
.obit-service p {
  margin: 0;
}
.obit-service__label {
  font-weight: 700;
  color: var(--ink);
}
.obit-service__when {
  color: var(--ink);
}
.obit-service__place,
.obit-service__address {
  color: var(--ink-2);
  font-size: 0.95rem;
}
/* Weeks later the times are history, so they fold away rather than leading a
   page somebody now visits to remember rather than to attend. */
.obit-services--past summary {
  cursor: pointer;
  color: var(--ink-2);
  padding: var(--space-3) 0;
}

/* ---- share ---- */
.obit-share {
  text-align: center;
  padding: var(--space-5) 0;
}
.obit-share__lede {
  color: var(--ink-2);
  margin: 0 0 var(--space-4);
}
.obit-share__row {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}
.obit-share__channels {
  list-style: none;
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  flex-wrap: wrap;
  margin: var(--space-4) 0 0;
  padding: 0;
}
.obit-share__channels a {
  display: inline-block;
  /* 44px minimum touch target. These get tapped by people who are upset and
     not looking carefully. */
  min-height: 44px;
  line-height: 28px;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  text-decoration: none;
  color: var(--ink-2);
  font-size: 0.95rem;
}
.obit-share__channels a:hover,
.obit-share__channels a:focus-visible {
  border-color: var(--blue-600);
  color: var(--blue-700);
}
/* Calendar row sits under the sharing chips and reads as a quieter, different
   kind of action. */
.obit-share__channels--cal {
  margin-top: var(--space-3);
}
.obit-share__channels--cal a {
  border-style: dashed;
  font-size: 0.9rem;
}
.obit-share__status {
  min-height: 1.4em;
  margin: var(--space-3) 0 0;
  color: var(--ink-2);
  font-size: 0.9rem;
}
/* The clipboard fallback. Hidden until a copy fails, then revealed and
   selected so the text can still be taken with two taps. */
.obit-share__text {
  width: 100%;
  box-sizing: border-box;
  min-height: 8rem;
  margin: var(--space-3) 0 0;
  padding: var(--space-3);
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  resize: vertical;
}

/* ---- the printed program ---- */
.obit-program {
  margin: var(--space-5) 0 0;
  text-align: left;
  border-top: 1px solid var(--line-soft);
  padding-top: var(--space-4);
}
.obit-program > summary {
  cursor: pointer;
  color: var(--ink-2);
  font-size: 0.95rem;
  padding: var(--space-2) 0;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.obit-program__body p {
  color: var(--ink-3);
  font-size: 0.9rem;
  margin: 0 0 var(--space-4);
}
.obit-program__qr {
  width: 168px;
  margin: 0 0 var(--space-4);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
}
.obit-program__qr svg {
  display: block;
  width: 100%;
  height: auto;
}
.obit-program__actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* ---- story ---- */
.obit-story p {
  margin: 0 0 var(--space-4);
}

/* ---- memory wall ---- */
.obit-wall__intro {
  color: var(--ink-2);
}
.obit-wall {
  list-style: none;
  margin: var(--space-5) 0;
  padding: 0;
}
.obit-entry {
  padding: var(--space-4) 0;
  border-top: 1px solid var(--line-soft);
}
.obit-entry:first-child {
  border-top: 0;
}
.obit-entry__author {
  font-weight: 700;
  margin: 0 0 var(--space-1);
  color: var(--ink);
}
.obit-entry__body {
  margin: 0;
  color: var(--ink-2);
  white-space: pre-wrap;
}
.obit-entry__photo {
  margin: var(--space-3) 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.obit-entry__photo img {
  display: block;
  width: 100%;
  height: auto;
}
.obit-candle {
  font-size: 1.1em;
}
.obit-entry--pending {
  opacity: 0.7;
}

/* ---- forms (shared by the create page and the guestbook) ---- */
.obit-fieldset {
  border: 0;
  border-top: 1px solid var(--line-soft);
  margin: 0 0 var(--space-6);
  padding: var(--space-6) 0 0;
}
.obit-fieldset:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.obit-fieldset legend {
  font-family: var(--font-display, inherit);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  padding: 0;
  margin: 0 0 var(--space-2);
}
.obit-fieldset legend em {
  font-style: normal;
  font-weight: 400;
  color: var(--ink-3);
  font-size: 0.9rem;
}
.obit-field {
  display: block;
  margin: 0 0 var(--space-4);
}
.obit-field > span {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 var(--space-2);
}
.obit-field > span em {
  font-style: normal;
  font-weight: 400;
  color: var(--ink-3);
}
.obit-field .input {
  width: 100%;
  box-sizing: border-box;
  /* 16px minimum: anything smaller makes iOS Safari zoom the page on focus,
     which loses the person's place in a long form. */
  font-size: 16px;
  min-height: 48px;
}
.obit-field textarea.input {
  min-height: 160px;
  line-height: 1.6;
  resize: vertical;
}
.obit-field__note {
  color: var(--ink-3);
  font-size: 0.9rem;
  margin: 0 0 var(--space-4);
}
.obit-field-row {
  display: grid;
  gap: var(--space-4);
}
@media (min-width: 640px) {
  .obit-field-row {
    grid-template-columns: 1fr 1fr;
  }
}
.obit-check {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  font-size: 0.95rem;
  color: var(--ink-2);
  margin: 0 0 var(--space-4);
}
.obit-check input {
  margin-top: 3px;
  width: 20px;
  height: 20px;
  flex: none;
}

/* ---- photo picker ---- */
.obit-photo__input {
  position: absolute;
  left: -9999px;
}
.obit-photo__preview {
  margin: var(--space-4) 0 0;
}
.obit-photo__preview img {
  display: block;
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.obit-photo__remove {
  background: none;
  border: 0;
  padding: var(--space-2) 0;
  color: var(--ink-3);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.9rem;
}
.obit-photo__status {
  min-height: 1.4em;
  margin: var(--space-2) 0 0;
  color: var(--ink-3);
  font-size: 0.9rem;
}

/* ---- service repeater ---- */
/* btn--sm renders at 34px, which is under the 44px minimum and is being tapped
   by someone upset and not looking carefully. The button keeps its quiet
   size-small look and gets a finger-sized landing area. */
[data-add-service] {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.obit-service-row {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  margin: 0 0 var(--space-4);
}
.obit-service-row__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-3);
}
.obit-service-row__remove {
  background: none;
  border: 0;
  color: var(--ink-3);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.9rem;
  padding: var(--space-2);
}

/* ---- actions and status ---- */
.obit-form__actions,
.obit-entry-form__actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin: var(--space-5) 0 0;
}
.obit-form__status,
.obit-entry-form__status {
  min-height: 1.4em;
  margin: var(--space-3) 0 0;
  color: var(--ink-2);
}
.obit-form__status[data-tone="error"],
.obit-entry-form__status[data-tone="error"] {
  color: var(--accent-800);
}
.obit-form__legal {
  color: var(--ink-3);
  font-size: 0.85rem;
  margin: var(--space-5) 0 0;
}

/* ---- guestbook form ---- */
.obit-entry-form {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-5);
  margin: var(--space-6) 0 0;
}
.obit-entry-form__title {
  margin: 0 0 var(--space-4);
  font-size: 1.1rem;
}

/* ---- published confirmation ---- */
.obit-done {
  text-align: center;
  padding: var(--space-6) 0;
}
.obit-done__lede {
  color: var(--ink-2);
}
.obit-done__url {
  background: var(--blue-25);
  border: 1px solid var(--line-cool);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  word-break: break-all;
  font-size: 1rem;
}
.obit-done__actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
  margin: var(--space-5) 0 0;
}
.obit-done__note,
.obit-done__status {
  color: var(--ink-3);
  font-size: 0.9rem;
  margin: var(--space-4) 0 0;
}

/* ---- keep exploring: the marketplace hand-off ---- */
/* Quiet on purpose, and absent entirely for the first 30 days after a death
   (functions/api/_obituary.js showMarketplaceBlock). This is a memorial, not a
   landing page, and the styling has to agree with that. */
.obit-explore {
  border-top: 1px solid var(--line-soft);
  padding-top: var(--space-5);
}
.obit-explore h2 {
  font-size: 1.1rem;
  color: var(--ink-2);
}
.obit-explore p {
  color: var(--ink-3);
  font-size: 0.95rem;
}

/* ---- index extras ---- */
.tribute-list__place {
  color: var(--ink-3);
  font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
  .obit-share__channels a {
    transition: none;
  }
}

/* ---- hub page ---------------------------------------------------------- */
/* The empty state is going to BE the live page for a while, so it gets real
   styling rather than looking like a failed query. */
.obit-empty {
  text-align: center;
  padding: var(--space-7) var(--space-4);
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.obit-empty h2 {
  margin-top: 0;
  font-size: 1.25rem;
}
.obit-empty p {
  max-width: 46ch;
  margin-left: auto;
  margin-right: auto;
}
.obit-faq h3 {
  font-size: 1.05rem;
  margin: var(--space-5) 0 var(--space-2);
}
.obit-faq h3:first-child {
  margin-top: 0;
}
.obit-faq p {
  margin: 0;
  line-height: 1.65;
}

/* ---- the index, full width -------------------------------------------
   A list of names is the one thing on this site that genuinely wants the whole
   page. At 2,009 entries a 720px column is a single endless stripe with
   two-thirds of the screen empty beside it, so the list flows into columns.

   .tribute-list is display:grid in tribute.css, and CSS multi-column is
   IGNORED on a grid container, so it has to be reset to block here. That is
   why the first attempt at this computed columnCount:4 and still rendered as
   one column. */
.obit-lede {
  max-width: 60ch;
}
.obit-index .tribute-list {
  display: block;
  columns: 1;
  column-gap: var(--space-7);
}
@media (min-width: 640px) {
  .obit-index .tribute-list {
    columns: 2;
  }
}
@media (min-width: 1000px) {
  .obit-index .tribute-list {
    columns: 3;
  }
}
@media (min-width: 1300px) {
  .obit-index .tribute-list {
    columns: 4;
  }
}
.obit-index .tribute-list li {
  /* A name must never be split across a column break. */
  break-inside: avoid;
  page-break-inside: avoid;
  margin: 0 0 var(--space-3);
}

/* Search, letter jump row, and group headings. These lived in an inline
   <style> block on the old /tributes/ index, which folded into this page. They
   are rewritten against the real design tokens rather than the
   var(--color-border, #d8d8d8) fallbacks they used, which never resolved. */
.tribute-search {
  margin: 0 0 var(--space-4);
  max-width: 30rem;
}
.tribute-search input {
  width: 100%;
  box-sizing: border-box;
  padding: var(--space-3) var(--space-4);
  /* 16px minimum or iOS Safari zooms the page on focus. */
  font-size: 16px;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
}
.tribute-search__status {
  margin: var(--space-2) 0 0;
  color: var(--ink-3);
  font-size: 0.9rem;
}
.az-jump {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-6);
}
.az-jump__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  min-height: 36px;
  padding: 0 var(--space-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  text-decoration: none;
  color: var(--ink-2);
  font-size: 0.9rem;
}
.az-jump__link:hover,
.az-jump__link:focus-visible {
  border-color: var(--blue-600);
  color: var(--blue-700);
}
/* Touch screens: the letters are hard to hit for our older visitors, so give
   each one a finger-sized landing area. */
@media (pointer: coarse) {
  .az-jump {
    gap: var(--space-2);
  }
  .az-jump__link {
    min-width: 2.6rem;
    min-height: 44px;
  }
}
.tribute-group {
  margin: var(--space-6) 0 var(--space-3);
  font-size: 1.15rem;
  /* Clears the sticky header when a letter link jumps here. */
  scroll-margin-top: 5rem;
  /* Do not strand a heading at the foot of a column. */
  break-after: avoid;
  page-break-after: avoid;
}
.tribute-empty {
  color: var(--ink-3);
}

/* The questions read better in two columns than as one long scroll, once the
   page is wide enough for the measure to stay comfortable. */
@media (min-width: 900px) {
  .obit-faq--cols {
    columns: 2;
    column-gap: var(--space-8);
  }
  .obit-faq--cols h3,
  .obit-faq--cols p {
    break-inside: avoid;
  }
  .obit-faq--cols h3 {
    break-after: avoid;
  }
}
