/* Sugar Field Guide Watches - reference timeline (museum catalog skin) */

.timeline-page { min-height: 100dvh; }

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

/* Board layout ------------------------------------------------------------ */

.timeline-board {
  padding-top: 20px;
}

.resultbar__note {
  color: var(--muted);
}

/* Shared row grid: year | thumb | identity | plot | value */
.timeline-board {
  --tl-cols: 44px 32px minmax(0, 1.05fr) minmax(220px, 2.4fr) minmax(72px, auto);
  --tl-gap: 14px;
}

.timeline-scale,
.timeline-row {
  display: grid;
  grid-template-columns: var(--tl-cols);
  gap: var(--tl-gap);
  align-items: center;
}

/* Sticky axis + rug ------------------------------------------------------- */

.timeline-scale {
  position: sticky;
  top: 56px;
  z-index: 10;
  padding: 8px 0 6px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 4px;
}

.timeline-scale__label {
  grid-column: 1 / 4;
  color: var(--muted);
  font-family: var(--sans);
  font-size: var(--label);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.timeline-scale__plot {
  position: relative;
  height: 38px;
  min-width: 0;
}

.timeline-axis,
.timeline-rug {
  position: absolute;
  inset: 0;
}

.timeline-axis__tick {
  position: absolute;
  left: var(--x);
  bottom: 0;
  transform: translateX(-50%);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.timeline-axis__tick::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -14px;
  height: 6px;
  border-left: 1px solid var(--ink);
}

.timeline-axis__baseline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  border-top: 1px solid var(--ink);
}

.timeline-rug__mark {
  position: absolute;
  left: var(--x);
  bottom: 14px;
  width: 1px;
  height: var(--h);
  background: var(--ink);
  opacity: 0.32;
  transform: translateX(-0.5px);
}

/* Chart rows -------------------------------------------------------------- */

.timeline-chart {
  display: grid;
}

.timeline-row {
  min-height: 56px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  transition: background 140ms ease;
}

.timeline-row:hover,
.timeline-row:focus-visible {
  background: var(--hover);
  outline: none;
}

.timeline-row__year {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.timeline-row__thumb {
  position: relative;
  width: 32px;
  height: 32px;
  background: #ffffff;
  border: 1px solid var(--line);
  overflow: hidden;
}

.timeline-row__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.timeline-row__thumb--empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.timeline-row__identity {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.timeline-row__ref {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 1.15;
  white-space: nowrap;
}

.timeline-row__meta {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.timeline-row__plot {
  position: relative;
  height: 22px;
  min-width: 0;
}

.timeline-row__plot::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px dashed var(--line);
  transform: translateY(-0.5px);
}

.timeline-row__tick {
  position: absolute;
  left: var(--x);
  top: 40%;
  bottom: 40%;
  border-left: 1px solid var(--line);
}

.timeline-row__dot {
  position: absolute;
  left: var(--year-pct);
  top: 50%;
  width: 9px;
  height: 9px;
  background: var(--ink);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.timeline-row:hover .timeline-row__dot,
.timeline-row:focus-visible .timeline-row__dot {
  background: var(--accent);
}

.timeline-row__value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
  text-align: right;
}

.timeline-row__price {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.timeline-row__variants {
  max-width: 26ch;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-empty {
  padding: 32px 16px;
  border: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: 500;
}

/* Undated ---------------------------------------------------------------- */

.timeline-undated {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line-strong);
}

.timeline-undated__head {
  display: grid;
  gap: 6px;
  max-width: 62ch;
  margin-bottom: 16px;
}

.timeline-undated__head h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.timeline-undated__head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.timeline-undated__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}

.timeline-undated__list a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.timeline-undated__list a:hover,
.timeline-undated__list a:focus-visible {
  color: var(--accent);
  outline: none;
}

.timeline-undated__list strong {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.005em;
}

.timeline-undated__list span {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Mobile ---------------------------------------------------------------- */

@media (max-width: 760px) {
  .timeline-scale {
    grid-template-columns: 40px minmax(0, 1fr);
    top: 48px;
  }

  .timeline-scale__label {
    grid-column: 1;
  }

  .timeline-scale__plot {
    grid-column: 2;
  }

  .timeline-row {
    grid-template-columns: 40px 32px minmax(0, 1fr) auto;
    grid-template-areas:
      "year thumb identity value"
      "plot plot   plot     plot";
    row-gap: 8px;
    padding: 10px 0;
  }

  .timeline-row__year { grid-area: year; }
  .timeline-row__thumb { grid-area: thumb; }
  .timeline-row__identity { grid-area: identity; }
  .timeline-row__value { grid-area: value; }
  .timeline-row__plot { grid-area: plot; height: 18px; }

  .timeline-row__variants { display: none; }
}

/* Modern timeline pass ---------------------------------------------------- */
.timeline-board {
  padding-top: 0;
}

.timeline-scale {
  top: 78px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  box-shadow: 0 14px 36px rgba(34, 31, 25, 0.06);
}

.timeline-axis__baseline,
.timeline-axis__tick::before {
  border-color: var(--line-strong);
}

.timeline-rug__mark {
  background: var(--accent);
  opacity: 0.42;
}

.timeline-chart {
  gap: 8px;
}

.timeline-row {
  min-height: 70px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--paper) 76%, transparent);
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.timeline-row:hover,
.timeline-row:focus-visible {
  border-color: var(--line-strong);
  background: var(--paper);
  transform: translateY(-1px);
}

.timeline-row__thumb {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.timeline-row__ref {
  font-size: 1rem;
  font-weight: 700;
}

.timeline-row__meta,
.timeline-scale__label,
.timeline-row__variants,
.timeline-undated__list span {
  letter-spacing: 0.08em;
}

.timeline-row__plot::before {
  border-top-color: var(--line);
}

.timeline-row__dot {
  background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 12%, transparent);
}

.timeline-row__price {
  font-weight: 700;
}

.timeline-undated {
  border-top-color: var(--line);
}

.timeline-undated__list {
  gap: 8px;
  border-top: 0;
}

.timeline-undated__list a {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--paper) 74%, transparent);
}

@media (max-width: 760px) {
  .timeline-scale {
    top: 58px;
  }

  .timeline-row {
    padding: 12px;
  }
}
