:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --text: #2b2724;
  --muted: #6f6760;
  --rule: #e6e0d8;
  --accent: #8a4b2a;
  --accent-hover: #6b3519;
  --header-bg: #2b2724;
  --header-text: #faf8f5;
  --header-muted: #c9bfb4;
  --serif: "Merriweather", Georgia, "Times New Roman", serif;
  --sans: "Lato", "Helvetica Neue", Arial, sans-serif;
  --measure: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1a18;
    --surface: #24211e;
    --text: #e9e4de;
    --muted: #a59c92;
    --rule: #3a3530;
    --accent: #e0a07a;
    --accent-hover: #f0bb98;
    --header-bg: #121110;
    --header-text: #f3eee8;
    --header-muted: #a59c92;
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.75 var(--sans);
}

img { max-width: 100%; height: auto; }

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { color: var(--accent-hover); }

.inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.site-header { background: var(--header-bg); color: var(--header-text); }
.site-header > .inner { padding-top: 2.5rem; padding-bottom: 1.5rem; text-align: center; }
.site-title {
  font: 700 clamp(2rem, 6vw, 2.75rem)/1.15 var(--serif);
  color: var(--header-text);
  text-decoration: none;
}
.site-title:hover { color: var(--header-text); }
.site-description {
  margin: 0.4rem 0 0;
  color: var(--header-muted);
  font-size: 0.95rem;
  letter-spacing: 0.2em;
}

.site-nav { border-top: 1px solid rgba(255, 255, 255, 0.12); }
.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  margin-top: 0;
  margin-bottom: 0;
}
.site-nav a {
  color: var(--header-muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-nav a:hover, .site-nav a[aria-current] { color: var(--header-text); }
.site-nav a[aria-current] { border-bottom: 2px solid var(--accent); }

/* Content */
.content { padding-top: 2.5rem; padding-bottom: 3rem; }

.entry h1 {
  font: 700 clamp(1.6rem, 4.5vw, 2.1rem)/1.3 var(--serif);
  margin: 0 0 1.5rem;
}
.entry-meta { color: var(--muted); font-size: 0.9rem; margin: -1rem 0 1.5rem; }
.entry-content::after { content: ""; display: table; clear: both; }
.entry-content h2, .entry-content h3, .entry-content h4 {
  font-family: var(--serif);
  line-height: 1.35;
  margin: 2rem 0 0.5rem;
}
.entry-content h4 { font-size: 1.05rem; }
.entry-content li { margin-bottom: 0.35rem; }

.alignleft { float: left; margin: 0.35rem 1.5rem 1rem 0; max-width: 45%; }
.alignright { float: right; margin: 0.35rem 0 1rem 1.5rem; max-width: 45%; }
.aligncenter { display: block; margin: 1rem auto; }
figure { margin: 0 0 1rem; }
figure img { display: block; }
figcaption { color: var(--muted); font-size: 0.85rem; margin-top: 0.4rem; }

@media (max-width: 34rem) {
  .alignleft, .alignright { float: none; display: block; margin: 0 auto 1.25rem; max-width: 100%; }
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(13rem, 100%), 1fr));
  gap: 0.75rem;
  margin: 0 0 2rem;
  clear: both;
}
.gallery-item {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 4px;
  background: var(--rule);
  aspect-ratio: 1;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.gallery-item:hover img { transform: scale(1.04); }
.gallery-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1.5rem 0.75rem 0.5rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
  color: #fff;
  font-size: 0.85rem;
}
/* first image of a gallery gets more room when there are several */
.gallery-item:first-child:not(:only-child) { grid-column: span 2; grid-row: span 2; }
@media (max-width: 34rem) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
}
.gallery-natural { display: flex; flex-wrap: wrap; align-items: flex-start; }
.gallery-natural .gallery-item { aspect-ratio: auto; background: none; }
.gallery-natural .gallery-item img { width: auto; height: auto; max-width: 100%; }
.gallery-natural .gallery-item:first-child { grid-column: auto; grid-row: auto; }

/* Audio */
.audio-player {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.audio-player audio { width: 100%; display: block; }
.audio-download { margin: 0.75rem 0 0; font-size: 0.9rem; }

/* Sub-navigation (Terry Pickett Associates) */
.subnav {
  font-size: 0.9rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.75rem;
  margin-bottom: 2rem;
}
.subnav > a { font-weight: 700; text-decoration: none; color: var(--text); }
.subnav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; padding: 0; margin: 0.4rem 0 0; }
.subnav a[aria-current] { color: var(--text); font-weight: 700; text-decoration: none; }

/* Project pager */
.pager {
  display: flex;
  gap: 1.5rem;
  border-top: 1px solid var(--rule);
  margin-top: 2.5rem;
  padding-top: 1rem;
  font-size: 0.9rem;
}
.pager .up { margin-right: auto; }

/* Remembrances */
.comments { clear: both; margin-top: 3rem; border-top: 1px solid var(--rule); padding-top: 2rem; }
.comments h2 { font: 700 1.5rem/1.3 var(--serif); margin: 0 0 1.5rem; }
.comments ol { list-style: none; padding: 0; margin: 0; }
.comment {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}
.comment-meta { margin: 0 0 0.5rem; font-size: 0.9rem; }
.comment-meta time { color: var(--muted); margin-left: 0.5rem; }
.comment-body p { margin: 0 0 0.75rem; }
.comment-body p:last-child { margin-bottom: 0; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 1.5rem 0 2rem;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 9, 8, 0.92);
  padding: 3rem 1rem 1rem;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 7rem); object-fit: contain; }
.lightbox p { color: #eee; margin: 0.75rem 0 0; font-size: 0.9rem; min-height: 1.4em; }
.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  color: #fff;
  font-size: 2.25rem;
  line-height: 1;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  opacity: 0.8;
}
.lightbox button:hover, .lightbox button:focus-visible { opacity: 1; }
.lightbox .lb-close { top: 0.5rem; right: 0.5rem; }
.lightbox .lb-prev { left: 0.25rem; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 0.25rem; top: 50%; transform: translateY(-50%); }
