:root {
  --nav-height: 3em;
  --scroll-offset: 100px; 
}

/* Global behavior */
html {
  scroll-behavior: smooth;
}

[id] {
  scroll-margin-top: var(--scroll-offset);
}

/* Box-sizing reset for layout sanity */

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

/* Header styles */

header.page-header {
  text-align: center;
  margin-bottom: 2rem;
}

.page-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.memorial-img {
  max-width: 280px;
  height: auto;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  margin: 0 auto 1rem;
  display: block;
}

.header-desc {
  font-size: 0.9rem;
  color: #666;
  max-width: 600px;
  margin: 0.5rem auto;
}

/* Timeline card details */

.timeline-card .details {
  font-size: 0.9rem;
  color: #666;
}

.timeline-card .img-doc {
  max-width: 100%;
  height: auto;
  aspect-ratio: 85 / 66; /* Matches 680 × 528 */
  border-radius: 8px;
  margin-top: 1rem;
  box-shadow: 0 2px 4px color-mix(in srgb, black 10%, transparent);
  display: block;
}

.timeline-card .eval-conditions {
  font-size: 1rem;
  margin-top: 1rem;
  color: #333;
}

.timeline-card .eval-list {
  font-size: 0.95rem;
  color: #444;
  margin-top: 0.5rem;
}

.timeline-card .eval-source {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.5rem;
}

.timeline-card .source-links {
  font-size: 0.9rem;
  color: #666;
}

.timeline-card .community-links {
  font-size: 0.9rem;
  color: #666;
}

.court-link {
  color: #666;
  text-decoration: underline;
}

.timeline-hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 1.5rem 0;
}

body {
  font-family: Georgia, serif;
  background: #f9f9f9;
  margin: 0;
  padding: 1rem;
  color: #333;
}

header {
  text-align: center;
  padding: 1rem 0;
}

h1 {
  margin-bottom: 0.5rem;
}

.timeline {
  max-width: 700px;
  margin: 0 auto;
}

.group-header {
  border-left: 6px solid #444;
  padding-left: 1rem;
  margin-top: 3rem;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-weight: bold;
  color: #222;
}

/* Improve contrast for small/em text */

.timeline-card small em {
  display: block;
  margin-top: 1em;
  font-size: 0.9em;
  color: #555;
}

.timeline-card {
  background: #fff;
  border-left: 4px solid #888;
  margin: 1rem 0;
  padding: 1rem 1.5rem;
  box-shadow: 0 2px 4px color-mix(in srgb, black 10%, transparent);
}

.timeline-card h2 {
  margin-top: 0;
  font-size: 1.1rem;
  color: #222;
}

.timeline-card p {
  margin-bottom: 0;
  line-height: 1.6;
}

/* Container styling */

.timeline-nav {
  background: #f9f9f9;
  padding: 0.5em 1em;
  border-bottom: 1px solid #ddd;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* Horizontal list layout */

.timeline-nav ul {
  display: inline-flex;
  gap: 1em;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Individual link styling */

.timeline-nav a {
  display: inline-block;
  text-decoration: none;
  color: #333;
  font-weight: bold;
  padding: 0.5em 0.75em;
  border-radius: 4px;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.footer-links a {
  display: inline-block;
  margin: 0.5em;
  color: #666;
  text-decoration: none;
}

.footer-links a:hover {
  color: #333;
  text-decoration: underline;
}

/* Timeline hover effect (must come after .footer-links a:hover) */

.timeline-nav a:hover {
  background: #f0f0f0;
}

/* Footer styles */

.site-footer {
  text-align: center;
  font-size: 0.9rem;
  color: #666;
  margin-top: 3rem;
  padding: 1rem;
}

@media (width <= 480px) {
  .timeline-nav a {
    white-space: normal;
    word-break: break-word;
    text-align: center;
  }
}

/* Hot topic styling */

.timeline-hot-topic {
  background: #fff8e1;
  border-bottom: 1px solid #ddd;
  padding: 0.75rem 1rem;
  text-align: center;
  font-weight: bold;
  font-size: 1rem;
  border-left: 4px solid #546e7a;
  margin-bottom: 1em;
}

.hot-topic-link {
  color: #666;
  text-decoration: none;
  display: inline-block;
  padding: 0.75rem 1rem;
  text-align: center;
  font-weight: bold;
}

.hot-topic-link:hover {
  text-decoration: underline;
  background: #f0f0f0;
  border-bottom: 1px solid #ddd;
  color: #666;
}

/* Last updated badge */

.last-updated {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.2px;
  color: #444;
  background-color: #f0f0f0;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 1rem;
}

/* Procedural motion hiding */

section.timeline-card[data-tag="procedural-motion"] {
  display: none;
}

/* Filter container */

.filter-container {
  position: sticky;
  display: flex;
  justify-content: center;
  top: var(--nav-height);
  border-bottom: 1px solid #ddd;
  background-color: #f9f9f9;
  z-index: 10;
  padding: 0.5em;
}

/* Toggle controls */

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: 1rem;
  cursor: pointer;
}

.toggle-text {
  line-height: 1;
}

input[type="checkbox"] {
  appearance: none;
  width: 40px;
  height: 20px;
  background: #ccc;
  border-radius: 10px;
  position: relative;
  outline: none;
  cursor: pointer;
}

input[type="checkbox"]:checked {
  background: #07c;
}

input[type="checkbox"]::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}

input[type="checkbox"]:checked::before {
  left: 22px;
}