:root {
  --bg: #fdf9f6;
  --surface: #ffffff;
  --surface-alt: #e6e1db;
  --text: #2c2a28;
  --muted: #625d57;
  --line: #c7c0b8;
  --brand: #7a3a32;
  --brand-strong: #5e2c26;
  --accent: #64332b;
  --max-width: 1080px;
  --radius: 14px;
  --shadow: 0 12px 36px rgba(46, 35, 33, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 90% 0%, #f2ded9 0%, rgba(242, 222, 217, 0) 42%),
    radial-gradient(circle at 10% 20%, #f3ece4 0%, rgba(243, 236, 228, 0) 34%),
    var(--bg);
  line-height: 1.6;
}

a {
  color: var(--brand-strong);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--brand);
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  color: var(--brand-strong);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transform: translateY(-150%);
  transition: transform 120ms ease;
  z-index: 30;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 60px;
  backdrop-filter: blur(10px);
  background: rgba(253, 249, 246, 0.82);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--brand-strong);
  text-decoration: none;
}

.nav-toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 0.45rem 0.75rem;
  font: inherit;
  display: none;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.75rem;
}

.site-nav a {
  display: inline-block;
  padding: 0.5rem 0.7rem;
  border-radius: 9px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.site-nav a.active,
.site-nav a:hover {
  background: var(--surface-alt);
  color: var(--brand-strong);
}

main {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1 0 auto;
}

.hero {
  background: linear-gradient(130deg, #5a2a24, #7a3a32 60%, #91524a 100%);
  color: #f9f3f2;
  border-radius: calc(var(--radius) + 6px);
  padding: 2.2rem 1.5rem;
  box-shadow: var(--shadow);
}

.hero h1 {
  font-family: "Source Serif 4", Georgia, serif;
  margin-top: 0;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.2;
}

.hero p {
  max-width: 70ch;
  margin-bottom: 0;
}

.hero-brand {
  background: transparent;
  color: var(--text);
  padding: 1.75rem 1.5rem 1.5rem;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  gap: 1.1rem;
  justify-items: center;
  text-align: center;
}

.hero-logo {
  width: 100%;
  max-width: 530px;
  height: auto;
  display: block;
}

.hero-brand h1 {
  font-family: "Source Serif 4", Georgia, serif;
  margin: 0 0 0.4rem;
  font-size: clamp(1.3rem, 2.4vw, 1.85rem);
  line-height: 1.25;
  color: var(--brand-strong);
}

.hero-brand p {
  margin: 0 auto;
  max-width: 80ch;
  color: var(--text);
}

.grid {
  display: grid;
  gap: 1rem;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(46, 35, 33, 0.06);
}

.card h2,
.card h3 {
  margin-top: 0;
}

.section-title {
  font-family: "Source Serif 4", Georgia, serif;
  margin: 1.5rem 0 0.6rem;
  font-size: 1.6rem;
}

.meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.item {
  border-bottom: 1px solid var(--line);
  padding: 0.9rem 0;
}

.item:last-child {
  border-bottom: 0;
}

.item h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.item p {
  margin: 0.35rem 0;
}

.badge {
  display: inline-block;
  padding: 0.14rem 0.55rem;
  border-radius: 999px;
  background: #f1e6e3;
  border: 1px solid #d9c2bc;
  font-size: 0.78rem;
  color: #5e2c26;
}

.doc-section {
  margin-top: 1.5rem;
}

.doc-section h2 {
  margin-bottom: 0.45rem;
}

.doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.doc-list a {
  text-decoration: none;
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.5rem;
}

.doc-list li:last-child a {
  border-bottom: 0;
}

.doc-list a:hover {
  background: rgba(122, 58, 50, 0.06);
  color: var(--brand-strong);
}

.year-doc-grid {
  display: grid;
  gap: 0.7rem;
}

.year-doc-card {
  display: grid;
  grid-template-columns: minmax(3.5rem, auto) 1fr;
  column-gap: 0.85rem;
  row-gap: 0.4rem;
  align-items: center;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
}

.year-doc-grid > .year-doc-card:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.year-doc-card h3 {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.1rem;
  line-height: 1.25;
}

.year-doc-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
}

.year-doc-link {
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.3rem 0.2rem;
  color: var(--text);
  font-weight: 600;
}

a.year-doc-link:hover {
  color: var(--brand-strong);
  text-decoration: underline;
}

.year-doc-link.is-missing {
  color: #a49d95;
  font-weight: 500;
  cursor: not-allowed;
}

.year-doc-link .badge {
  font-size: 0.72rem;
  padding: 0.1rem 0.5rem;
}

.year-doc-extra-list {
  grid-column: 2;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  color: var(--muted);
}

.year-doc-extra-list li {
  margin: 0;
}

.older-years-group {
  margin-top: 0;
  border-top: 1px solid var(--line);
}

.item-list + .older-years-group {
  margin-top: 0;
}

/* Drop the last row's own divider right before the toggle so the group's
   border-top is the single separating line (avoids a double hairline). */
.year-doc-card:has(+ .older-years-group) {
  padding-bottom: 0;
  border-bottom: 0;
}

.older-years-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border: 0;
  background: transparent;
  color: var(--brand-strong);
  font: inherit;
  font-weight: 600;
  padding: 0.75rem 0;
  cursor: pointer;
}

.older-years-toggle:hover {
  color: var(--brand);
  background: rgba(122, 58, 50, 0.05);
}

.older-years-toggle .chevron {
  font-size: 0.8rem;
  transition: transform 180ms ease;
}

.older-years-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.older-years-panel {
  margin-top: 0.2rem;
}

.older-years-panel[hidden] {
  display: none !important;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #efe7e0;
  min-height: 120px;
  flex-shrink: 0;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.2rem 1rem 2rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.notice {
  padding: 0.8rem;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: #f7f4f1;
}

.committee-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
}

.committee-table caption {
  caption-side: bottom;
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: left;
}

.committee-table caption span {
  display: block;
}

.committee-table caption span + span {
  margin-top: 0.25rem;
}

.committee-table th,
.committee-table td {
  text-align: left;
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.committee-table thead th {
  background: var(--surface-alt);
  color: var(--brand-strong);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 0.9rem;
}

.committee-table thead th:first-child {
  border-top-left-radius: var(--radius);
}

.committee-table thead th:last-child {
  border-top-right-radius: var(--radius);
}

.committee-table tbody tr:last-child td {
  border-bottom: 0;
}

.committee-table tbody tr:nth-child(even) td {
  background: #fbfaf8;
}

.committee-table .col-key,
.committee-table .col-term {
  text-align: center;
  white-space: nowrap;
}

.check {
  color: var(--brand);
  font-weight: 700;
}

.check-none {
  color: #b7b0a8;
}

.map-embed {
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 0.4rem;
}

.map-embed iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

@media (max-width: 860px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: inline-block;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 1rem;
    left: 1rem;
    display: none;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .site-nav.open {
    display: block;
  }

  .site-nav ul {
    padding: 0.5rem;
    flex-direction: column;
  }

  .year-doc-card {
    display: block;
  }

  .year-doc-card h3 {
    margin: 0 0 0.4rem;
  }

  .year-doc-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .year-doc-extra-list {
    grid-column: auto;
    margin-top: 0.4rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 580px) {
  .year-doc-links {
    grid-template-columns: 1fr;
  }

  .year-doc-extra-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .committee-table thead {
    display: none;
  }

  .committee-table,
  .committee-table tbody,
  .committee-table tr,
  .committee-table td {
    display: block;
    width: 100%;
  }

  /* Flex column lets the bottom caption sit after the rows, since
     caption-side is ignored once the table is laid out as blocks. */
  .committee-table {
    display: flex;
    flex-direction: column;
  }

  .committee-table caption {
    order: 1;
  }

  .committee-table tr {
    border-bottom: 1px solid var(--line);
  }

  .committee-table tr:last-child {
    border-bottom: 0;
  }

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

  .committee-table tbody tr:nth-child(even) td {
    background: transparent;
  }

  .committee-table td {
    border-bottom: 0;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem 0.8rem;
  }

  .committee-table td:first-child {
    padding-top: 0.7rem;
  }

  .committee-table td:last-child {
    padding-bottom: 0.7rem;
  }

  .committee-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--brand-strong);
  }

  .committee-table .col-key,
  .committee-table .col-term {
    text-align: right;
  }
}
