/* Main Street Media — public obituary site.
   Written from scratch: quiet, high-contrast, fast. Nothing here is derived
   from any other obituary platform's stylesheet or markup. */

:root {
  color-scheme: light;
  --ink:        #1b1b1a;
  --ink-soft:   #5d5c58;
  --ink-faint:  #8b8a85;
  --rule:       #e2e0da;
  --rule-soft:  #efedE7;
  --paper:      #ffffff;
  --ground:     #f7f6f2;
  --accent:     #0f4c81;
  --measure:    36rem;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
}

.wrap {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.sr, .skip {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip:focus {
  position: static; width: auto; height: auto; clip: auto;
  display: inline-block; margin: .5rem; padding: .5rem .75rem;
  background: var(--paper); border: 2px solid var(--accent);
}

a { color: var(--accent); }
a:hover { color: #0b3a63; }

/* ---------- masthead ---------- */

.masthead {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding-top: env(safe-area-inset-top, 0px);
}

.masthead-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem 1.5rem;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}

.masthead-titles { display: flex; align-items: baseline; flex-wrap: wrap; gap: .6rem; }

.paper {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--ink);
  text-decoration: none;
}
.paper:hover { color: var(--accent); }
.section:hover { color: var(--accent); }

.section {
  text-decoration: none;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--ink-faint);
  padding-left: .6rem;
  border-left: 1px solid var(--rule);
}

.find { display: flex; gap: .4rem; }
.find input {
  font: inherit;
  padding: .42rem .6rem;
  width: 13rem;
  max-width: 48vw;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
}
.find input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.find button {
  font: inherit;
  padding: .42rem .85rem;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.find button:hover { background: #0b3a63; }

/* ---------- shared ---------- */

main.wrap { padding-top: 2rem; padding-bottom: 3rem; }

.page-title {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 1.25rem;
}

.empty, .result-count { color: var(--ink-soft); }
.back { margin-top: 2.5rem; font-size: .9rem; }

/* ---------- list ---------- */

.notice-list { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--rule); border-radius: 3px; }
.notice-item + .notice-item { border-top: 1px solid var(--rule-soft); }

.notice-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .95rem 1.1rem;
  text-decoration: none;
  color: inherit;
}
.notice-link:hover { background: #fbfaf7; }
.notice-link:hover .notice-name { color: var(--accent); }

.thumb { flex: 0 0 auto; }
.thumb img, .thumb-blank {
  display: block;
  width: 64px; height: 64px;
  object-fit: cover;
  border-radius: 2px;
  background: var(--ground);
  border: 1px solid var(--rule);
}
.thumb-blank { border-style: dashed; }

.notice-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.notice-name {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.3;
}
.notice-meta { font-size: .88rem; color: var(--ink-soft); }
.dot { color: var(--ink-faint); }

.scope-offer {
  margin: .25rem 0 1.1rem;
  font-size: .9rem;
  color: var(--ink-soft);
}
.notice-paper { font-style: italic; }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  font-size: .9rem;
}
.pager-count { color: var(--ink-faint); }

/* ---------- one notice ---------- */

.notice {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 2.25rem 1.5rem 2rem;
  text-align: center;
}

.portrait { margin: 0 0 1.4rem; }
.portrait img {
  width: 190px;
  max-width: 62%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--rule);
  background: var(--ground);
}

.deceased {
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 600;
  margin: 0 0 .5rem;
}

.dates { margin: 0; color: var(--ink-soft); font-size: .98rem; }
.hometown { margin: .15rem 0 0; color: var(--ink-faint); font-size: .92rem; }

.body {
  margin: 2rem auto 0;
  max-width: var(--measure);
  text-align: left;
}
.body p { margin: 0 0 1.05em; }
.body p:last-child { margin-bottom: 0; }

/* Links come from the notices themselves — funeral home sites, donation pages.
   Long URLs must wrap rather than push the column wider on a phone. */
.body a, .services a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}
.body a:hover, .services a:hover { color: #0b3a63; }

.services {
  margin: 2.25rem auto 0;
  max-width: var(--measure);
  text-align: left;
  border-top: 1px solid var(--rule-soft);
  padding-top: 1.35rem;
}
.services h2 {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--ink-faint);
  font-weight: 600;
  margin: 0 0 .7rem;
}
.services p { margin: 0 0 .5em; }
.services .home { font-weight: 600; }

/* ---------- house ad ---------- */

.house-ad { margin: 2rem 0 0; text-align: center; }
.ad-label {
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--ink-faint);
  margin: 0 0 .4rem;
}
.ad-inner {
  display: block;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  color: inherit;
}
.ad-inner:hover { border-color: var(--accent); }
.ad-inner img { display: block; margin: 0 auto .6rem; max-width: 100%; height: auto; }
.ad-headline { display: block; font-family: var(--serif); font-size: 1.1rem; font-weight: 600; }
.ad-body { display: block; font-size: .92rem; color: var(--ink-soft); margin-top: .2rem; }

/* ---------- ad positions ---------- */

/* top sits under the masthead, footer above the site footer; both run the
   full width of the column so a sold banner has room to breathe. */
.ad-top { padding-top: 1.25rem; }
.ad-top .house-ad { margin-top: 0; }
.ad-foot { padding-bottom: .5rem; }

/* inside the list, an ad is a row like any other but visibly set apart */
.notice-item-ad { padding: .9rem 1.1rem; background: #fbfaf7; }
.notice-item-ad .house-ad { margin: 0; }
.notice-item-ad .ad-inner { border-style: dashed; }

/* ---------- archive, related, share ---------- */

.crumbs { font-size: .85rem; color: var(--ink-faint); margin: 0 0 1rem; }
.crumbs a { color: var(--ink-soft); }
.crumbs span { margin: 0 .3rem; }

.year-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .6rem;
}
.year-grid a {
  display: block; padding: .8rem .9rem; text-decoration: none; color: inherit;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 3px;
}
.year-grid a:hover { border-color: var(--accent); }
.year-grid strong { display: block; font-family: var(--serif); font-size: 1.05rem; }
.year-grid span { font-size: .84rem; color: var(--ink-soft); }

.related { margin-top: 2.5rem; }
.related h2 {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .16em;
  color: var(--ink-faint); font-weight: 600; margin: 0 0 .7rem;
}

.share {
  margin: 1.5rem 0 0; text-align: center;
  font-size: .88rem; color: var(--ink-faint);
}
.share-label { margin-right: .5rem; text-transform: uppercase; letter-spacing: .12em; font-size: .68rem; }
.share a { margin: 0 .4rem; }

.ad-gam { min-height: 90px; padding: 0; border: 0; background: transparent; }

/* ---------- the paper's own headlines ---------- */

.headlines {
  margin-top: 2rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1.1rem 1.25rem;
}
.headlines h2 {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .16em;
  color: var(--ink-faint); font-weight: 600; margin: 0 0 .7rem;
}
.headlines ul { list-style: none; margin: 0; padding: 0; }
.headlines li + li { margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--rule-soft); }
.headlines a { font-family: var(--serif); font-size: 1rem; text-decoration: none; }
.headlines a:hover { text-decoration: underline; }
.headlines-more { margin: .9rem 0 0; font-size: .85rem; }

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--rule);
  background: var(--paper);
  padding: 1.5rem 0 calc(1.5rem + env(safe-area-inset-bottom, 0px));
  font-size: .86rem;
  color: var(--ink-soft);
}
.foot p { margin: 0 0 .35rem; }
.foot-links a { margin-right: .35rem; }

/* ---------- narrow screens ---------- */

@media (max-width: 34rem) {
  .masthead-row { flex-direction: column; align-items: stretch; }
  .find input { width: 100%; max-width: none; flex: 1 1 auto; }
  .notice { padding: 1.75rem 1.1rem 1.5rem; }
  .deceased { font-size: 1.6rem; }
  .thumb img, .thumb-blank { width: 54px; height: 54px; }
}

@media print {
  .masthead .find, .house-ad, .pager, .back, .foot-links { display: none; }
  body { background: #fff; }
  .notice { border: 0; padding: 0; }
}
