/* robertchesney.info — quiet, warm memorial styling */
:root {
  --paper: #f6f1e9;
  --card: #fffdf9;
  --ink: #2b2622;
  --muted: #6f655b;
  --rule: #e2d8c9;
  --accent: #6b4a33;
  --accent-soft: #efe5d7;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --measure: 40rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.7;
}
img, video, iframe { max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--card); padding: .5rem 1rem; }
.skip:focus { left: 1rem; z-index: 10; }

/* ---------- header ---------- */
.site-header {
  text-align: center;
  padding: 3rem 1.25rem 0;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(var(--card), var(--paper));
}
.site-title { display: inline-block; text-decoration: none; color: var(--ink); }
.site-title .name {
  display: block;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: normal;
  letter-spacing: 0.02em;
  line-height: 1.15;
}
.site-title .dates {
  display: block;
  margin-top: .35rem;
  color: var(--muted);
  font-size: .95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.site-header nav ul {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem 1.75rem;
}
.site-header nav a {
  display: inline-block;
  padding: .6rem 0 .8rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 1rem;
  border-bottom: 2px solid transparent;
}
.site-header nav a:hover { color: var(--ink); }
.site-header nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- layout ---------- */
main { padding: 2.5rem 1.25rem 3rem; }
.prose, .tributes, .share { max-width: var(--measure); margin: 0 auto; }
.wide { max-width: 68rem; margin: 0 auto; }
h1, h2 { font-weight: normal; line-height: 1.25; }
h1 { font-size: 2.1rem; margin: 0 0 1.25rem; }
h2 { font-size: 1.5rem; margin: 2.5rem 0 1rem; }
.wide h1, .wide .lede { max-width: var(--measure); margin-left: auto; margin-right: auto; }
.lede { color: var(--muted); font-style: italic; }
.meta { color: var(--muted); font-size: .95rem; margin: 0 0 .5rem; }
.address { padding-left: 1.25rem; border-left: 3px solid var(--accent-soft); }

/* life story */
.story p:first-child::first-letter {
  float: left;
  font-size: 3.6em;
  line-height: .85;
  padding: .08em .1em 0 0;
  color: var(--accent);
}

/* video */
.video { margin: 0 0 2.75rem; }
.video video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #1d1a17;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(60, 40, 20, .18);
}
figcaption { color: var(--muted); font-size: .9rem; text-align: center; margin-top: .6rem; }

.portrait { margin: 0 0 1.75rem; text-align: center; }
.portrait img { width: 300px; height: auto; border-radius: 4px; box-shadow: 0 6px 20px rgba(60, 40, 20, .15); }

/* map */
.map { margin: 1.75rem 0 0; }
.map iframe { width: 100%; height: 340px; border: 1px solid var(--rule); border-radius: 6px; background: var(--card); }

/* ---------- gallery (justified rows, original order, no cropping) ---------- */
.gallery { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.5rem; }
.gallery::after { content: ""; flex-grow: 999; }
.g-item {
  flex: calc(var(--r) * 100) 1 calc(var(--r) * 210px);
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: var(--accent-soft);
  aspect-ratio: var(--r);
}
.g-item img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease, filter .35s ease; }
.g-item:hover img { transform: scale(1.03); filter: brightness(1.04); }
@media (max-width: 520px) {
  .g-item { flex-basis: calc(var(--r) * 140px); }
}

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20, 16, 12, .94);
  display: none;
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 6rem);
  width: auto; height: auto;
  border-radius: 3px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
  user-select: none;
}
.lightbox button {
  position: absolute;
  background: rgba(255, 255, 255, .1);
  color: #f3ece2;
  border: 0;
  border-radius: 999px;
  width: 3rem; height: 3rem;
  font-size: 1.6rem; line-height: 1;
  cursor: pointer;
}
.lightbox button:hover { background: rgba(255, 255, 255, .22); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 1rem; left: 0; right: 0; text-align: center; color: #cfc4b6; font-size: .95rem; }
@media (max-width: 600px) {
  .lb-prev, .lb-next { top: auto; bottom: .6rem; transform: none; }
}

/* ---------- tributes ---------- */
.tributes { margin-top: 3rem; }
.tribute {
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 1.1rem 1.35rem .4rem;
  margin: 0 0 1.25rem;
}
.tribute header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; margin-bottom: .4rem; }
.tribute-name { font-weight: bold; }
.tribute time { color: var(--muted); font-size: .9rem; }
.tribute p { margin: 0 0 .8rem; }

.share {
  margin-top: 2.5rem;
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
}
.share h2 { margin-top: 0; font-size: 1.3rem; }
.share p { margin: 0; }

/* updates */
.update { border-bottom: 1px solid var(--rule); padding-bottom: 1.25rem; }
.update h2 { margin-bottom: .25rem; }
.update h2 a { color: var(--ink); text-decoration: none; }
.update h2 a:hover { color: var(--accent); }
.update .portrait img { width: 220px; }

.contact-email { font-size: 1.2rem; margin-top: 1.5rem; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  text-align: center;
  color: var(--muted);
  font-size: .95rem;
  font-style: italic;
  padding: 2rem 1rem 2.5rem;
}

@media (max-width: 600px) {
  body { font-size: 1.06rem; }
  .site-header { padding-top: 2rem; }
  .site-header nav ul { gap: 0 1.1rem; }
  h1 { font-size: 1.8rem; }
  main { padding-top: 1.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  .g-item img { transition: none; }
}
