:root {
  --bg: #f4efe6;
  --surface: #fffdf8;
  --surface-soft: #f8f2e8;
  --text: #2f2a24;
  --muted: #6e6459;
  --accent: #7a4a24;
  --accent-dark: #533119;
  --green: #566b3f;
  --green-dark: #3f512e;
  --border: #ddcfbc;
  --warning: #8b6b1f;
  --shadow: 0 18px 45px rgba(63, 43, 24, 0.12);
  --radius: 18px;
  --content-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(122, 74, 36, 0.10), transparent 34rem),
    linear-gradient(180deg, #eee5d8 0, var(--bg) 24rem, var(--bg) 100%);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.65;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(122, 74, 36, 0.35);
  outline-offset: 3px;
}

.site-header {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(55, 67, 39, 0.97), rgba(89, 55, 28, 0.94)),
    url('/img/bcgen-banner05.gif') center/cover;
}
.site-header::after {
  position: absolute;
  inset: 0;
  content: '';
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
}
.header-inner {
  position: relative;
  z-index: 1;
  width: min(var(--content-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 44px;
}
.eyebrow {
  margin: 0 0 8px;
  color: #eee1bf;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}
h1 {
  max-width: 900px;
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(2.15rem, 6vw, 4.4rem);
  font-weight: 500;
  line-height: 1.08;
  text-wrap: balance;
}
.header-description {
  max-width: 760px;
  margin: 16px 0 0;
  color: #f6ecda;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.top-nav {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(83,49,25,.18);
  background: rgba(255,253,248,.96);
  backdrop-filter: blur(10px);
}
.top-nav-inner {
  display: flex;
  width: min(var(--content-width), calc(100% - 24px));
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: thin;
}
.top-nav a {
  flex: 0 0 auto;
  padding: 14px 15px;
  color: var(--text);
  font-size: .93rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.top-nav a:hover, .top-nav a[aria-current='page'] {
  color: #fff;
  background: var(--accent);
}

.page {
  width: min(var(--content-width), calc(100% - 32px));
  margin: 30px auto 60px;
}
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: .9rem;
}
.breadcrumbs a { color: var(--muted); }
.panel {
  padding: clamp(22px, 4vw, 38px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 22px; }
.panel h2, .section-title {
  margin-top: 0;
  color: var(--accent-dark);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  font-weight: 500;
  line-height: 1.2;
}
.lead {
  color: #453d34;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.1rem;
}
.archive-note {
  margin: 24px 0 0;
  padding: 16px 18px;
  color: #4c432f;
  background: #f6efd7;
  border: 1px solid #dfd09d;
  border-left: 5px solid #a68734;
  border-radius: 10px;
}

.search-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin: 22px 0;
}
.search-input {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  color: var(--text);
  background: #fff;
  border: 1px solid #bda98f;
  border-radius: 10px;
  font: inherit;
}
.result-count {
  display: flex;
  min-height: 48px;
  align-items: center;
  padding: 0 15px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  white-space: nowrap;
}
.letter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 22px;
}
.letter-nav a {
  display: grid;
  min-width: 36px;
  min-height: 36px;
  place-items: center;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}
.letter-nav a:hover { color: #fff; background: var(--green); border-color: var(--green); }
.name-group { scroll-margin-top: 80px; }
.name-group + .name-group { margin-top: 26px; }
.name-group h2 {
  display: flex;
  margin: 0 0 12px;
  align-items: center;
  gap: 12px;
  color: var(--green-dark);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.75rem;
}
.name-group h2::after { flex: 1; height: 1px; content: ''; background: var(--border); }
.name-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.person-entry {
  min-width: 0;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-wrap: anywhere;
}
.person-entry a { font-weight: 700; }
.person-dates { color: var(--muted); font-size: .94rem; }
.empty-results { display: none; padding: 20px; color: var(--muted); text-align: center; }

.record-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}
.record-block {
  min-width: 0;
  padding: 20px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.record-block.record-heading {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}
.record-block.children-heading {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.genealogy-record {
  max-width: 100%;
  margin: 0;
  overflow-x: auto;
  color: inherit;
  font-family: 'Courier New', Courier, monospace;
  font-size: .96rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.record-block.record-heading a, .record-block.children-heading a { color: #fff; }
.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-top: 22px;
}
.page-nav a, .button-link {
  display: inline-flex;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 9px;
  font-weight: 700;
  text-decoration: none;
}
.page-nav a:hover, .button-link:hover { color: #fff; background: var(--accent-dark); }
.record-source {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
}

.school-index {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.school-card, .year-card {
  padding: 22px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 13px;
}
.school-card h2, .year-card h2 {
  margin: 0 0 9px;
  color: var(--green-dark);
  font-family: Georgia, 'Times New Roman', serif;
}
.year-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}
.graduate-list { margin: 0; padding-left: 22px; }
.graduate-list li { margin: 5px 0; }
.no-graduates { margin: 0; color: var(--muted); font-style: italic; }

.banner-small {
  display: block;
  width: min(100%, 420px);
  margin: 0 auto 22px;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(0,0,0,.12);
}
.site-footer {
  padding: 28px 16px;
  color: #e9dfd0;
  text-align: center;
  background: #33291f;
}
.site-footer p { margin: 5px 0; }
.site-footer a { color: #f2d6ad; }

@media (max-width: 800px) {
  .name-list, .year-grid, .school-index { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .header-inner { padding: 42px 0 36px; }
  .page { width: min(100% - 20px, var(--content-width)); margin-top: 20px; }
  .panel { padding: 20px 17px; border-radius: 14px; }
  .search-tools { grid-template-columns: 1fr; }
  .result-count { justify-content: center; }
  .record-block { padding: 16px 13px; }
  .genealogy-record { font-size: .88rem; }
  .page-nav { display: grid; grid-template-columns: 1fr; }
  .page-nav a { width: 100%; }
}
