.event-timeline-page {
  min-height: 70vh;
  padding-bottom: clamp(5rem, 10vw, 10rem);
  background-image:
    linear-gradient(rgba(23, 32, 43, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 43, .035) 1px, transparent 1px);
  background-size: 4rem 4rem;
}

.event-timeline-heading {
  padding-top: clamp(4.5rem, 9vw, 8.5rem);
  padding-bottom: clamp(3rem, 7vw, 6rem);
}

.event-timeline-heading h1 {
  max-width: 65rem;
  margin: 1.2rem 0 1.5rem;
  font-size: clamp(3.4rem, 7vw, 6.4rem);
  line-height: .94;
}

.event-timeline-heading > p:not(.section-kicker) {
  max-width: 52rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
}

.timeline-controls,
.archive-histogram,
.day-results {
  margin-bottom: 1rem;
  padding: clamp(1.2rem, 3vw, 2.2rem);
  border: 1px solid var(--line);
  background: var(--paper);
}

.timeline-panel-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.timeline-panel-title p,
.timeline-panel-title span {
  margin: 0;
  color: var(--muted);
  font-size: .76rem;
}

.timeline-panel-title > div > p {
  color: var(--burgundy);
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.timeline-panel-title h2 {
  margin: .35rem 0 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

#timeline-filter-form {
  display: grid;
  grid-template-columns: minmax(16rem, 1.3fr) repeat(3, minmax(10rem, 1fr)) auto;
  align-items: end;
  gap: .8rem;
}

#timeline-filter-form label,
#timeline-filter-form .timeline-field {
  display: grid;
  gap: .35rem;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .04em;
}

#timeline-filter-form .timeline-field > label { display: block; }

#timeline-filter-form input,
#timeline-filter-form select,
#timeline-filter-form button {
  min-height: 3rem;
  border-radius: 0;
  font: inherit;
}

#timeline-filter-form input,
#timeline-filter-form select {
  width: 100%;
  padding: .55rem .65rem;
  border: 1px solid var(--line);
  background: var(--ivory);
  color: var(--ink);
}

#timeline-filter-form > button,
.date-control button,
.event-pagination button {
  border: 1px solid var(--navy);
  background: var(--navy);
  color: var(--white);
  cursor: pointer;
  font-weight: 750;
}

html[data-theme="dark"] #timeline-filter-form > button,
html[data-theme="dark"] .date-control button,
html[data-theme="dark"] .event-pagination button {
  border-color: #476f8f;
  background: #31536f;
  color: #ffffff;
}

.date-control {
  display: grid;
  grid-template-columns: 3rem 1fr 3rem;
}

.date-control input {
  border-right: 0 !important;
  border-left: 0 !important;
}

.histogram-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: .35rem;
  color: var(--muted);
  font-size: .68rem;
}

.histogram-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.histogram-legend span::before { width: .65rem; height: .65rem; content: ""; background: var(--line); }
.histogram-legend .legend-event::before { background: var(--burgundy); }
.histogram-legend .legend-observation::before { background: #4f8caa; }
.histogram-legend .legend-aggregate::before { background: #d49333; }

.timeline-histogram {
  display: grid;
  grid-auto-columns: minmax(1.5rem, 1fr);
  grid-auto-flow: column;
  align-items: end;
  min-height: 12rem;
  overflow-x: auto;
  padding: 1rem .15rem 2rem;
  border-bottom: 1px solid var(--line);
  scrollbar-color: var(--burgundy) var(--ivory-deep);
}

.histogram-day {
  position: relative;
  display: flex;
  align-items: end;
  width: 100%;
  min-width: 1.5rem;
  height: 10rem;
  padding: 0 .09rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

.histogram-day[data-month]::after {
  position: absolute;
  bottom: -1.55rem;
  left: 0;
  color: var(--muted);
  content: attr(data-month);
  font-size: .62rem;
  white-space: nowrap;
}

.histogram-column {
  display: flex;
  flex-direction: column-reverse;
  width: 100%;
  min-height: .2rem;
  background: color-mix(in srgb, var(--burgundy) 72%, var(--paper));
  transition: background-color .15s ease;
}

.histogram-segment { display: block; min-height: 1px; }
.histogram-segment.event { background: var(--burgundy); }
.histogram-segment.observation { background: #4f8caa; }
.histogram-segment.aggregate { background: #d49333; }

.histogram-day:hover .histogram-column { filter: brightness(1.12); }

.histogram-day[aria-current="date"] {
  outline: 2px solid var(--burgundy);
  outline-offset: 2px;
}

.histogram-column.activity-0 { height: .2rem; background: var(--line); }
.histogram-column.activity-1 { height: 8.333%; }
.histogram-column.activity-2 { height: 16.666%; }
.histogram-column.activity-3 { height: 25%; }
.histogram-column.activity-4 { height: 33.333%; }
.histogram-column.activity-5 { height: 41.666%; }
.histogram-column.activity-6 { height: 50%; }
.histogram-column.activity-7 { height: 58.333%; }
.histogram-column.activity-8 { height: 66.666%; }
.histogram-column.activity-9 { height: 75%; }
.histogram-column.activity-10 { height: 83.333%; }
.histogram-column.activity-11 { height: 91.666%; }
.histogram-column.activity-12 { height: 100%; }

.histogram-help {
  max-width: 60rem;
  margin: .8rem 0 0;
  color: var(--muted);
  font-size: .74rem;
}

.retained-c2 {
  margin-top: 1.25rem;
  border: 1px solid var(--line);
}

.retained-c2:empty {
  display: none;
}

.retained-c2 h3,
.retained-c2 > p {
  margin: 0;
  padding: .9rem 1rem 0;
}

.retained-c2 h3 {
  font: 750 1rem/1.3 var(--font-interface, Arial), sans-serif;
}

.retained-c2 > p {
  color: var(--muted);
  font-size: .76rem;
}

.retained-c2 ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: .9rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.retained-c2 li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: .76rem;
}

.retained-c2 strong {
  white-space: nowrap;
  color: var(--burgundy);
}

.event-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.event-summary article {
  min-height: 7rem;
  padding: 1rem;
  border-right: 1px solid var(--line);
}

.event-summary article:last-child {
  border-right: 0;
}

.event-summary span {
  display: block;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.event-summary strong {
  display: block;
  margin-top: .8rem;
  font: 500 2.8rem/1 var(--font-editorial, Georgia), serif;
}

.timeline-message {
  margin: 1.5rem 0 0;
  color: var(--muted);
}

.event-list {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.event-list > li {
  border-top: 1px solid var(--line);
}

.event-list > li:last-child {
  border-bottom: 1px solid var(--line);
}

.event-record-group { margin-top: 1rem; border: 1px solid var(--line) !important; }
.event-record-group > details > summary { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem; cursor: pointer; list-style: none; }
.event-record-group > details > summary::-webkit-details-marker { display: none; }
.event-record-group > details > summary span { color: var(--muted); font-size: .76rem; }
.event-group-list { margin: 0; padding: 0 1rem; border-top: 1px solid var(--line); list-style: none; }
.event-group-list > li { border-bottom: 1px solid var(--line); }
.event-group-list > li:last-child { border-bottom: 0; }

.event-card summary {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr) auto;
  gap: 1.2rem;
  align-items: start;
  padding: 1.25rem .25rem;
  cursor: pointer;
  list-style: none;
}

.event-card summary::-webkit-details-marker {
  display: none;
}

.event-time {
  color: var(--burgundy);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .04em;
}

.event-card h3 {
  margin: 0 0 .4rem;
  font: 650 clamp(1.1rem, 2.2vw, 1.4rem)/1.2 var(--font-interface, Arial), sans-serif;
}

.event-card summary p {
  margin: 0;
  color: var(--muted);
  font-size: .84rem;
}

.event-source-tag {
  border: 1px solid var(--line);
  padding: .25rem .45rem;
  color: var(--navy);
  font-size: .65rem;
  font-weight: 750;
}

.event-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17rem;
  gap: 2rem;
  padding: 0 1rem 1.5rem 10.95rem;
}

.event-card-body p {
  margin-top: 0;
}

.event-card-meta {
  margin: 0;
}

.event-card-meta div {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: .8rem;
  padding: .45rem 0;
  border-top: 1px solid var(--line);
  font-size: .76rem;
}

.event-card-meta dt {
  color: var(--muted);
}

.event-card-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.event-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.event-links a {
  color: var(--navy);
  font-size: .78rem;
  font-weight: 750;
  text-decoration: underline;
  text-decoration-color: var(--burgundy);
  text-underline-offset: .22em;
}

.event-pagination {
  display: flex;
  justify-content: center;
  gap: .6rem;
  margin-top: 1.5rem;
}

.event-pagination button {
  min-width: 3rem;
  min-height: 2.8rem;
}

.event-pagination button[aria-current="page"] {
  border-color: var(--burgundy);
  background: var(--burgundy);
}

.event-pagination button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.timeline-method-note {
  display: grid;
  grid-template-columns: .35fr 1fr auto;
  gap: 2rem;
  align-items: start;
  margin-top: clamp(3rem, 7vw, 6rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--burgundy);
}

.timeline-method-note p {
  margin-top: 0;
}

html[data-theme="dark"] .timeline-controls,
html[data-theme="dark"] .archive-histogram,
html[data-theme="dark"] .day-results {
  background: var(--paper);
}

@media (max-width: 1050px) {
  #timeline-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .event-timeline-heading h1 {
    font-size: clamp(3rem, 16vw, 5rem);
  }
  .timeline-panel-title,
  .timeline-method-note {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: start;
  }
  #timeline-filter-form,
  .event-summary {
    grid-template-columns: 1fr;
  }
  .event-summary article {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .event-summary article:last-child {
    border-bottom: 0;
  }
  .event-card summary,
  .event-card-body {
    grid-template-columns: 1fr;
  }
  .event-card-body {
    gap: 1rem;
    padding: 0 .25rem 1.5rem;
  }
  .event-source-tag {
    justify-self: start;
  }
  .event-record-group > details > summary { flex-direction: column; }
  .retained-c2 ul {
    grid-template-columns: 1fr;
  }
  .timeline-histogram {
    grid-auto-columns: 1.5rem;
  }
}
