/* ==========================================================
   ARCHIVE / CHAPTER TIMELINE
   ========================================================== */

/* ==========================================================
   ARCHIVE / CHAPTER TIMELINE

   Rendered by timeline.js into #timeline-records.

   timeline.js combines expired entries from _data/events.json with
   reconstructed records from _data/history.json, normalizes them,
   sorts them chronologically, and emits the .timeline-* classes below.

   The tiles are intentionally borderless. Chronology, typography, and
   whitespace provide the structure; the section rule separates the
   archive from the page introduction.
   ========================================================== */


/* ----------------------------------------------------------
   INTRO
   ---------------------------------------------------------- */

.archive-intro {
  padding: 55px 0 55px !important;
  min-height: 0;
}

.archive-intro .interior-title {
  margin-top: 10px;
  margin-bottom: 28px;
}

.archive-intro .dek {
  max-width: 560px;
  margin-top: 0;
  margin-bottom: 0;
}


/* ----------------------------------------------------------
   TIMELINE SECTION
   ---------------------------------------------------------- */

.archive-section {
  padding: 55px 0 85px;
  border-top: 1px solid var(--ink);
}


/* ----------------------------------------------------------
   TIMELINE GRID
   ---------------------------------------------------------- */

.timeline-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));

  column-gap: clamp(40px, 4.5vw, 70px);
  row-gap: 65px;

  width: 100%;
}


/* ----------------------------------------------------------
   RECORD
   ---------------------------------------------------------- */

.timeline-record {
  display: flex;
  flex-direction: column;

  min-width: 0;
  padding: 0;

  border: 0;
}


/* ----------------------------------------------------------
   INDEX
   ---------------------------------------------------------- */

.timeline-index {
  margin-bottom: 16px;

  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1;

  letter-spacing: 0.1em;

  opacity: 0.45;
}


/* ----------------------------------------------------------
   DATE / TYPE
   ---------------------------------------------------------- */

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;

  gap: 7px;

  margin-bottom: 14px;

  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.3;

  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timeline-type::before {
  content: "/";
  margin-right: 7px;

  opacity: 0.45;
}


/* ----------------------------------------------------------
   TITLE
   ---------------------------------------------------------- */

.timeline-title {
  max-width: 420px;

  margin: 0 !important;

  font-family: var(--font-sans);
  font-size: clamp(1.55rem, 1.8vw, 2.1rem) !important;
  font-weight: 500;

  line-height: 1 !important;
  letter-spacing: -0.04em;
}


/* ----------------------------------------------------------
   SUMMARY
   ---------------------------------------------------------- */

.timeline-summary {
  max-width: 420px;

  margin: 18px 0 0;

  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.42;
}


/* ----------------------------------------------------------
   LINKS
   ---------------------------------------------------------- */

.timeline-links {
  display: flex;
  flex-wrap: wrap;

  gap: 8px 16px;

  margin-top: 22px;
}

.timeline-source-link {
  display: inline-block;

  padding-bottom: 2px;

  border-bottom: 1px solid var(--ink);

  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.3;

  letter-spacing: 0.05em;
}


/* ----------------------------------------------------------
   EMPTY / ERROR
   ---------------------------------------------------------- */

.archive-empty,
.archive-error {
  grid-column: 1 / -1;

  margin: 0;

  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.4;

  letter-spacing: 0.08em;
}


/* ----------------------------------------------------------
   TABLET
   ---------------------------------------------------------- */

@media (max-width: 1050px) {

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

    column-gap: 45px;
    row-gap: 60px;
  }

}


/* ----------------------------------------------------------
   MOBILE
   ---------------------------------------------------------- */

@media (max-width: 700px) {

  .archive-intro {
    padding: 45px 0 45px !important;
  }

  .archive-section {
    padding: 45px 0 65px;
  }

  .timeline-grid {
    grid-template-columns: 1fr;
    row-gap: 50px;
  }

  .timeline-title {
    font-size: 1.7rem !important;
  }

  .timeline-summary {
    font-size: 1rem;
  }

}

/* =========================================================
   ARCHIVE — MOBILE IMAGE TILES
   ========================================================= */

@media (max-width: 900px) {

  .timeline-record {
    position: relative;
    overflow: hidden;
    cursor: pointer;
  }


  /* Let the archival image be the default view */

  .timeline-image {
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    object-fit: cover;
  }

  /* Hide the information until the tile is tapped */

  .timeline-overlay {
    position: absolute;
    inset: 0;

    display: flex;
    flex-direction: column;
    justify-content: flex-end;

    padding: 28px 24px;

    background:
      linear-gradient(
        to top,
        rgba(17, 17, 15, 0.96) 0%,
        rgba(17, 17, 15, 0.82) 48%,
        rgba(17, 17, 15, 0.18) 100%
      );

    color: var(--paper);

    opacity: 0;
    visibility: hidden;

    transition:
      opacity 180ms ease,
      visibility 180ms ease;
  }


  /* Tapped/open card */

  .timeline-record.is-open .timeline-overlay {
    opacity: 1;
    visibility: visible;
  }


  /* Make the information readable without dominating */

  .timeline-meta {
    font-size: 0.62rem;
  }

  .timeline-title {
    margin-top: 12px;
    font-size: clamp(1.8rem, 8vw, 2.6rem);
    line-height: 0.95;
  }

  .timeline-summary {
    margin-top: 18px;
    font-size: 1.05rem;
    line-height: 1.35;
  }

}
/* ==========================================================
   TIMELINE IMAGE TILES
   ========================================================== */

.timeline-record {
  position: relative;

  min-width: 0;
  aspect-ratio: 4 / 5;

  overflow: hidden;

  background: var(--ink);
}


/* ----------------------------------------------------------
   IMAGE

   Images completely fill each tile. object-fit: cover keeps
   varying source dimensions visually consistent.
   ---------------------------------------------------------- */

.timeline-image {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;
  
  filter: grayscale(100%) contrast(1.08);
  
  transition:
    transform 300ms ease,
    opacity 220ms ease;
}

.timeline-image-placeholder {
  background: var(--blue);
}


/* ----------------------------------------------------------
   HOVER OVERLAY

   Hidden by default on pointer devices. The dark wash makes
   text readable without requiring every archival photograph
   to have the same brightness or contrast.
   ---------------------------------------------------------- */

.timeline-overlay {
  position: absolute;
  inset: 0;

  display: flex;
  flex-direction: column;
  justify-content: flex-end;

  padding: 28px;

  color: var(--paper);

  background:
    linear-gradient(
      to top,
      rgba(17, 17, 15, 0.96) 0%,
      rgba(17, 17, 15, 0.76) 52%,
      rgba(17, 17, 15, 0.14) 100%
    );

  opacity: 0;

  transition: opacity 220ms ease;
}


/* Show archival information on pointer hover or keyboard focus. */

.timeline-record:hover .timeline-overlay,
.timeline-record:focus-within .timeline-overlay {
  opacity: 1;
}

.timeline-record:hover .timeline-image,
.timeline-record:focus-within .timeline-image {
  transform: scale(1.025);
  opacity: 0.72;
}


/* ----------------------------------------------------------
   INDEX
   ---------------------------------------------------------- */

.timeline-index {
  margin-bottom: 12px;

  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1;

  letter-spacing: 0.1em;

  opacity: 0.7;
}


/* ----------------------------------------------------------
   DATE / TYPE
   ---------------------------------------------------------- */

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;

  gap: 7px;

  margin-bottom: 12px;

  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.3;

  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timeline-type::before {
  content: "/";
  margin-right: 7px;

  opacity: 0.6;
}


/* ----------------------------------------------------------
   TITLE
   ---------------------------------------------------------- */

.timeline-title {
  margin: 0 !important;

  font-family: var(--font-sans);
  font-size: clamp(1.45rem, 1.8vw, 2.05rem) !important;
  font-weight: 500;

  line-height: 0.98 !important;
  letter-spacing: -0.04em;
}


/* ----------------------------------------------------------
   SUMMARY
   ---------------------------------------------------------- */

.timeline-summary {
  margin: 15px 0 0;

  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.38;
}


/* ----------------------------------------------------------
   LINKS
   ---------------------------------------------------------- */

.timeline-links {
  display: flex;
  flex-wrap: wrap;

  gap: 7px 14px;

  margin-top: 18px;
}

.timeline-source-link {
  display: inline-block;

  padding-bottom: 2px;

  border-bottom: 1px solid currentColor;

  font-family: var(--font-mono);
  font-size: 0.67rem;
  line-height: 1.3;

  letter-spacing: 0.04em;
}


/* ----------------------------------------------------------
   TOUCH DEVICES

   Phones and tablets cannot reliably hover, so the overlay
   remains visible there instead of hiding the information.
   ---------------------------------------------------------- */

@media (hover: none) {

  .timeline-overlay {
    opacity: 1;
  }

  .timeline-image {
    opacity: 0.68;
  }

}
