/* Matthew 20:16 — The Remembrance Project */
:root { --paper: #f8f6ef; --green: #263f35; --ink: #29372e; --muted: #596358; --line: #d8dbcf; --sage: #e9eddf; --gold: #9d8050; --gold-text: #6f5a33; color-scheme: light; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 25px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 1.65; }
body:has(dialog[open]) { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a, select { touch-action: manipulation; }
button { cursor: pointer; }
img { max-width: 100%; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }

header { max-width: 1320px; margin: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding: 30px 60px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; font-family: Georgia, serif; font-size: 25px; line-height: 1.25; }
.brand-mark { font-size: 40px; color: var(--gold); }
.brand small { display: block; font-family: Arial, sans-serif; font-size: 10px; letter-spacing: 2px; margin-top: 7px; color: var(--muted); }
.brand-number { font-size: 22px; }
nav { display: flex; gap: 32px; font-size: 14px; }
header nav a { display: inline-block; padding: 12px 0; }
nav a:hover, .text-link:hover { color: var(--gold-text); }
main { max-width: 1320px; margin: auto; }

.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 50px; padding: 74px 60px 60px; align-items: center; }
.eyebrow { font-size: 11px; letter-spacing: 2px; font-weight: 700; color: var(--muted); margin: 0 0 20px; }
h1, h2, h3 { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; line-height: 1.13; letter-spacing: -1.4px; margin: 0; color: var(--green); }
h1 { font-size: clamp(40px, 4.6vw, 62px); }
em { font-weight: 400; color: #5b6849; }
h2 { font-size: 41px; }
h3 { font-size: 24px; letter-spacing: -.5px; }
.intro { font-size: 17px; color: var(--muted); margin: 26px 0 30px; }
.primary { display: inline-flex; gap: 28px; align-items: center; justify-content: space-between; background: var(--green); border: 1px solid var(--green); color: #fff; padding: 15px 21px; font-size: 14px; min-height: 48px; }
.primary:hover { background: #3f5748; }
.hero-foot { font-size: 13px; line-height: 1.65; margin-top: 32px; color: var(--muted); border-left: 2px solid #b4bd9f; padding-left: 15px; }
.hero-photo { margin: 0; position: relative; padding-top: 14px; }
.hero-photo::before { content: ''; position: absolute; inset: 0 15px 38px -14px; border: 1px solid #c0c9ae; border-radius: 200px 200px 0 0; z-index: -1; }
.hero-photo img { display: block; width: 100%; height: 370px; object-fit: cover; object-position: 54% center; border-radius: 200px 200px 3px 3px; filter: saturate(.65); }
figcaption { font-size: 12px; color: var(--muted); text-align: right; margin-top: 12px; letter-spacing: .3px; }

.directory { padding: 62px 60px 70px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 30px; gap: 25px; }
.section-heading .eyebrow { margin-bottom: 12px; }
.section-heading > p { font-size: 14px; color: var(--muted); margin: 0 0 4px; }
.searchbar { display: flex; gap: 20px; align-items: flex-end; background: var(--sage); padding: 25px; }
.search-field { flex: 1; }
.searchbar label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; }
.input-wrap { position: relative; }
.input-wrap span { position: absolute; font-size: 26px; left: 14px; top: 3px; color: #4b5644; }
input, select { color: var(--ink); background: #fffdf8; border: 1px solid #8f9886; border-radius: 0; }
input { width: 100%; height: 48px; padding: 10px 15px 10px 44px; font-size: 15px; }
.year-field select { height: 48px; min-width: 148px; padding: 10px; }
.searchbar button { height: 48px; }
.results-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 20px; margin: 25px 0 14px; font-size: 14px; color: var(--muted); }
.results-meta p { margin: 0; }
.sort-label select { border: 1px solid transparent; border-bottom-color: #8f9886; background: transparent; padding: 10px 3px; margin-left: 6px; font-size: 14px; min-height: 44px; }
#results-title:focus { outline: none; }
.results { display: block; }
.people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 26px; }
.person { background: none; border: 0; border-top: 1px solid var(--line); padding: 24px 0; display: flex; align-items: center; justify-content: space-between; gap: 15px; text-align: left; color: var(--ink); width: 100%; height: 100%; }
.person strong { display: block; font-family: Georgia, serif; font-size: 20px; font-weight: 400; line-height: 1.25; margin-bottom: 7px; overflow-wrap: anywhere; color: var(--green); }
.person small { display: block; font-size: 13px; color: var(--muted); }
.person .arrow { font-size: 18px; color: #6f7a63; flex: none; transition: transform .15s; }
.person:hover strong { color: #5f6c3d; }
.person:hover .arrow { transform: translateX(3px); }
.person:hover { background: #efefe6; }
.badge { display: inline-block !important; margin-top: 6px; border: 1px solid var(--gold); color: var(--gold-text) !important; border-radius: 999px; padding: 0 10px; font-size: 12px !important; font-weight: 700; }
.pagination { display: flex; justify-content: center; gap: 26px; align-items: center; font-size: 14px; margin: 22px 0; }
.pagination[hidden] { display: none; }
.secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; background: transparent; border: 1px solid #8f9886; padding: 8px 16px; color: var(--ink); font-size: 14px; }
.secondary:hover:not(:disabled) { background: var(--sage); }
.secondary:disabled { opacity: .45; cursor: default; }
.source-note { font-size: 13px; color: var(--muted); max-width: 660px; margin: 28px auto 0; text-align: center; }
.empty { padding: 30px; text-align: center; border-top: 1px solid var(--line); }
.empty ul { display: inline-block; text-align: left; margin: 14px 0; padding-left: 1.2rem; color: var(--muted); }
.empty button { margin-top: 5px; }

.services { padding: 62px 60px 65px; background: #eeeee4; }
.service-row { display: grid; grid-template-columns: 75px 1fr auto; gap: 25px; border-top: 1px solid #c8cdbc; padding: 24px 0; align-items: center; }
.service-year { font-family: Georgia, serif; font-size: 30px; color: #5f6b52; }
.service-row h3 { font-size: 24px; }
.service-row p { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.service-row .service-explain { max-width: 34rem; }
.service-links { display: flex; gap: 16px; align-items: center; font-size: 13px; flex-wrap: wrap; justify-content: flex-end; }
.service-links a { border-bottom: 1px solid #8f9886; padding: 10px 0 3px; }
.service-links a:hover { color: var(--gold-text); }
.service-links .muted { font-size: 13px; }
.service-row details { grid-column: 2 / -1; font-size: 14px; }
summary { cursor: pointer; display: inline-block; border-bottom: 1px solid #8f9886; padding: 8px 0 3px; }
.service-names { columns: 3; column-gap: 30px; margin-top: 20px; }
.service-names button { display: block; background: none; border: 0; color: var(--ink); padding: 8px 0; text-align: left; font-size: 14px; break-inside: avoid; min-height: 36px; }
.service-names button:hover { text-decoration: underline; }

.about { padding: 78px 60px; display: grid; grid-template-columns: 1fr 1fr; gap: 28px 80px; }
.about > .eyebrow { grid-column: 1 / -1; margin: 0; }
.about h2 { font-size: 46px; }
.about > div p { font-size: 15px; color: var(--muted); margin: 0 0 20px; }
.text-link { display: inline-block; font-size: 14px; border-bottom: 1px solid #8f9886; padding: 10px 0 6px; }
.partner-link { margin-top: 10px; }
.church-identity { display: flex; align-items: center; gap: 20px; margin-bottom: 26px; font-family: Georgia, serif; font-size: 24px; line-height: 1.3; color: var(--green); }
.church-identity img { width: 112px; height: 112px; object-fit: contain; border-radius: 50%; flex-shrink: 0; }
.church-identity small { display: block; font-family: Arial, sans-serif; font-size: 13px; color: var(--muted); margin-top: 8px; }
.church-identity:hover span { color: var(--gold-text); }

footer { background: var(--green); color: #eceee1; padding: 34px 60px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 25px; }
footer .brand { display: block; font-size: 21px; color: #fff; }
footer .brand small { color: #cdd5c2; }
footer p, footer > a:last-child { font-size: 14px; margin: 0; }
footer > a:last-child { padding: 12px 0; border-bottom: 1px solid #8fa68b; }
footer :focus-visible { outline-color: #e6c878; }
.noscript { margin: 1rem; padding: 1rem; background: #fff; border: 1px solid var(--gold); }

dialog { border: 1px solid #cdd2c3; background: var(--paper); color: var(--ink); padding: 55px 45px; max-width: 540px; width: calc(100% - 32px); max-height: calc(100dvh - 2rem); }
dialog::backdrop { background: rgba(20, 35, 27, .58); }
dialog h2 { font-size: 38px; padding-right: 2rem; overflow-wrap: anywhere; margin-bottom: 14px; }
dialog h2:focus { outline: none; }
dialog hr { border: 0; border-top: 1px solid var(--line); margin: 30px 0; }
dialog p { font-size: 15px; }
#life-dates { margin: 0; }
.life-row { display: block; }
.close { position: absolute; top: 8px; right: 10px; width: 44px; height: 44px; border: 0; background: none; color: var(--ink); font-size: 30px; line-height: 1; }
.close:hover { color: var(--gold-text); }
.dialog-note { margin-top: 30px; color: var(--muted); font-size: 13px !important; }
.resources { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 24px; }
.resources p { margin: 0; }
#memorial-resources .review { margin-top: 24px; padding: 12px 16px; background: #eeeee4; border-left: 3px solid var(--gold); font-size: 14px; }
.review strong { display: block; }

@media (max-width: 900px) {
  header { padding: 24px 28px; }
  nav { gap: 16px; font-size: 13px; }
  .hero { padding: 55px 28px; gap: 28px; }
  .hero-photo img { height: 330px; }
  .directory, .services { padding: 48px 28px; }
  .people { grid-template-columns: repeat(2, 1fr); }
  .about { padding: 55px 28px; gap: 24px; }
  .searchbar { gap: 12px; padding: 18px; }
  .service-links { flex-direction: column; align-items: flex-start; gap: 4px; }
  footer { padding: 30px 28px; }
}
@media (max-width: 600px) {
  header { align-items: flex-start; gap: 6px; padding: 18px 22px 8px; }
  .brand { font-size: 21px; }
  .brand-mark { font-size: 30px; }
  .brand small { font-size: 9px; letter-spacing: 1.3px; }
  nav { gap: 4px 18px; flex-wrap: wrap; font-size: 13px; }
  .hero { display: block; padding: 40px 22px; }
  .hero-photo { margin-top: 30px; }
  .hero-photo img { height: 250px; }
  .hero-foot { display: none; }
  .hero br, .about h2 br { display: none; }
  h1 { font-size: 43px; }
  h2 { font-size: 32px; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 16px; }
  .directory, .services { padding: 40px 22px; }
  .searchbar { flex-wrap: wrap; }
  .search-field { flex-basis: 100%; }
  .year-field { flex: 1; }
  .year-field select { width: 100%; }
  .searchbar button { gap: 10px; }
  .people { grid-template-columns: 1fr; }
  .person { padding: 19px 0; }
  .service-row { grid-template-columns: 52px 1fr; gap: 16px; }
  .service-year { font-size: 23px; }
  .service-row h3 { font-size: 21px; }
  .service-links { grid-column: 2; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; }
  .service-row details { grid-column: 2; }
  .service-names { columns: 1; }
  .about { display: block; padding: 45px 22px; }
  .about h2 { font-size: 38px; margin: 20px 0 25px; }
  .church-identity { gap: 16px; font-size: 22px; }
  .church-identity img { width: 90px; height: 90px; }
  footer { display: block; padding: 30px 22px; }
  footer p { margin: 20px 0; }
  .pagination { gap: 14px; }
  dialog { padding: 45px 25px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
@media print { header, .searchbar, .pagination, .skip, dialog { display: none !important; } body { background: #fff; } }

.skip { position: absolute; top: -100px; left: 0; }
.skip:focus { top: 0; z-index: 5; background: #fff; padding: 15px; }
