@import url('https://fonts.bunny.net/css?family=dm-sans:400,500|newsreader:400,400i,700');

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

:root {
  --color-bg: #fafafa;
  --color-fg: #1a1a1a;
  --color-muted: #999;
  --color-accent: #002FA7;
  --color-border: #eee;
  --color-success: #22c55e;
  --color-error: #ef4444;
  --color-error-bg: #fee;
  --color-label: #666;
  --color-accent-light: #eef1fc;
  --color-badge-inserted-bg: #eef1fc;
  --color-badge-inserted-text: #002FA7;
  --color-badge-repealed-bg: #fee;
  --color-badge-repealed-text: #ef4444;
  --color-badge-temporary-bg: #fef3e0;
  --color-badge-temporary-text: #a67a00;
  --color-badge-special-bg: #e8faf0;
  --color-badge-special-text: #22c55e;

  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-mono: ui-monospace, Menlo, monospace;
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;

  --layout-max-width: 640px;
  --spacing-body: 2rem 1.25rem;
  --gap-sm: 8px;
  --gap-md: 16px;
  --gap-lg: 24px;

  --radius-badge: 3px;
  --radius-tag: 6px;
  --radius-error: 6px;

  --text-hero-size: 1.4rem;
  --text-hero-weight: var(--font-weight-medium);
  --text-hero-sub-size: 0.85rem;

  --text-heading-size: 1.15rem;
  --text-heading-weight: var(--font-weight-medium);

  --text-title-size: 0.95rem;
  --text-title-weight: var(--font-weight-medium);

  --text-part-size: 0.7rem;
  --text-part-weight: var(--font-weight-medium);
  --text-part-transform: uppercase;
  --text-part-spacing: 1.5px;

  --text-article-title-size: 1.6rem;
  --text-article-title-weight: var(--font-weight-medium);

  --text-article-number-size: 0.7rem;
  --text-article-number-transform: uppercase;
  --text-article-number-spacing: 2.5px;

  --text-item-num-size: 0.78rem;
  --text-item-num-weight: var(--font-weight-medium);
  --text-item-title-size: 0.9rem;

  --text-meta-size: 0.75rem;
  --text-badge-size: 0.65rem;
  --text-badge-transform: uppercase;
  --text-badge-spacing: 0.5px;
  --text-tag-size: 0.72rem;

  --text-body-size: 1rem;
  --text-body-line-height: 1.8;
  --text-preamble-size: 1rem;
  --text-related-size: 0.85rem;
  --text-footer-size: 0.75rem;
  --text-nav-size: 0.85rem;

  --text-search-size: 0.85rem;
  --text-search-status-size: 0.72rem;
  --text-jump-size: 0.8rem;

  --text-heading-related-size: 0.75rem;
  --text-heading-related-weight: var(--font-weight-medium);
  --text-heading-related-transform: uppercase;
  --text-heading-related-spacing: 1.5px;

  --text-updated-size: 0.75rem;
  --text-updated-transform: uppercase;
  --text-updated-spacing: 0.3px;

  --text-error-size: 0.85rem;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-fg);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

::selection {
  background: var(--color-accent);
  color: #fff;
}

.container {
  max-width: var(--layout-max-width);
  margin: 0 auto;
  padding: var(--spacing-body);
}

/* ── Header ── */
.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
  padding-top: 0;
  padding-bottom: 0;
}

.site-title {
  font-size: var(--text-title-size);
  font-weight: var(--text-title-weight);
  color: var(--color-fg);
  white-space: nowrap;
  padding: 0.8rem 0;
  margin-right: auto;
}

.site-title:hover {
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
}

.site-nav a {
  display: block;
  padding: 0.8rem 0.6rem;
  font-size: var(--text-nav-size);
  color: var(--color-muted);
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.site-nav a:hover {
  color: var(--color-fg);
  text-decoration: none;
  border-bottom-color: var(--color-accent);
}

.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 4px 10px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--color-muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  line-height: 1;
  flex-shrink: 0;
}

.search-trigger:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.search-trigger-hint {
  font-size: 0.6rem;
  padding: 1px 4px;
  background: var(--color-badge-inserted-bg);
  color: var(--color-badge-inserted-text);
  border-radius: 3px;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.3px;
}

/* ── Search Overlay ── */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 1rem 2rem;
}

.search-overlay.visible {
  display: flex;
}

.search-modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: searchModalIn 0.15s ease-out;
}

@keyframes searchModalIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.search-modal-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
}

.search-modal-icon {
  flex-shrink: 0;
  color: var(--color-muted);
}

.search-modal-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: var(--font-weight-regular);
  color: var(--color-fg);
  background: transparent;
}

.search-modal-input::placeholder {
  color: var(--color-muted);
  opacity: 0.6;
}

.search-modal-close {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--color-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.search-modal-close:hover {
  color: var(--color-fg);
  background: var(--color-badge-inserted-bg);
}

.search-modal-results {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  min-height: 80px;
}

.search-modal-empty {
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-muted);
  line-height: 1.5;
}

.search-modal-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.1s;
  border-left: 3px solid transparent;
}

.search-modal-item.selected {
  background: var(--color-badge-inserted-bg);
  border-left-color: var(--color-accent);
}

.search-modal-item:hover {
  background: var(--color-badge-inserted-bg);
}

.search-modal-item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.search-modal-item-title {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: var(--font-weight-regular);
  color: var(--color-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-modal-item-excerpt {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--color-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.search-modal-item-excerpt mark {
  background: var(--color-badge-inserted-bg);
  color: var(--color-accent);
  border-radius: 2px;
  padding: 0 2px;
}

.search-modal-more {
  padding: 10px 16px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-muted);
  border-top: 1px solid var(--color-border);
}

.search-modal-footer {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 8px 16px;
  border-top: 1px solid var(--color-border);
  font-size: 0.65rem;
  color: var(--color-muted);
}

.search-modal-footer span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.search-modal-footer kbd {
  display: inline-block;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  background: var(--color-badge-inserted-bg);
  border-radius: 3px;
  color: var(--color-badge-inserted-text);
  line-height: 1.4;
}

@media (max-width: 640px) {
  .search-overlay {
    padding: 0;
    align-items: stretch;
  }
  .search-modal {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  .search-modal-input-wrap {
    padding: 12px 14px;
  }
  .search-modal-item {
    padding: 12px 14px;
  }
}

/* ── Homepage ── */
.hero {
  text-align: center;
  padding: 2rem 0 1.5rem;
}

.hero h1 {
  font-size: var(--text-hero-size);
  font-weight: var(--text-hero-weight);
  color: var(--color-fg);
  margin-bottom: 4px;
}

.hero p {
  color: var(--color-muted);
  font-size: var(--text-hero-sub-size);
}

/* Search */
.search-wrap {
  max-width: 100%;
  margin: 0 0 var(--gap-md);
  position: relative;
}

.search-wrap input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: var(--text-search-size);
  font-family: var(--font-sans);
  font-weight: var(--font-weight-regular);
  background: #fff;
  color: var(--color-fg);
  outline: none;
  transition: border-color 0.2s;
}

.search-wrap input:focus {
  border-color: var(--color-accent);
}

.search-wrap input::placeholder {
  color: var(--color-muted);
  opacity: 0.6;
}

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--color-muted);
  cursor: pointer;
  padding: 4px 8px;
  display: none;
}

.search-clear.visible {
  display: block;
}

.search-clear:hover {
  color: var(--color-accent);
}

.search-status {
  font-family: var(--font-sans);
  font-size: var(--text-search-status-size);
  font-weight: var(--font-weight-regular);
  color: var(--color-muted);
  text-align: center;
  margin-top: 10px;
  min-height: 1.2em;
}

/* Article jump */
.jump-wrap {
  margin: -0.5rem 0 1.5rem;
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: var(--text-jump-size);
  color: var(--color-muted);
}

.jump-wrap label {
  white-space: nowrap;
}

.jump-input {
  width: 80px;
  padding: 4px 8px;
  border: none;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-jump-size);
  font-family: var(--font-sans);
  font-weight: var(--font-weight-regular);
  background: transparent;
  color: var(--color-fg);
  outline: none;
  text-align: center;
  transition: border-color 0.2s;
}

.jump-input:focus {
  border-bottom-color: var(--color-accent);
}

/* ── Section headings ── */
.section-heading {
  font-size: var(--text-part-size);
  font-weight: var(--text-part-weight);
  color: var(--color-accent);
  text-transform: var(--text-part-transform);
  letter-spacing: var(--text-part-spacing);
  padding: 1rem 0 0.6rem;
  margin: 0;
}

/* ── Part grid ── */
.part-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--gap-sm);
  padding: 0 0 1rem;
}

.part-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--color-fg);
  border-bottom: 1px solid var(--color-border);
}

.part-card:hover {
  text-decoration: none;
}

.part-card-num {
  font-size: 0.7rem;
  font-weight: var(--text-item-num-weight);
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.part-card-name {
  font-size: var(--text-item-title-size);
  line-height: 1.3;
}

.part-card-count {
  font-size: 0.68rem;
  color: var(--color-muted);
}

/* ── Key articles ── */
.key-articles {
  display: flex;
  flex-direction: column;
  padding: 0 0 2.5rem;
}

.key-article-card {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  text-decoration: none;
  color: var(--color-fg);
  border-bottom: 1px solid var(--color-border);
}

.key-article-card:last-child {
  border-bottom: none;
}

.key-article-card:hover {
  text-decoration: none;
}

.key-article-num {
  font-size: var(--text-item-num-size);
  font-weight: var(--text-item-num-weight);
  color: var(--color-accent);
  min-width: 70px;
  text-align: right;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}

.key-article-title {
  font-size: var(--text-item-title-size);
  line-height: 1.4;
}

/* ── Part headings ── */
.part-heading {
  font-size: var(--text-part-size);
  font-weight: var(--text-part-weight);
  color: var(--color-accent);
  text-transform: var(--text-part-transform);
  letter-spacing: var(--text-part-spacing);
  padding: 1.5rem 0 0.5rem;
  margin: 0;
}

.part-heading.hidden {
  display: none;
}

.part-heading a {
  color: inherit;
  text-decoration: none;
}

.part-heading a:hover {
  text-decoration: underline;
}

.chapter-heading {
  font-size: 0.72rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 1rem 0 0.4rem;
  margin: 0;
}

/* ── Part / Schedule index ── */
.part-index-list,
.schedule-index-list {
  display: flex;
  flex-direction: column;
  padding: 0 0 2.5rem;
}

.part-index-card,
.schedule-index-card {
  display: flex;
  align-items: baseline;
  gap: var(--gap-md);
  padding: 10px 0;
  text-decoration: none;
  color: var(--color-fg);
  border-bottom: 1px solid var(--color-border);
}

.part-index-card:last-child,
.schedule-index-card:last-child {
  border-bottom: none;
}

.part-index-card:hover,
.schedule-index-card:hover {
  text-decoration: none;
}

.part-index-num {
  font-size: var(--text-item-num-size);
  font-weight: var(--text-item-num-weight);
  color: var(--color-accent);
  min-width: 64px;
  text-align: left;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}

.part-index-name {
  font-size: var(--text-item-title-size);
  line-height: 1.4;
  flex: 1;
}

.part-index-meta {
  font-size: 0.72rem;
  color: var(--color-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.schedule-index-card {
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
}

.schedule-index-num {
  font-size: var(--text-item-title-size);
  font-weight: var(--font-weight-medium);
}

.schedule-index-count {
  font-size: 0.78rem;
  color: var(--color-muted);
}

.ref-heading {
  font-size: var(--text-part-size);
  font-weight: var(--text-part-weight);
  color: var(--color-accent);
  text-transform: var(--text-part-transform);
  letter-spacing: var(--text-part-spacing);
  padding: 0 0 0.5rem;
  margin: 0;
}

.no-refs {
  font-size: 0.85rem;
  color: var(--color-muted);
  padding: 1rem 0 2rem;
}

.back-link {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: 0.5rem;
  padding-bottom: 3rem;
}

.back-link:hover {
  color: var(--color-accent);
}

/* ── Article list ── */
.article-list {
  list-style: none;
  padding: 0 0 2.5rem;
}

.article-item {
  border-bottom: 1px solid var(--color-border);
}

.article-item:last-child {
  border-bottom: none;
}

.article-item a {
  display: flex;
  align-items: baseline;
  gap: var(--gap-md);
  padding: 10px 0;
  color: var(--color-fg);
  text-decoration: none;
}

.article-item a:hover {
  text-decoration: none;
}

.article-item .num {
  font-size: var(--text-item-num-size);
  font-weight: var(--text-item-num-weight);
  color: var(--color-accent);
  min-width: 64px;
  text-align: right;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}

.article-item .title-text {
  font-size: var(--text-item-title-size);
  line-height: 1.4;
}

.article-item.hidden {
  display: none;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-badge);
  font-weight: var(--font-weight-medium);
  text-transform: var(--text-badge-transform);
  letter-spacing: var(--text-badge-spacing);
  font-size: var(--text-badge-size);
  line-height: 1.5;
}

.badge-inserted {
  background: var(--color-badge-inserted-bg);
  color: var(--color-badge-inserted-text);
}

.badge-repealed {
  background: var(--color-badge-repealed-bg);
  color: var(--color-badge-repealed-text);
}

.badge-temporary {
  background: var(--color-badge-temporary-bg);
  color: var(--color-badge-temporary-text);
}

.badge-special {
  background: var(--color-badge-special-bg);
  color: var(--color-badge-special-text);
}

/* ── Article Page ── */
.article-page {
  padding: 2rem 1.25rem 3rem;
}

.article-number {
  font-size: var(--text-article-number-size);
  font-weight: var(--font-weight-medium);
  color: var(--color-accent);
  text-transform: var(--text-article-number-transform);
  letter-spacing: var(--text-article-number-spacing);
}

.article-title {
  font-size: var(--text-article-title-size);
  font-weight: var(--text-article-title-weight);
  line-height: 1.3;
  margin: 4px 0 1rem;
}

.article-meta {
  font-size: 0.75rem;
  color: var(--color-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.article-meta a {
  color: var(--color-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-meta a:hover {
  color: var(--color-accent);
}

.article-page.preamble {
  text-align: center;
}

.article-page.preamble .article-number {
  display: none;
}

.article-page.preamble .article-title {
  font-size: 2rem;
  font-weight: var(--font-weight-medium);
  text-align: center;
  max-width: 500px;
  margin: 0 auto 1rem;
  line-height: 1.2;
}

.article-page.preamble .article-meta {
  display: none;
}

.article-page.preamble .article-body {
  text-align: center;
  font-size: var(--text-preamble-size);
  font-style: italic;
  line-height: 2;
  max-width: 500px;
  margin: 0 auto;
  color: var(--color-fg);
}

.article-body {
  font-family: var(--font-serif);
  font-size: var(--text-body-size);
  line-height: var(--text-body-line-height);
  white-space: pre-wrap;
  color: var(--color-fg);
}

/* ── Related fold / keywords ── */
.related-fold {
  margin-top: 1.25rem;
  font-size: 0.78rem;
}

.related-fold summary {
  cursor: pointer;
  color: var(--color-muted);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.related-fold summary::-webkit-details-marker {
  display: none;
}

.related-fold summary::before {
  content: '\25B8';
  font-size: 0.7rem;
  transition: transform 0.15s;
}

.related-fold[open] summary::before {
  transform: rotate(90deg);
}

.related-fold summary:hover {
  color: var(--color-accent);
}

.related-fold[open] {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.related-fold a {
  display: block;
  padding: 2px 0 2px 1rem;
  color: var(--color-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.related-fold a:hover {
  color: var(--color-accent);
}

.keywords {
  margin-top: 1.25rem;
  font-size: 0.72rem;
  color: var(--color-muted);
  line-height: 1.6;
}

/* ── Timeline ── */
.timeline {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
  padding: 0 0 1.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.timeline-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  background: var(--color-accent);
  border-radius: 2px 2px 0 0;
  min-height: 4px;
  text-decoration: none;
  opacity: 0.7;
  position: relative;
}

.timeline-bar:hover {
  opacity: 1;
  text-decoration: none;
}

.timeline-label {
  font-size: 0.6rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-accent);
  white-space: nowrap;
  position: absolute;
  bottom: -1.3rem;
}

.timeline-count {
  font-size: 0.65rem;
  font-weight: var(--font-weight-medium);
  color: #fff;
  padding-top: 4px;
}

/* ── Article footer nav ── */
.article-footer {
  margin-top: 2rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}

.article-footer a {
  color: var(--color-muted);
}

.article-footer a:hover {
  color: var(--color-accent);
}

/* ── Amendments Page ── */
.decade-heading {
  font-size: 1.1rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-accent);
  padding: 1.5rem 0 0.75rem;
  margin: 0;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-bg);
}

.amendment-list {
  display: flex;
  flex-direction: column;
  padding: 0 0 2rem;
}

.amendment-card {
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
}

.amendment-header {
  font-size: 0.95rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-fg);
  padding: 12px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
}

.amendment-header::-webkit-details-marker {
  display: none;
}

.amendment-header::after {
  content: '+';
  font-size: 1.1rem;
  color: var(--color-muted);
  flex-shrink: 0;
  margin-left: 12px;
}

details[open] .amendment-header::after {
  content: '\2212';
}

.amendment-header:hover {
  color: var(--color-accent);
}

.amendment-body {
  padding: 0 0 12px;
}

.amendment-year {
  color: var(--color-muted);
  font-weight: var(--font-weight-regular);
}

.amendment-desc {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--color-muted);
  margin-bottom: 10px;
}

.amendment-articles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 6px;
  font-size: 0.82rem;
}

.amendment-label {
  font-weight: var(--font-weight-medium);
  color: var(--color-label);
  min-width: 80px;
}

.amendment-link {
  color: var(--color-accent);
  text-decoration: none;
}

.amendment-link:hover {
  text-decoration: underline;
}

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: 1.5rem 1.25rem 2.5rem;
  font-size: 0.75rem;
  color: var(--color-muted);
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--color-muted);
  font-weight: var(--font-weight-medium);
  font-size: 0.75rem;
}

.footer-nav a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.site-footer a {
  color: var(--color-muted);
  font-weight: var(--font-weight-medium);
}

.site-footer a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

@media (max-width: 640px) {
  html { font-size: 15px; }
  body { --spacing-body: 1.25rem 1rem; }

  /* ── Header: clean two-row layout ── */
  .site-header .container {
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0;
  }
  .site-title {
    margin-right: 0;
    font-size: 0.85rem;
    padding: 0.6rem 0;
  }
  .site-nav {
    width: 100%;
    order: 1;
    justify-content: center;
    gap: 4px;
    padding: 0 0 10px;
  }
  .site-nav a {
    padding: 4px 6px;
    font-size: 0.72rem;
    border-bottom-width: 1px;
  }
  .search-trigger-hint { display: none; }

  /* ── Hero ── */
  .hero { padding: 1.5rem 0 1rem; }
  .hero h1 { font-size: 1.3rem; }

  /* ── Part grid ── */
  .part-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 4px; }
  .part-card { padding: 8px 0; }

  /* ── Key articles ── */
  .key-article-card { gap: 8px; }
  .key-article-num { min-width: 36px; }

  /* ── Part index / schedule ── */
  .part-index-card { gap: 8px; }
  .part-index-num { min-width: 36px; }

  /* ── Article list ── */
  .article-item a { padding: 8px 0; gap: 8px; }
  .article-item .num { min-width: 36px; font-size: 0.7rem; }

  /* ── Article page ── */
  .article-page { padding: 1.5rem 1rem 3rem; }
  .article-title { font-size: 1.3rem; }
  .article-page.preamble .article-title { font-size: 1.5rem; }
  .article-body { font-size: 0.95rem; line-height: 1.75; }

  /* ── Search ── */
  .search-wrap input { font-size: 0.8rem; }

  /* ── Jump ── */
  .jump-wrap { flex-wrap: wrap; gap: 4px; }

  /* ── Timeline ── */
  .timeline { height: 80px; }
  .timeline-count { display: none; }

  /* ── Amendments ── */
  .amendment-header { font-size: 0.88rem; padding: 10px 0; }

  /* ── Footer ── */
  .site-footer { padding: 1rem 1rem 2rem; }
}
