html { color-scheme: light; }
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f4f1e8;
  color: #24211c;
}
a { color: #255f7a; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.site-header {
  min-height: 56px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #f7f3ea;
  background: #1f2d2d;
}
.site-header a { color: inherit; text-decoration: none; font-weight: 700; }
main { width: min(1180px, calc(100% - 32px)); margin: 28px auto 56px; }
.summary-panel {
  padding: 22px 0 28px;
  border-bottom: 1px solid #cec6b6;
}
.eyebrow {
  margin: 0 0 8px;
  color: #6d4f2a;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}
h1 { margin: 0; font-size: 2rem; line-height: 1.15; }
h2 { margin: 0 0 8px; font-size: 1.05rem; line-height: 1.25; }
h3 { margin: 16px 0 6px; font-size: 0.92rem; line-height: 1.25; color: #4f493f; }
.intro, .description, .row-description { max-width: 820px; color: #5e5a52; line-height: 1.5; }
.description { margin: 10px 0 0; }
.resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
}
.resource-links a {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid #c7bda8;
  border-radius: 4px;
  background: #fffdf8;
  text-decoration: none;
}
.resource-row .resource-links { margin-top: 12px; }
.stats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.stats div {
  min-width: 128px;
  padding: 12px 14px;
  background: #fffdf8;
  border: 1px solid #d8d0c0;
  border-radius: 6px;
}
.stats strong { display: block; font-size: 1.35rem; }
.stats span, .muted { color: #676259; }
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
}
.toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 16px 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: center;
  background: #f4f1e8;
}
input[type="search"] {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #bdb39f;
  border-radius: 4px;
  font: inherit;
  background: #fffdf8;
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
button, .button-link, .nav-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #9f927b;
  border-radius: 4px;
  background: #fffdf8;
  color: #24211c;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
button.active { background: #255f7a; border-color: #255f7a; color: #fff; }
.resource-nav {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) auto minmax(96px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 0 0 14px;
  border-bottom: 1px solid #cec6b6;
}
.resource-nav .nav-arrow:first-child { justify-self: start; }
.resource-nav .nav-arrow:last-child { justify-self: end; }
.nav-button { justify-content: center; font-weight: 700; }
.nav-button.disabled {
  opacity: 0.48;
  cursor: default;
  pointer-events: none;
}
.nav-index {
  color: #4f493f;
  font-size: 0.88rem;
  text-align: center;
  text-decoration: none;
}
.resource-list { display: grid; gap: 10px; }
.resource-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 390px);
  gap: 24px;
  align-items: center;
  padding: 14px 16px;
  background: #fffdf8;
  border: 1px solid #d8d0c0;
  border-radius: 6px;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.resource-row:hover, .resource-row:focus-visible {
  background: #fffaf0;
  border-color: #9f927b;
  box-shadow: 0 1px 0 rgba(36, 33, 28, 0.08);
  outline: none;
}
.resource-row p { margin: 0; color: #5e5a52; line-height: 1.4; }
.resource-row .source-title {
  margin-top: 2px;
  color: #676259;
  font-size: 0.86rem;
}
.resource-row .row-description { margin-top: 6px; }
dl { margin: 0; }
.resource-row .date-stack {
  display: grid;
  gap: 5px;
  align-content: center;
}
.resource-row .date-stack div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}
.resource-row .date-stack dt {
  color: #676259;
  font-size: 0.76rem;
  text-align: right;
  white-space: nowrap;
}
.resource-row .date-stack dd {
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}
dt { color: #676259; font-size: 0.76rem; }
dd { margin: 2px 0 0; font-weight: 700; }
.item-layout { display: grid; gap: 24px; }
.item-layout section { overflow-x: auto; }
.metadata-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px 18px;
}
.metadata-grid div { min-width: 0; }
.metadata-grid dd { overflow-wrap: anywhere; font-weight: 400; }
.date-list {
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
}
.date-list li {
  display: grid;
  grid-template-columns: minmax(92px, auto) minmax(120px, auto) minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  background: #fffdf8;
  border: 1px solid #d8d0c0;
  border-radius: 6px;
}
.date-label { font-weight: 700; }
.date-kind { color: #6d4f2a; font-size: 0.84rem; text-transform: uppercase; }
.date-note { color: #4f493f; line-height: 1.35; }
.date-bounds { margin: 10px 0 12px; }
.image-section h2 { margin-bottom: 10px; }
.image-browser {
  display: grid;
  gap: 12px;
  padding: 12px;
  background: #fffdf8;
  border: 1px solid #d8d0c0;
  border-radius: 6px;
}
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
  padding: 12px;
  background: #f6f2e9;
  border: 1px solid #e1d8c8;
  border-radius: 4px;
}
.image-tile {
  position: relative;
  margin: 0;
}
.atlas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.atlas-tile {
  display: grid;
  gap: 8px;
  margin: 0;
  min-width: 0;
}
.atlas-tile .thumb-button {
  aspect-ratio: 4 / 3;
}
.atlas-caption {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #4f493f;
  font-size: 0.86rem;
  line-height: 1.32;
}
.atlas-caption strong,
.atlas-caption span {
  overflow-wrap: anywhere;
}
.source-meta {
  color: #676259;
}
.source-note {
  color: #5e5a52;
}
.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.source-links a {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 7px;
  border: 1px solid #d8d0c0;
  border-radius: 4px;
  background: #fffdf8;
  text-decoration: none;
}
.thumb-button {
  width: 100%;
  min-height: 0;
  aspect-ratio: 1;
  padding: 0;
  display: block;
  background: #ece6d8;
  border: 1px solid #d8d0c0;
  border-radius: 4px;
  overflow: hidden;
}
.thumb-button:hover, .thumb-button:focus-visible {
  border-color: #255f7a;
  box-shadow: 0 0 0 2px rgba(37, 95, 122, 0.18);
}
.thumb-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.image-dialog {
  width: min(96vw, 1200px);
  max-height: 92vh;
  padding: 12px;
  border: 1px solid #9f927b;
  border-radius: 6px;
  background: #fffdf8;
}
.image-dialog::backdrop { background: rgba(20, 18, 14, 0.72); }
.image-dialog form {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 8px;
}
.image-dialog img {
  display: block;
  max-width: 100%;
  max-height: 74vh;
  margin: 0 auto;
  object-fit: contain;
}
.image-dialog p { margin: 8px 0 0; text-align: center; }
.dialog-close { min-height: 32px; }
.dialog-open { overflow-wrap: anywhere; }
.pill {
  display: inline-flex;
  margin: 0 6px 6px 0;
  padding: 5px 8px;
  border: 1px solid #d8d0c0;
  border-radius: 999px;
  background: #fffdf8;
  text-decoration: none;
}
.excerpt-list {
  display: grid;
  gap: 14px;
}
.excerpt-entry {
  padding: 14px 16px;
  background: #fffdf8;
  border: 1px solid #d8d0c0;
  border-radius: 6px;
}
.excerpt-entry h2 {
  margin-bottom: 6px;
}
.excerpt-meta,
.excerpt-reason {
  margin: 0 0 8px;
  color: #676259;
  font-size: 0.86rem;
  line-height: 1.35;
}
.excerpt-text {
  white-space: pre-wrap;
  color: #24211c;
  line-height: 1.5;
}
.archive-empty {
  margin: 0;
  color: #676259;
}
table { width: 100%; border-collapse: collapse; background: #fffdf8; }
th, td { padding: 9px 10px; border-bottom: 1px solid #ded7c9; text-align: left; vertical-align: top; }
th { color: #4f493f; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0; }
td { overflow-wrap: anywhere; }
.date-table { margin-top: 10px; border: 1px solid #d8d0c0; }
.date-table td:nth-child(4) { color: #4f493f; line-height: 1.35; }
.date-table th:nth-child(1), .date-table th:nth-child(2), .date-table th:nth-child(3) { width: 13%; }
.chronology-table th:nth-child(1) { width: 16%; }
.chronology-table th:nth-child(2) { width: auto; }
.chronology-table th:nth-child(3) { width: 26%; }
.chronology-list { overflow-x: auto; }
@media (max-width: 760px) {
  .site-header { padding: 0 16px; }
  .toolbar, .resource-row { grid-template-columns: 1fr; }
  .filters { justify-content: flex-start; }
  .resource-row .date-stack {
    padding-top: 10px;
    border-top: 1px solid #ded7c9;
  }
  .resource-row .date-stack div { grid-template-columns: minmax(112px, auto) minmax(0, 1fr); }
  .resource-row .date-stack dt { text-align: left; }
  .date-list li { grid-template-columns: 1fr; }
  .date-table { min-width: 760px; }
}
