:root {
  --color-parchment: #F5EBD8;
  --color-cream: #FFF9EF;
  --color-ink: #241B14;
  --color-walnut: #4A2E1F;
  --color-oxblood: #7A2E2E;
  --color-heritage-blue: #31475C;
  --color-sage: #5F6F52;
  --color-antique-brass: #B08A3C;
  --color-muted: #5d5046;
  --color-focus: #1f5f8b;
  --font-body: Georgia, "Times New Roman", serif;
  --font-ui: Arial, Helvetica, sans-serif;
  --content-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  color: var(--color-ink);
  background: var(--color-cream);
  font-family: var(--font-body);
  font-size: 100%;
  line-height: 1.6;
}

body {
  margin: 0;
}

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

a {
  color: var(--color-oxblood);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover,
a:focus {
  color: var(--color-heritage-blue);
}

a:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--color-cream);
  border: 2px solid var(--color-focus);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  background: linear-gradient(90deg, rgba(36, 27, 20, 0.92), rgba(74, 46, 31, 0.7) 48%, rgba(49, 71, 92, 0.28)), var(--header-image, url("../legacy/images/TR_History/TR_Winter-Train-02.jpg")) center / cover;
  color: #fff;
}

.cemeteries-header {
  --header-image: url("../legacy/images/Riverside/genRiversideCem3Rivers2.jpg");
}

.atlas-header {
  --header-image: url("../legacy/images/SJC_Atlas_Banner.jpg");
}

.biographies-header {
  --header-image: url("../legacy/images/SJC_LarkinFarmLeonidas-02.jpg");
}

.census-header {
  --header-image: url("../legacy/images/SJC_atlastitle.jpg");
}

.history-header {
  --header-image: url("../legacy/images/Colon_History_Photos/Colon_Downtown_1911B.png");
}

.marriages-header {
  --header-image: url("../legacy/images/SJC_LarkinFarmLeonidas.jpg");
}

.military-header {
  --header-image: url("../legacy/images/Riverside/genWilcoxEdwardE.jpg");
}

.newspapers-header {
  --header-image: url("../legacy/images/Colon_History_Photos/Colon_Downtown_1911B.png");
}

.obits-header {
  --header-image: url("../legacy/images/TR_History/Rohrer_Cigar_Store.png");
}

.resources-header {
  --header-image: url("../legacy/images/St_Joseph_Map.png");
}

.vital-header {
  --header-image: url("../legacy/images/SJC_TRHospital-02.jpg");
}

.churches-header {
  --header-image: url("../legacy/images/BrickChapel_pics/PrudenceD_Davis _Brick_Chapel.jpg");
}

.school-header {
  --header-image: url("../legacy/images/Colon_History_Photos/LeslieHarman_ClassPic_1908.jpg");
}

.site-header__inner {
  width: min(100% - 2rem, var(--content-width));
  min-height: 22rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 3rem 0;
}

.site-header--compact .site-header__inner {
  min-height: 15rem;
}

.site-kicker {
  margin: 0 0 0.4rem;
  color: #F2D38B;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  line-height: 1.18;
}

h1 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(2.25rem, 6vw, 4.8rem);
}

h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

p {
  margin: 0 0 1rem;
}

.site-intro {
  max-width: 42rem;
  margin: 1rem 0 0;
  font-size: 1.25rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.site-nav {
  border-block: 1px solid var(--color-antique-brass);
  background: var(--color-parchment);
  box-shadow: 0 2px 14px rgba(36, 27, 20, 0.08);
}

.site-nav ul {
  width: min(100% - 2rem, var(--content-width));
  margin: 0 auto;
  padding: 0.75rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
}

.site-nav a {
  display: block;
  min-height: 2.5rem;
  padding: 0.45rem 0.75rem;
  border-bottom: 3px solid transparent;
  border-radius: 4px;
  color: var(--color-walnut);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus,
.site-nav a[aria-current="page"] {
  background: var(--color-heritage-blue);
  border-bottom-color: var(--color-antique-brass);
  color: #fff;
}

.content-band {
  padding: 3rem 1rem;
}

.content-band--muted {
  background: var(--color-parchment);
  border-block: 1px solid var(--color-antique-brass);
}

.content-narrow {
  width: min(100%, 760px);
  margin: 0 auto;
}

.section-heading {
  width: min(100%, var(--content-width));
  margin: 0 auto 1.25rem;
}

.feature-layout {
  width: min(100%, var(--content-width));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 26rem);
  gap: 2rem;
  align-items: center;
}

.feature-layout--reverse {
  grid-template-columns: minmax(18rem, 26rem) minmax(0, 1fr);
}

.feature-copy {
  max-width: 42rem;
}

.context-photo {
  margin: 0;
  border: 1px solid rgba(74, 46, 31, 0.3);
  border-radius: 6px;
  overflow: hidden;
  background: var(--color-walnut);
  box-shadow: 0 12px 30px rgba(36, 27, 20, 0.16);
}

.context-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: sepia(0.1) saturate(0.95) contrast(1.02);
}

.context-photo figcaption {
  padding: 0.65rem 0.8rem;
  border-top: 4px solid var(--color-antique-brass);
  background: var(--color-cream);
  color: var(--color-muted);
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

.record-grid {
  width: min(100%, var(--content-width));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.record-grid--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.record-card {
  padding: 1rem;
  border: 1px solid rgba(74, 46, 31, 0.22);
  border-top: 4px solid var(--color-oxblood);
  border-radius: 6px;
  background: var(--color-cream);
  box-shadow: 0 8px 18px rgba(36, 27, 20, 0.08);
}

.record-card h3 {
  margin: 0 0 0.65rem;
  color: var(--color-walnut);
  font-size: 1.2rem;
  line-height: 1.25;
}

.record-card ul {
  margin: 0;
  padding-left: 1.2rem;
}

.record-card li {
  margin: 0.35rem 0;
}

.letter-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1.5rem;
}

.letter-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  min-height: 2.1rem;
  padding: 0.25rem 0.5rem;
  border: 2px solid var(--color-heritage-blue);
  border-radius: 4px;
  background: var(--color-cream);
  color: var(--color-heritage-blue);
  font-family: var(--font-ui);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.letter-links a:hover,
.letter-links a:focus-visible {
  background: var(--color-heritage-blue);
  color: #fff;
}

.note {
  color: var(--color-muted);
  font-size: 0.94em;
}

.source-note {
  padding: 1rem;
  border-left: 5px solid var(--color-sage);
  background: var(--color-cream);
}

.breadcrumb {
  margin: 0 0 1rem;
  color: var(--color-muted);
  font-family: var(--font-ui);
  font-size: 0.95rem;
}

.article-shell {
  width: min(100%, 58rem);
  margin: 0 auto;
}

.article-shell .source-note {
  margin-bottom: 1.5rem;
}

.article-body {
  padding: 1.25rem;
  border: 1px solid rgba(74, 46, 31, 0.18);
  border-radius: 6px;
  background: var(--color-cream);
  box-shadow: 0 8px 18px rgba(36, 27, 20, 0.07);
}

.article-body p,
.article-body li {
  line-height: 1.75;
}

.article-body p:first-child {
  margin-top: 0;
}

.article-body img {
  display: block;
  max-width: min(100%, 32rem);
  height: auto;
  margin: 1.25rem auto;
  border: 1px solid rgba(74, 46, 31, 0.22);
  background: var(--color-parchment);
}

.article-body strong {
  color: var(--color-walnut);
}

.biography-directory {
  list-style: none;
  padding-left: 0;
}

.biography-directory li {
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(74, 46, 31, 0.16);
}

.biography-directory [hidden] {
  display: none;
}

.floating-page-nav {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 0.45rem;
  border: 1px solid rgba(74, 46, 31, 0.28);
  border-radius: 6px;
  background: rgba(255, 249, 239, 0.96);
  box-shadow: 0 10px 24px rgba(36, 27, 20, 0.18);
}

.floating-page-nav a {
  padding: 0.4rem 0.55rem;
  border: 2px solid var(--color-heritage-blue);
  border-radius: 4px;
  background: var(--color-cream);
  color: var(--color-heritage-blue);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.floating-page-nav a:hover,
.floating-page-nav a:focus-visible {
  background: var(--color-heritage-blue);
  color: #fff;
}

.floating-page-nav a:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.biography-transcriptions > .portrait-heading {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 3px solid var(--color-antique-brass);
  font-family: var(--font-ui);
  font-size: 1.1rem;
}

.record-tools {
  width: min(100%, var(--content-width));
  margin: 0 auto 1.25rem;
  display: grid;
  gap: 0.8rem;
}

.record-search label {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--color-walnut);
  font-family: var(--font-ui);
  font-weight: 700;
}

.record-search input {
  width: 100%;
  max-width: 34rem;
  min-height: 2.8rem;
  padding: 0.55rem 0.7rem;
  border: 2px solid rgba(74, 46, 31, 0.45);
  border-radius: 4px;
  background: var(--color-cream);
  color: var(--color-ink);
  font: inherit;
}

.record-search input:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.az-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cemetery-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cemetery-filter button {
  min-height: 2.35rem;
  padding: 0.4rem 0.65rem;
  border: 2px solid var(--color-heritage-blue);
  border-radius: 4px;
  background: var(--color-cream);
  color: var(--color-heritage-blue);
  font-family: var(--font-ui);
  font-weight: 700;
  cursor: pointer;
}

.cemetery-filter button:hover,
.cemetery-filter button:focus-visible,
.cemetery-filter button[aria-pressed="true"] {
  background: var(--color-heritage-blue);
  color: #fff;
}

.cemetery-filter button:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.az-nav a {
  min-width: 2.2rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid rgba(74, 46, 31, 0.28);
  border-radius: 4px;
  background: var(--color-cream);
  color: var(--color-oxblood);
  font-family: var(--font-ui);
  font-weight: 700;
  text-align: center;
}

.record-count {
  color: var(--color-muted);
  font-family: var(--font-ui);
  font-size: 0.95rem;
}

.cemetery-table-wrap {
  width: min(100%, var(--content-width));
  max-height: 72vh;
  margin: 0 auto;
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid rgba(74, 46, 31, 0.22);
  background: var(--color-cream);
}

.cemetery-records {
  width: 100%;
  border-collapse: collapse;
}

.cemetery-records caption {
  padding: 0.75rem;
  color: var(--color-walnut);
  font-family: var(--font-ui);
  font-weight: 700;
  text-align: left;
}

.cemetery-records th,
.cemetery-records td {
  padding: 0.45rem 0.6rem;
  border-top: 1px solid rgba(74, 46, 31, 0.18);
  vertical-align: top;
  text-align: left;
}

.cemetery-records th {
  background: var(--color-walnut);
  color: var(--color-cream);
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

.cemetery-records thead th {
  position: sticky;
  top: 0;
  z-index: 3;
}

.cemetery-records th:first-child,
.cemetery-records td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 10rem;
  background: var(--color-walnut);
  color: var(--color-cream);
  box-shadow: 1px 0 0 rgba(74, 46, 31, 0.22);
}

.cemetery-records thead th:first-child {
  z-index: 4;
  background: var(--color-walnut);
}

.cemetery-records tbody tr:nth-child(even) th:first-child,
.cemetery-records tbody tr:nth-child(even) td:first-child {
  background: var(--color-walnut);
  color: var(--color-cream);
}

.cemetery-records tbody tr:nth-child(even) {
  background: var(--color-parchment);
}

.cemetery-records [hidden] {
  display: none;
}

.record-source {
  color: var(--color-muted);
  font-family: var(--font-ui);
  font-size: 0.85rem;
}

.cemetery-records th:nth-child(3),
.cemetery-records td:nth-child(3),
.cemetery-records th:nth-child(4),
.cemetery-records td:nth-child(4),
.cemetery-records th:nth-child(5),
.cemetery-records td:nth-child(5),
.cemetery-records th:nth-child(6),
.cemetery-records td:nth-child(6),
.cemetery-records th:nth-child(7),
.cemetery-records td:nth-child(7),
.cemetery-records th:nth-child(8),
.cemetery-records td:nth-child(8),
.cemetery-records th:nth-child(11),
.cemetery-records td:nth-child(11) {
  white-space: nowrap;
}

.note-cell {
  max-width: 22rem;
  white-space: nowrap;
}

.note-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 1.6rem;
  margin-left: 0.35rem;
  padding: 0.2rem 0.45rem;
  border: 2px solid var(--color-heritage-blue);
  border-radius: 4px;
  background: var(--color-cream);
  color: var(--color-heritage-blue);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.note-toggle:hover,
.note-toggle:focus-visible {
  background: var(--color-heritage-blue);
  color: #fff;
}

.note-toggle:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.note-text[hidden] {
  display: none;
}

.note-preview {
  display: inline-block;
  max-width: min(100%, 16rem);
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.note-text:not([hidden]) {
  display: block;
  max-width: 42rem;
  margin-bottom: 0.35rem;
  white-space: normal;
}

.directory-list {
  width: min(100%, var(--content-width));
  margin: 0 auto;
  columns: 2 22rem;
  column-gap: 2rem;
}

.directory-item {
  break-inside: avoid;
  margin: 0 0 0.85rem;
  padding: 0 0 0.85rem;
  border-bottom: 1px solid rgba(74, 46, 31, 0.18);
}

.data-table-wrap {
  width: min(100%, var(--content-width));
  max-height: 72vh;
  margin: 0 auto 1.5rem;
  overflow: auto;
  border: 1px solid rgba(74, 46, 31, 0.22);
  background: var(--color-cream);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table caption {
  padding: 0.75rem;
  color: var(--color-walnut);
  font-family: var(--font-ui);
  font-weight: 700;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 0.55rem 0.7rem;
  border-top: 1px solid rgba(74, 46, 31, 0.18);
  text-align: left;
  vertical-align: top;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--color-walnut);
  color: var(--color-cream);
  font-family: var(--font-ui);
}

.data-table tbody tr:nth-child(even) {
  background: var(--color-parchment);
}

.data-table [hidden] {
  display: none;
}

.marriage-index-table th:nth-child(5),
.marriage-index-table td:nth-child(5),
.marriage-index-table th:nth-child(6),
.marriage-index-table td:nth-child(6),
.marriage-index-table th:nth-child(7),
.marriage-index-table td:nth-child(7),
.marriage-returns-table th:nth-child(1),
.marriage-returns-table td:nth-child(1),
.marriage-returns-table th:nth-child(2),
.marriage-returns-table td:nth-child(2),
.marriage-returns-table th:nth-child(3),
.marriage-returns-table td:nth-child(3),
.marriage-returns-table th:nth-child(8),
.marriage-returns-table td:nth-child(8) {
  white-space: nowrap;
}

.obituary-index-table th:first-child,
.obituary-index-table td:first-child,
.newspaper-clippings-table th:first-child,
.newspaper-clippings-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--color-walnut);
  color: var(--color-cream);
  box-shadow: 1px 0 0 rgba(74, 46, 31, 0.22);
}

.obituary-index-table thead th:first-child,
.newspaper-clippings-table thead th:first-child {
  z-index: 3;
}

.obituary-index-table tbody tr:nth-child(even) th:first-child,
.obituary-index-table tbody tr:nth-child(even) td:first-child,
.newspaper-clippings-table tbody tr:nth-child(even) th:first-child,
.newspaper-clippings-table tbody tr:nth-child(even) td:first-child {
  background: var(--color-walnut);
  color: var(--color-cream);
}

.obituary-index-table th:nth-child(3),
.obituary-index-table td:nth-child(3),
.obituary-index-table th:nth-child(4),
.obituary-index-table td:nth-child(4),
.obituary-index-table th:nth-child(7),
.obituary-index-table td:nth-child(7),
.obituary-index-table th:nth-child(9),
.obituary-index-table td:nth-child(9),
.newspaper-clippings-table th:nth-child(1),
.newspaper-clippings-table td:nth-child(1),
.newspaper-clippings-table th:nth-child(2),
.newspaper-clippings-table td:nth-child(2) {
  white-space: nowrap;
}

.newspaper-clippings-table td:nth-child(3) {
  min-width: 34rem;
  line-height: 1.55;
}

.obituary-article {
  margin-bottom: 1rem;
}

.media-grid {
  width: min(100%, var(--content-width));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.context-photo--map img {
  object-fit: contain;
  background: var(--color-cream);
}

.context-photo--document img {
  aspect-ratio: auto;
  object-fit: contain;
  background: var(--color-cream);
}

.footer-links {
  margin: 0;
  padding-left: 1.25rem;
}

.footer-links li {
  margin: 0.35rem 0;
}

.site-footer {
  background: var(--color-walnut);
  color: var(--color-cream);
}

.site-footer a {
  color: #F4D28B;
}

.site-footer__inner {
  width: min(100% - 2rem, var(--content-width));
  margin: 0 auto;
  padding: 2rem 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

.site-footer h2 {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  color: #fff;
}

.site-credits {
  grid-column: 1 / -1;
  color: #E7D8BF;
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

@media (max-width: 760px) {
  .site-header__inner {
    min-height: 18rem;
  }

  .feature-layout,
  .feature-layout--reverse,
  .media-grid,
  .record-grid,
  .site-footer__inner {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 761px) and (max-width: 1020px) {
  .record-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
