/* Timeline page — brand alignment with homepage */

body.timeline .content-wrapper-timeline {
  width: 100%;
  max-width: 100%;
  padding: 2rem 1rem;
  box-sizing: border-box;
  min-width: 0;
  overflow-x: hidden;
}

body.timeline .timeline-inner {
  max-width: 1100px;
  margin: 0 auto;
  min-width: 0;
}

/* Prevent iOS “zoomed in” / horizontal pan when any child is wider than the viewport */
body.timeline {
  overflow-x: hidden;
}

.timeline-title {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.1;
  color: #1a1a1a;
  max-width: 700px;
  margin: 0 auto 1.5rem;
  text-align: left;
}

.timeline-title .highlight {
  background: linear-gradient(90deg, #ff6b6b, #feca57);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

@media (max-width: 768px) {
  .timeline-title {
    font-size: 34px;
  }
}

.timeline-wrapper {
  position: relative;
  width: 100%;
}

.timeline-spine {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 0.5px;
  background: #e0e0de;
  transform: translateX(-50%);
  z-index: 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px minmax(0, 1fr);
  align-items: start;
  margin-bottom: 3rem;
  position: relative;
  z-index: 1;
}

.timeline-item-card {
  min-width: 0;
  overflow: hidden;
  padding: 0 1.5rem;
}

.timeline-item.left .timeline-item-card {
  grid-column: 1;
  text-align: left;
}

.timeline-item.right .timeline-item-card {
  grid-column: 3;
  text-align: left;
}

.timeline-item-card .event-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.timeline-item-empty {
  min-width: 0;
  min-height: 1px;
}

.timeline-item-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 1rem;
  z-index: 1;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f8f8f6;
  border: 1.5px solid #c0c0be;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 107, 107, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 107, 107, 0);
  }
}

.timeline-dot.latest,
.dot.latest {
  background: #ff6b6b;
  border-color: #ff6b6b;
  animation: pulse 2s infinite;
}

@media (prefers-reduced-motion: reduce) {
  .timeline-dot.latest,
  .dot.latest {
    animation: none;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.35);
  }
}

.timeline-item-date {
  font-size: 12px;
  color: #888884;
  white-space: nowrap;
  text-align: center;
  line-height: 1.4;
}

/* Shown above the card on small screens only (see mobile block) */
.timeline-item-card .event-card-date {
  display: none;
}

.updated-from-planned {
  display: block;
  font-size: 10px;
  color: #854f0b;
  text-align: center;
  margin-top: 2px;
}

.event-card {
  background: #ffffff;
  border: 0.5px solid #e0e0de;
  border-radius: 16px;
  padding: 1.25rem;
  text-align: left;
}

.event-card-summary {
  font-size: 14px;
  color: #1a1a1a;
  line-height: 1.5;
  margin-bottom: 0.75rem;
  text-decoration: none;
  display: block;
}

.event-card-jobs {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 0.75rem;
}

.event-card-jobs-num {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(90deg, #ff6b6b, #feca57);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.event-card-jobs-label {
  font-size: 12px;
  color: #888884;
}

.event-card-jobs-unreported {
  font-size: 13px;
  color: #aaaaaa;
  font-style: italic;
  margin-bottom: 0.75rem;
}

.event-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.event-card-badge {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.event-card-badge.confirmed {
  background: #eaf3de;
  color: #3b6d11;
}

.event-card-badge.planned {
  background: #faeeda;
  color: #854f0b;
}

.event-card-badge.uk {
  background: #e6f1fb;
  color: #185fa5;
}

.event-card-company {
  font-size: 12px;
  color: #ff6b6b;
  text-decoration: none;
  font-weight: 500;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-card-region {
  font-size: 12px;
  color: #888884;
  white-space: nowrap;
}

.event-card-footer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 0.5px solid #e0e0de;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.event-card-footer-spacer {
  flex: 1;
  min-width: 0;
}

.event-card-source {
  font-size: 11px;
  color: #aaaaaa;
  text-decoration: none;
}

.event-card-flag {
  font-size: 11px;
  color: #aaaaaa;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}

.content-wrapper-timeline > .timeline-inner > h1,
.timeline-inner > h1.timeline-title {
  margin-top: 2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 0;
}

.stat-card {
  background: #fff;
  border: 0.5px solid #e0e0de;
  border-radius: 16px;
  padding: 1.25rem 1rem 1rem;
  text-align: left;
  min-width: 0;
}

.stat-label {
  font-size: 12px;
  color: #888884;
  line-height: 1.4;
  margin: 0;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  margin: 0 0 6px;
  background: linear-gradient(90deg, #ff6b6b, #feca57);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.stat-date {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
}

.filters {
  background: #fff;
  border: 0.5px solid #e0e0de;
  border-radius: 16px;
  padding: 1rem 1.25rem 1rem;
  margin-top: 24px;
  text-align: left;
  position: relative;
}

/* Timeline filter form: contain grid overflow; symmetric horizontal padding on small viewports */
.filters.timeline-filters {
  margin-bottom: 4rem;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  padding: 1rem 1rem 1rem;
}

.filters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr minmax(5rem, 6.5rem) minmax(0, 2fr);
  gap: 12px 14px;
  align-items: end;
  min-width: 0;
}

.filters-grid .filters-field {
  min-width: 0;
}

.filters-grid-row2 {
  grid-template-columns: 1fr 1fr 1fr;
  margin-top: 10px;
}

.filters-field-narrow {
  max-width: 100%;
}

.filters-field-search {
  min-width: 0;
}

.filters-field label {
  display: block;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #888884;
  margin-bottom: 5px;
}

.filters input,
.filters select {
  width: 100%;
  padding: 6px 9px;
  border: 0.5px solid #e0e0de;
  border-radius: 8px;
  font-size: 13px;
  margin: 0;
  box-sizing: border-box;
  background: #fff;
}

.filters select {
  cursor: pointer;
}

.filters.timeline-filters select,
.filters.timeline-filters input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.filters-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 0.5px solid #e0e0de;
}

.filters-hint {
  font-size: 12px;
  color: #888;
  line-height: 1.4;
}

.filters-hint kbd {
  font-size: 10px;
  padding: 1px 4px;
  border: 0.5px solid #e0e0de;
  border-radius: 4px;
  background: #fff;
  font-family: inherit;
}

.filters-clear:link,
.filters-clear:visited {
  font-size: 13px;
  color: #333;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.filters-clear:hover {
  color: #111;
}

.filters-submit-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pagination {
  margin: 24px 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 0.5px solid #e0e0de;
}

.pagination-meta {
  font-size: 14px;
  color: #555;
}

.pagination-links {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.pagination-links a:link,
.pagination-links a:visited {
  text-decoration: none;
  color: #111;
  border: 0.5px solid #c0c0be;
  padding: 8px 14px;
  border-radius: 8px;
  background: #fff;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease,
    box-shadow 0.2s ease;
}

.pagination-links a:hover {
  background: #f7f7f7;
  border-color: #1a1a1a;
  color: #111;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

@media screen and (max-width: 768px) {
  /* Spine at 1.5rem; cards from 3.5rem → ~2rem gap spine to card edge */
  .timeline-wrapper {
    padding-left: 0;
    padding-right: 0;
    position: relative;
    min-width: 0;
    overflow-x: hidden;
  }

  .timeline-spine {
    left: 1.5rem;
    width: 0.5px;
    background: #e0e0de;
    position: absolute;
    top: 0;
    bottom: 0;
    transform: none;
  }

  .timeline-item {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-left: 3.5rem;
    margin-bottom: 1.5rem;
    min-width: 0;
    overflow-x: hidden;
  }

  /* Dot + date on one row above card; order puts this before the card on left/right */
  .timeline-item-dot {
    order: -1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    left: 0;
    /* Pull row back so 14px dot stays centred on spine at 1.5rem (content starts at 3.5rem) */
    margin-left: calc(1.5rem - 7px - 3.5rem);
    margin-bottom: 0.5rem;
    /* Do not use max-content or max-width > 100% — that widens the scroll width on mobile */
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    z-index: 1;
  }

  .timeline-item-date {
    display: block;
    font-size: 12px;
    color: #888884;
    white-space: nowrap;
    text-align: left;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .timeline-item-date .updated-from-planned {
    display: block;
    font-size: 10px;
    margin-top: 2px;
    text-align: left;
  }

  .timeline-item-card .event-card-date {
    display: none;
  }

  .dot {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #f8f8f6;
    border: 1.5px solid #e0e0de;
    display: block;
  }

  .timeline-item-empty {
    display: none;
  }

  .timeline-item-card {
    width: 100%;
    padding: 0;
  }

  .timeline-item-card .event-card {
    max-width: 100%;
  }

  .event-card-company {
    max-width: 100%;
  }

  .event-card {
    max-width: 100%;
    width: 100%;
    padding: 1rem;
  }

  .event-card-summary {
    font-size: 13px;
  }

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

  .timeline-filters {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .timeline-filters select,
  .timeline-filters input {
    width: 100%;
  }

  .filters-grid {
    grid-template-columns: 1fr;
  }

  .filters-grid-row2 {
    grid-template-columns: 1fr;
  }

  .filters-field-narrow {
    max-width: none;
  }

  .filters-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

.timeline-inner form {
  text-align: left;
  margin-top: 10px;
}
