/* Looking back: an artist by age (D-011) and "a year ago" on the home page
   (D-019). Only the tokens of style.css; no colour of our own. */

/* ---------- Two ways to see the same works ---------- */
.view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.75rem;
  margin: 0 0 2rem;
  border-bottom: 1px solid var(--line);
}
.view-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}
.view-tabs a:hover { color: var(--ink); text-decoration: none; }
.view-tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--ink); }
.gallery-room .view-tabs { margin-top: calc(clamp(2rem, 5vw, 4rem) * -0.5); }

/* In a room, which artist the by-age view follows. */
.timeline-artists { margin: 0 0 1.5rem; }
.timeline-artists .room-chips li { padding: 0; }
.timeline-artists .room-chips a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 1rem;
  border-radius: 999px;
  color: var(--ink);
}
.timeline-artists .room-chips a:hover { text-decoration: none; background: var(--hover); }
.timeline-artists .room-chips li:has(a[aria-current]) { background: var(--ink); border-color: var(--ink); }
.timeline-artists .room-chips a[aria-current] { color: var(--paper); }

/* ---------- The timeline: one row of small mats per age ---------- */
.age-index {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 0 1.5rem;
  padding: 0.25rem 0;
  background: color-mix(in srgb, var(--wall) 80%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.age-index ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-family: var(--serif);
  font-size: 1.6rem;
  line-height: 1;
}
.age-index li { display: flex; align-items: center; }
.age-index li + li::before { content: "·"; color: var(--faint); padding: 0 0.15rem; }
.age-index a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  color: var(--ink);
}
.age-index a:hover { text-decoration: none; color: var(--muted); }

.age-group { margin: 0 0 clamp(2.5rem, 6vw, 4rem); scroll-margin-top: 4rem; }
.age-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1rem;
  margin: 0 0 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}
.age-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.1;
}
.age-head p { margin: 0; }

.age-works, .memory-works {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(46%, 11rem), 1fr));
  gap: 1.75rem clamp(1rem, 3vw, 2rem);
}
.age-work, .memory-works li { min-width: 0; }
.age-work a, a.memory { position: relative; display: block; color: var(--ink); }
.age-work a:hover, a.memory:hover { text-decoration: none; }
.age-work .mat, .memory .mat { padding: clamp(0.5rem, 1.2vw, 0.85rem); transition: transform 0.25s ease; }
.age-work a:hover .mat, a.memory:hover .mat { transform: translateY(-2px); }
.age-work .mat img, .memory .mat img { aspect-ratio: 4 / 5; object-fit: cover; }
.age-work .label, .memory .label { display: block; padding-top: 0.65rem; }
.age-work .label strong, .memory .label strong { font-size: 1.1rem; }
.age-work time, .memory time { display: block; margin-top: 0.15rem; font-size: 0.82rem; color: var(--muted); }
/* A hidden work stays in a guardian's timeline, dimmed and marked. */
.age-work.is-hidden .mat { opacity: 0.42; box-shadow: none; }
.age-work.is-hidden .label { opacity: 0.7; }

/* ---------- A year ago: a quiet aside below the newest work ---------- */
.memories { margin: 0 0 clamp(3rem, 7vw, 5rem); }
.memories > .eyebrow { margin-bottom: 1.25rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--line); }
.memory-works { grid-template-columns: repeat(auto-fill, minmax(min(46%, 12rem), 1fr)); }
.memory-works h3 {
  margin: 0 0 0.75rem;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.1;
}

@media (max-width: 40rem) {
  .age-index ol { font-size: 1.4rem; }
}
