/* Jolly Bethel Church & Cemetery.
   System fonts only. No images of the place. No external assets. */

:root {
  --paper: #f3eee4;
  --paper-deep: #e7dfd0;
  --raised: #fffdf8;
  --ink: #231c16;
  --ink-soft: #3e342c;
  --green: #1c3d34;
  --green-deep: #122821;
  --link: #12362e;
  --bronze: #7a4e28;
  --focus: #7a3410;
  --rule: #d4c7b4;
  --banner-text: #f4efe6;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --content: 40rem;
  --wide: 76rem;
}

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

html {
  font-size: 112.5%;
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background-color: var(--paper-deep);
  background-image: radial-gradient(ellipse at top, #f7f3ea 0%, var(--paper) 42%, var(--paper-deep) 100%);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
}

main {
  flex: 1 0 auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

:focus {
  outline: none;
}

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

::selection {
  background: #e4d2b4;
  color: var(--ink);
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  transform: translateY(-200%);
  background: var(--raised);
  color: var(--ink);
  padding: 0.6rem 0.9rem;
  z-index: 20;
  border: 2px solid var(--green);
  text-decoration: none;
  font-family: var(--sans);
}

.skip:focus {
  transform: none;
}

.wrap {
  width: min(72rem, calc(100% - 2rem));
  margin-inline: auto;
  min-width: 0;
}

.draft-banner {
  background: var(--green-deep);
  color: var(--banner-text);
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.45;
}

.draft-banner p {
  margin: 0;
  padding: 0.65rem 0;
  text-align: center;
}

.site-header {
  background: rgba(247, 243, 234, 0.92);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 1rem 0 0.75rem;
}

.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--green-deep);
  min-height: 44px;
  justify-content: center;
}

.brand:hover .brand-name,
.brand:focus-visible .brand-name {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.brand-kicker {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bronze);
}

.brand-name {
  font-size: 1.85rem;
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 1rem;
  color: var(--ink-soft);
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.3rem 0.65rem;
  color: var(--green-deep);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 0.98rem;
  border-bottom: 2px solid transparent;
}

.nav-list a:hover {
  border-bottom-color: var(--bronze);
}

.nav-list a[aria-current="page"] {
  border-bottom-color: var(--bronze);
  font-weight: 700;
}

.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  color: var(--bronze);
  margin: 0.85rem auto;
  max-width: 16rem;
}

.ornament::before,
.ornament::after {
  content: "";
  height: 1px;
  width: 4.5rem;
  background: currentColor;
  opacity: 0.85;
}

.ornament span {
  width: 0.45rem;
  height: 0.45rem;
  border: 1px solid currentColor;
  transform: rotate(45deg);
}

.prose {
  width: min(var(--content), calc(100% - 2rem));
  margin: 0 auto 2.5rem;
  min-width: 0;
}

.prose h1 {
  font-size: clamp(2rem, 4.4vw, 3.15rem);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0.2rem 0 0.8rem;
  color: var(--green-deep);
}

.prose h2 {
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  line-height: 1.25;
  font-weight: 600;
  margin: 2.1rem 0 0.6rem;
  color: var(--green);
}

.prose h3 {
  font-size: 1.28rem;
  line-height: 1.3;
  font-weight: 600;
  margin: 1.5rem 0 0.4rem;
  color: var(--green-deep);
}

.prose p {
  margin: 0.75rem 0;
}

.home .prose h1 + p {
  color: var(--green);
  font-variant: small-caps;
  letter-spacing: 0.045em;
  font-size: 1.02rem;
  line-height: 1.45;
}

.prose a {
  color: var(--link);
  text-underline-offset: 0.18em;
}

.prose a.external,
.source-entry a.external {
  overflow-wrap: anywhere;
}

.prose ul {
  margin: 0.6rem 0 1rem;
  padding-left: 1.25rem;
}

.prose li {
  margin: 0.35rem 0;
  padding-left: 0.2rem;
}

.prose li::marker {
  color: var(--bronze);
}

.prose blockquote {
  margin: 1.35rem 0;
  padding: 0.15rem 0 0.15rem 1.15rem;
  border-left: 3px solid var(--bronze);
  font-size: 1.18rem;
  line-height: 1.5;
}

.prose blockquote p {
  margin: 0;
}

.prose hr {
  border: 0;
  height: 1px;
  margin: 2rem 0;
  background: linear-gradient(90deg, transparent, var(--bronze), transparent);
}

.jump {
  font-family: var(--sans);
  margin-top: 0;
}

.jump a {
  font-weight: 650;
}

.prose-table-scroll,
.plot-scroll {
  overflow: auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  contain: inline-size paint;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--rule);
  background: var(--raised);
}

.prose-table-scroll {
  margin: 1rem 0 1.4rem;
}

.prose-table-scroll:focus-visible,
.plot-scroll:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.prose table,
.plot-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
}

.prose th,
.prose td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.98rem;
  line-height: 1.45;
}

.prose thead th {
  background: var(--green);
  color: var(--banner-text);
  font-weight: 600;
  font-family: var(--sans);
}

.prose tbody th {
  font-weight: 600;
}

.basis-tradition {
  box-shadow: inset 3px 0 0 var(--bronze);
}

.basis-conflict {
  box-shadow: inset 3px 0 0 var(--focus);
}

.source-entry {
  scroll-margin-top: 1rem;
  padding: 0.35rem 0.55rem 0.35rem 0.75rem;
}

.source-entry:target {
  background: #f3e4c8;
  box-shadow: inset 4px 0 0 var(--focus);
}

.plot-section {
  width: min(var(--wide), 100%);
  max-width: 100%;
  margin: 0 auto 2rem;
  min-width: 0;
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid var(--rule);
  border-top: 6px solid var(--green);
  padding: 0.25rem 0 1.5rem;
  box-sizing: border-box;
}

.plot-section .prose {
  margin-bottom: 0.5rem;
}

.limitations {
  width: min(48rem, calc(100% - 2rem));
  margin: 0.5rem auto 1rem;
  background: var(--raised);
  border: 1px solid var(--rule);
  border-left: 6px solid var(--focus);
  padding: 1rem 1.15rem 0.6rem;
}

.limitations h3 {
  margin: 0 0 0.45rem;
  font-size: 1.35rem;
  line-height: 1.3;
  color: var(--green-deep);
}

.limitations p,
.limitations li {
  font-size: 1rem;
}

.limitations ul,
.limitations ol {
  margin: 0.4rem 0 0.8rem;
  padding-left: 1.2rem;
}

.dataset-notes {
  margin: 0.8rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--bronze);
}

.dataset-notes p {
  margin: 0.45rem 0;
}

.fine-label {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 0.2rem;
}

.plot-app {
  width: min(100% - 1.5rem, calc(var(--wide) - 2rem));
  max-width: calc(100% - 1.5rem);
  margin: 0 auto;
  min-width: 0;
}

.plot-tools {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem 1rem;
  margin: 0.4rem 0 0.8rem;
}

.plot-tools > * {
  min-width: 0;
}

.field label,
.status-filter legend {
  display: block;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 650;
  margin-bottom: 0.25rem;
}

input[type="search"],
select {
  font: inherit;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--raised);
  border: 1px solid #8d7d68;
  border-radius: 2px;
  padding: 0.55rem 0.7rem;
  min-height: 44px;
  width: 100%;
}

.status-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.85rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.status-options label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.95rem;
}

input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--green);
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.btn {
  font-family: var(--sans);
  font-size: 1rem;
  min-height: 44px;
  padding: 0.4rem 0.95rem;
  background: var(--green);
  color: var(--banner-text);
  border: 1px solid var(--green);
  cursor: pointer;
}

.btn:hover {
  background: var(--green-deep);
}

.btn.secondary {
  background: transparent;
  color: var(--green-deep);
}

.btn[aria-pressed="true"] {
  background: var(--green);
  color: var(--banner-text);
}

.view-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.plot-live {
  font-family: var(--sans);
  font-size: 1rem;
  margin: 0.3rem 0 0.6rem;
}

.scroll-hint {
  display: none;
  font-family: var(--sans);
  font-size: 0.92rem;
  margin: 0 0 0.45rem;
}

.plot-table {
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.4;
}

.plot-table caption {
  caption-side: top;
  text-align: left;
  padding: 0.55rem 0.7rem 0.4rem;
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink);
}

.plot-scroll {
  max-height: 70vh;
}

.plot-table th,
.plot-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

.plot-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--green);
  color: var(--banner-text);
  font-weight: 600;
}

.plot-table thead button {
  font: inherit;
  font-weight: 650;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0.55rem 0.1rem;
  min-height: 44px;
  width: 100%;
  text-align: inherit;
  cursor: pointer;
}

.plot-table thead button:focus-visible {
  outline: 3px solid var(--banner-text);
  outline-offset: 2px;
}

.sort-indicator {
  display: inline-block;
  margin-left: 0.25rem;
  font-size: 0.75rem;
}

th[aria-sort="ascending"] .sort-indicator::before {
  content: "\25B2";
}

th[aria-sort="descending"] .sort-indicator::before {
  content: "\25BC";
}

th[aria-sort="none"] .sort-indicator::before {
  content: "\2195";
  opacity: 0.55;
}

.plot-table tbody tr:nth-child(even) {
  background: #f7f1e6;
}

.plot-table tbody tr:hover {
  background: #f0e2cc;
}

.plot-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.plot-table .col-name {
  font-family: var(--serif);
  font-size: 1.02rem;
}

.status-note.is-conflict {
  display: block;
  white-space: normal;
  max-width: 16rem;
  margin-top: 0.2rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.empty-row {
  white-space: normal;
  padding: 1rem;
  font-family: var(--serif);
}

.plot-cards {
  display: grid;
  gap: 0.75rem;
}

.plot-card {
  border: 1px solid var(--rule);
  background: var(--raised);
  padding: 0.85rem 1rem 0.7rem;
}

.plot-card-name {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--green-deep);
}

.plot-card dl {
  display: grid;
  grid-template-columns: minmax(7rem, 38%) 1fr;
  gap: 0.28rem 0.75rem;
  margin: 0.55rem 0 0;
}

.plot-card dt {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin: 0;
}

.plot-card dd {
  margin: 0;
}

.plot-card-note {
  margin: 0.55rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.plot-app.view-table .plot-cards {
  display: none;
}

.plot-app.view-cards .plot-scroll,
.plot-app.view-cards .scroll-hint {
  display: none;
}

.data-link {
  font-family: var(--sans);
  font-size: 0.95rem;
  margin-top: 0.8rem;
}

.site-footer {
  margin-top: auto;
  background: var(--green-deep);
  color: var(--banner-text);
  padding: 0.5rem 0 1.5rem;
  font-size: 0.98rem;
}

.site-footer a {
  color: var(--banner-text);
}

.site-footer .ornament {
  color: #e4d2b4;
}

.footer-nav a {
  color: var(--banner-text);
  border-bottom-color: transparent;
}

.footer-meta {
  font-family: var(--sans);
  font-size: 0.9rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (min-width: 800px) {
  .plot-tools {
    grid-template-columns: minmax(16rem, 1.5fr) minmax(10rem, 0.7fr);
    align-items: end;
  }

  .status-filter,
  .tool-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  html {
    font-size: 106%;
  }

  .plot-app.view-table .scroll-hint {
    display: block;
  }

  .header-inner {
    align-items: stretch;
  }

  .brand-name {
    font-size: 1.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media (forced-colors: active) {
  .draft-banner,
  .plot-table thead th,
  .prose thead th,
  .btn {
    border: 1px solid CanvasText;
  }
}

@media print {
  .draft-banner,
  .site-footer,
  .skip,
  .ornament {
    background: transparent;
    color: black;
  }

  .plot-scroll {
    max-height: none;
    overflow: visible;
  }

  body {
    background: white;
  }
}
