/* ============================================================
   Church Records · Rowlands Wesleyan Chapel
   Visual language adapted from jamestattersall.com
   ============================================================ */

:root {
  /* Palette from jamestattersall.com CLAUDE.md */
  --navy: #285185;          /* links, nav */
  --teal: #2A403D;           /* document text, primary actions */
  --sage: #748B6F;           /* document accents */
  --green: #64766A;          /* historical context */
  --amber: #D67940;          /* view pill borders */
  --rose: #6F4849;           /* highlights */

  /* Surface tones — warm off-whites and parchments, no grey */
  --paper: #F7F4ED;          /* page background */
  --card: #FBF9F4;           /* slightly lighter for cards */
  --rule: rgba(42, 64, 61, 0.14);
  --rule-soft: rgba(42, 64, 61, 0.08);

  /* Pill background — matches "light yellow View pill" pattern */
  --pill-bg: #FBF1DC;

  /* Typography */
  --font-serif: 'Crimson Pro', 'Iowan Old Style', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --container-max: 1180px;
  --pad-x: 2rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--paper);
  color: var(--teal);
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a {
  color: var(--navy);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

/* ============ HEADER ============ */
.site-header {
  border-bottom: 1px solid var(--rule);
  padding: 1.5rem 0 1.25rem;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2rem;
  flex-wrap: wrap;
}

.site-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  color: var(--teal);
}

.site-title em {
  font-style: normal;
  font-weight: 400;
  color: var(--green);
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
}

.site-nav a {
  color: var(--navy);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: border-color 0.2s;
}

.site-nav a:hover { border-bottom-color: var(--navy); text-decoration: none; }

.site-nav a.current { color: var(--teal); border-bottom-color: var(--teal); }

/* ============ HERO ============ */
.hero {
  padding: 4rem 0 2.5rem;
  border-bottom: 1px solid var(--rule);
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

.hero-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--green);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 1.75rem;
  height: 1px;
  background: var(--green);
}

.hero h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.25rem, 5.5vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--teal);
  max-width: 18ch;
  font-variation-settings: "opsz" 60;
}

.hero-sub {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--teal);
  max-width: 60ch;
  margin-top: 1.25rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--green);
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule-soft);
}

.hero-meta strong {
  font-weight: 500;
  color: var(--teal);
  margin-right: 0.5rem;
}

.hero-figure {
  margin-top: 1rem;
}

.hero-figure img {
  width: 100%;
  height: auto;
  display: block;
  filter: contrast(1.05);
}

.hero-figure figcaption {
  margin-top: 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--green);
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
}

.hero-figure figcaption::before {
  content: '';
  display: inline-block;
  width: 1.25rem;
  height: 1px;
  background: var(--green);
  flex-shrink: 0;
  transform: translateY(-3px);
}

/* ============ PROSE / STORY ============ */
.story {
  padding: 4rem 0 3rem;
}

.story .container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-width: 880px;
}

.story-section {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 2.5rem;
  padding: 3rem 0;
  border-top: 1px solid var(--rule-soft);
}

.story-section:first-child {
  border-top: none;
  padding-top: 0;
}

.story-year {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
  padding-top: 0.625rem;
}

.story-content h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.6vw, 1.875rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--teal);
  margin-bottom: 1rem;
  font-variation-settings: "opsz" 36;
}

.story-content p {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--teal);
  margin-bottom: 1rem;
  max-width: 60ch;
}

.story-content p:last-child { margin-bottom: 0; }

.story-content figure {
  margin: 1.75rem 0 0.5rem;
}

.story-content figure img {
  width: 100%;
  max-width: 640px;
  height: auto;
  display: block;
  filter: contrast(1.05);
}

.story-content figcaption {
  margin-top: 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--green);
  max-width: 60ch;
}

.story-content em {
  font-style: italic;
  color: var(--rose);
}

/* Inline View pill — matches jamestattersall.com motif */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--pill-bg);
  border: 1px solid var(--amber);
  color: var(--teal);
  padding: 0.125rem 0.625rem 0.1875rem;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease;
  white-space: nowrap;
  vertical-align: 1px;
}

.pill:hover {
  background: #F7E5C2;
  text-decoration: none;
}

/* ============ GALLERY ============ */
.gallery {
  padding: 3rem 0 4rem;
  background: var(--card);
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
}

.gallery h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.6vw, 1.875rem);
  letter-spacing: -0.01em;
  color: var(--teal);
  margin-bottom: 0.5rem;
}

.gallery-intro {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--green);
  max-width: 60ch;
  margin-bottom: 2.5rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.75rem;
}

.gallery-item figure { margin: 0; }

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  filter: contrast(1.05);
  border: 1px solid var(--rule-soft);
}

.gallery-item figcaption {
  margin-top: 0.625rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--green);
  line-height: 1.45;
}

.gallery-item figcaption strong {
  color: var(--teal);
  font-weight: 500;
  margin-right: 0.375rem;
}

/* ============ TODAY / RESEARCH SECTION ============ */
.today {
  padding: 4rem 0;
}

.today .container {
  max-width: 880px;
}

.today h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.6vw, 1.875rem);
  letter-spacing: -0.01em;
  color: var(--teal);
  margin-bottom: 1.25rem;
}

.today p {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--teal);
  margin-bottom: 1rem;
  max-width: 60ch;
}

.today p:last-child { margin-bottom: 0; }

.research-links {
  margin-top: 2rem;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--rule-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ============ GRAVES PAGE ============ */
.page-header {
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--rule);
}

.page-header .container {
  max-width: 880px;
}

.page-header h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--teal);
  margin-bottom: 1rem;
  font-variation-settings: "opsz" 60;
}

.page-header p {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--teal);
  max-width: 60ch;
  margin-bottom: 1rem;
}

.page-header p:last-of-type { margin-bottom: 0; }

.plan-figure {
  padding: 3rem 0 2rem;
}

.plan-figure figure { margin: 0; }

.plan-figure img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--rule);
  background: #fff;
}

.plan-figure figcaption {
  margin-top: 0.875rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--green);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
}

.index-section {
  padding: 2rem 0 5rem;
}

.index-section h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.6vw, 1.875rem);
  letter-spacing: -0.01em;
  color: var(--teal);
  margin-bottom: 1rem;
}

.index-section .intro {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--green);
  max-width: 60ch;
  margin-bottom: 1.5rem;
}

.search-bar {
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.search-bar input {
  flex: 1;
  min-width: 200px;
  max-width: 360px;
  padding: 0.625rem 0.875rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--teal);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s;
}

.search-bar input:focus { border-color: var(--navy); }

.search-bar .count {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--green);
}

.plot-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
}

.plot-table thead th {
  text-align: left;
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--green);
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--rule);
  background: var(--card);
}

.plot-table thead th:first-child { width: 5rem; }

.plot-table tbody td {
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--rule-soft);
  color: var(--teal);
  vertical-align: top;
}

.plot-table tbody tr.empty td {
  color: var(--green);
  font-style: italic;
}

.plot-table tbody tr:hover {
  background: var(--card);
}

.plot-table .plot-num {
  font-variant-numeric: tabular-nums;
  color: var(--amber);
  font-weight: 500;
}

.plot-table .surname {
  font-weight: 500;
}

/* ============ FOOTER ============ */
.site-footer {
  margin-top: auto;
  padding: 1.75rem 0 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--green);
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2rem;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--navy);
  text-decoration: none;
}

.site-footer a:hover { text-decoration: underline; }

.site-footer .credit em {
  font-style: italic;
  color: var(--teal);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 700px) {
  :root { --pad-x: 1.25rem; }

  .site-header .container { gap: 1rem; }

  .hero { padding: 2.5rem 0 2rem; }

  .story { padding: 2.5rem 0 2rem; }

  .story-section {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 2rem 0;
  }

  .story-year { padding-top: 0; }

  .gallery { padding: 2.5rem 0 3rem; }

  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .today { padding: 2.5rem 0; }

  .page-header { padding: 2rem 0 1.5rem; }

  .plan-figure { padding: 2rem 0 1rem; }

  .index-section { padding: 1.5rem 0 3rem; }

  .plot-table { font-size: 0.875rem; }
  .plot-table thead th, .plot-table tbody td {
    padding: 0.5rem 0.625rem;
  }
}
