/* =========================================================
   Design tokens
   ========================================================= */
:root {
  --bg: #f5f5f5;
  --fg: #121212;
  --rule: #aaa;
  --accent: #0AFFD6;
  --accent-contrast: #121212;

  --font-sans: 'Libre Franklin', sans-serif;
  --weight-thin: 400;

  --gutter-x: 2rem;
  --section-gap: 2rem;
  --grid-gap: 16px;

  --timeline-h: 200px;
  --placeholder-w: 1200px;
  --placeholder-h: 675px;

  --body-sm: 16px;
  --line-tight: 1.5em;
}

/* =========================================================
   Global base styles
   ========================================================= */
body {
  background-color: var(--bg);
  color: var(--fg);
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-weight: var(--weight-thin);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: normal;
  position: relative;
  display: inline-block;
  padding: 0;
  margin: 0;
}

a {
  color: inherit;
}

a:visited {
  color: inherit;
}

a:focus,
a:active {
  outline: none;
  color: inherit;
}

/* =========================================================
   Page layout
   ========================================================= */
.main {
  padding: 0 2rem;
  margin: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.intro {
  margin-top: 1rem;
  width: 50%;
  max-width: 75ch;
  text-align: left;
  line-height: 1.4rem;
}

.intro #name {
  background-color: var(--accent);
  color: var(--accent-contrast);
}

.footer {
  padding: 2rem 0;
  background-color: var(--bg);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 100%;
}

/* =========================================================
   Icons
   ========================================================= */
.icons {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  justify-content: center;
  align-items: center;
}

.icons a {
  color: inherit;
  opacity: 0.75;
  font-size: 1rem;
}

.icons a:hover {
  opacity: 1;
}

/* =========================================================
   Timeline SVG
   ========================================================= */
.timeline-section {
  margin-top: 0;
  min-height: 60vh;
  position: relative;
}

.timeline {
  padding-top: 1rem;
  width: 100%;
  height: var(--timeline-h);
  position: sticky;
  top: 0;
  z-index: 5;
  cursor: ew-resize;
  display: block;
  background: var(--bg);
}

svg.timeline {
  background: var(--bg);
}

line {
  stroke: var(--rule);
  stroke-width: 2;
}

svg text {
  user-select: none;
  pointer-events: none;
}

/* =========================================================
   Timeline content area
   ========================================================= */
#timeline-content {
  overflow-y: auto;
  height: calc(100vh - var(--timeline-h));
  position: relative;
  z-index: 1;
  padding-bottom: 1rem;
}

#timeline-content .content-section {
  width: 100%;
  margin: var(--section-gap) 0;
  font-size: 16px;
  line-height: 1.4rem;
}

/* Content header */
#timeline-content .content-header {
  text-align: left;
  margin-bottom: 0;
  max-width: 75ch;
  padding-left: 0;
}

#timeline-content .content-header .title {
  background-color: var(--accent);
  color: var(--accent-contrast);
  width: fit-content;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  display: inline-block;
  font-size: 1.5em;
  font-weight: bold;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

#timeline-content .content-header .meta {
  text-transform: none;
  color: #aaa;
  margin-top: 0;
  margin-bottom: 0;
  line-height: 1.4rem;
}

/* Zigzag layout */
#timeline-content .zigzag {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

#timeline-content .zigzag .title {
  font-weight: bold;

}

#timeline-content .features-subtitle {
  text-align: center;
  font-size: 1.5rem;
  font-weight: bolder;
  margin: 0.5rem auto 0.5rem;
  max-width: 45ch;
}

#timeline-content .zig-right,
#timeline-content .zig-left {
  margin-top: 1rem;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  text-align: left;
  justify-content: space-between;
  gap: 3rem;
}

#timeline-content .zig-right .description,
#timeline-content .zig-left .description {
  flex: 1 1 50%;
  max-width: 75ch;
  margin: 0;
  padding: 0;
}

#timeline-content .intro-paragraphs .description {
  flex: 1 1 50%;
  max-width: 50%;
  padding: 0;
  margin: 0;
}

#timeline-content .description .body-text {
  text-align: start;
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.4rem;
}

/* Feature images */
#timeline-content .zig-right .feature-image-container,
#timeline-content .zig-left .feature-image-container {
  flex: 1 1 50%;
  max-width: 50%;
  padding: 0;
  margin: 0;
}

#timeline-content .zig-right > .feature-image,
#timeline-content .zig-left > .feature-image {
  display: block;
  flex: 1 1 50%;
  max-width: calc(50% - 1.5rem);
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(128, 128, 128, 0.3);
  margin: 0;
}

#timeline-content .feature-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(128, 128, 128, 0.3);
  margin: 0 auto;
}

/* =========================================================
   Media cards
   ========================================================= */
.media-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 0;
}

.media-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  background: var(--bg);
}

.media-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.media-card-image {
  width: 100%;
  height: 150px;
  object-fit: contain;
  background: #ffffff;
  display: block;
  padding: 5px;
  box-sizing: border-box;
}

.media-card-content {
  padding: 0.75rem 1rem 1rem 1rem;
  text-align: left;
}

.media-card-title {
  font-size: 16px;
  line-height: 1.4;
  margin: 0 0 0.5rem 0;
  font-weight: normal;
  text-transform: capitalize;
}

.media-card-byline {
  font-size: 14px;
  color: #888;
  margin: 0;
}

/* Section-specific image styles */
.media-links[data-section*="itp"] .media-card-image,
.media-links[data-section*="situ"] .media-card-image {
  object-fit: cover;
  padding: 0;
}

/* =========================================================
   Additional links (legacy)
   ========================================================= */
.additional-links {
  text-align: left;
}

.additional-links p {
  margin: 1rem 0 0.5rem 0;
}

.additional-links ul {
  margin: 0;
  padding-left: 1.2rem;
}

.additional-links li {
  margin-bottom: 0.25rem;
}

/* =========================================================
   Back to top button
   ========================================================= */
.back-to-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: transparent;
  border: none;
  color: #9d9d9dff;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: var(--weight-thin);
  cursor: pointer;
  padding: 0.5rem 1rem;
  transition: opacity 0.3s;
  display: flex;
  justify-content: center;
}

.back-to-top:hover {
  opacity: 0.7;
}

/* =========================================================
   Miscellaneous
   ========================================================= */
#visual-investigator-content .body-text {
  text-transform: none !important;
}

/* =========================================================
   Mobile responsive styles
   ========================================================= */
@media (max-width: 768px) {
  .intro {
    width: 100%;
    max-width: 100%;
    display: block;
  }

  .main {
    padding: 0 1rem;
  }

  #timeline-content {
    padding-left: 0;
    padding-right: 0;
    overflow-y: visible !important;
    height: auto !important;
  }

  #timeline-content .content-header {
    padding: 0;
  }

  #timeline-content .content-header .title {
    font-size: 1.5em;
  }

  #timeline-content .zig-right,
  #timeline-content .zig-left {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }

  #timeline-content .zig-right .description,
  #timeline-content .zig-left .description {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0rem;
    order: -1;
  }

  #timeline-content .intro-paragraphs {
    flex-direction: column;
    gap: 1rem;
  }

  #timeline-content .intro-paragraphs .description {
    flex: 0 0 100%;
    max-width: 100%;
  }

  #timeline-content .features-subtitle {
    font-size: 1.25rem;
    max-width: 90%;
    margin: 1rem auto 1rem;
  }

  #timeline-content .zig-right .feature-image-container,
  #timeline-content .zig-left .feature-image-container {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0;
  }

  #timeline-content .zig-right > .feature-image,
  #timeline-content .zig-left > .feature-image {
    max-width: 100%;
  }

  #timeline-content .feature-image {
    width: 100%;
  }

  .media-links {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
  }

  .media-card-content {
    padding: 0.75rem 1rem 1rem 1rem;
  }

  .timeline-wrapper {
    background: var(--bg);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .timeline {
    width: 2000px;
    background: var(--bg);
    position: relative !important;
    top: auto !important;
  }

  svg.timeline {
    background: var(--bg);
    position: relative !important;
    top: auto !important;
  }

  svg text {
    visibility: visible;
    opacity: 1;
  }

  .timeline-indicator {
    position: fixed;
    left: 50%;
    top: 0;
    height: 130px;
    border-left: 2px solid #FFD60A;
    pointer-events: none;
    transform: translateX(-50%);
    z-index: 10;
    display: none;
  }
}