/* How a child's drawing changes (D-032): the footprint, the year in
   drawings and the way into both. Only the tokens of style.css: the
   drawings and the palette swatches are the only colour on the page. */

.huella-page { max-width: 64rem; }

.huella-head { margin: 0 0 clamp(2rem, 5vw, 3rem); }
.huella-head .eyebrow,
.huella-section > h2.eyebrow,
.huella-entry h2.eyebrow { display: flex; align-items: center; gap: 0.5rem; }
.huella-head .eyebrow .icon,
.huella-section > h2.eyebrow .icon,
.huella-entry h2.eyebrow .icon { width: 1.1rem; height: 1.1rem; }
.huella-head h1 { margin: 0 0 0.75rem; }
.huella-lead {
  margin: 0;
  max-width: 38rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  line-height: 1.3;
  color: var(--muted);
  text-wrap: balance;
}

.huella-section { margin: 0 0 clamp(2.5rem, 6vw, 3.75rem); min-width: 0; }
.huella-section > h2.eyebrow {
  margin: 0 0 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}
.huella-note { margin: 0.75rem 0 0; font-family: var(--serif); font-style: italic; font-size: 1.15rem; }
.huella-note.muted { font-family: var(--sans); font-style: normal; font-size: 0.9rem; }

/* Two columns from a tablet up; one on a phone. */
.huella-grid { display: grid; gap: 0 clamp(2rem, 5vw, 4rem); }
@media (min-width: 48rem) {
  .huella-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- Works ---------- */
a.huella-work { position: relative; display: block; min-width: 0; color: var(--ink); }
a.huella-work:hover { text-decoration: none; }
.huella-work .mat { position: relative; padding: clamp(0.5rem, 1.2vw, 0.85rem); transition: transform 0.25s ease; }
.huella-work:hover .mat { transform: translateY(-2px); }
.huella-work .mat img { aspect-ratio: 4 / 5; object-fit: cover; }
.huella-work.is-hidden .mat { opacity: 0.5; box-shadow: none; }
.huella-work .badge { z-index: 1; }
.huella-caption {
  display: block;
  margin: 0 0 0.75rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.1;
}
.huella-work-label { display: block; padding-top: 0.65rem; }
.huella-work-label strong {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.1rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.huella-work-label > span { display: block; font-size: 0.85rem; color: var(--muted); }
.huella-work-label time { display: block; margin-top: 0.1rem; font-size: 0.8rem; color: var(--muted); }

/* The first and the latest work, side by side even on a phone. */
.huella-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 4vw, 3rem);
  max-width: 40rem;
}
.huella-pair.is-single { grid-template-columns: minmax(0, 1fr); max-width: 20rem; }

/* ---------- Charts: bars in the ink, the busiest one darker ---------- */
svg.huella-chart {
  display: block;
  width: 100%;
  height: 168px;
  overflow: visible;
  color: var(--ink);
}
.huella-chart .chart-base { stroke: var(--line); stroke-width: 1; }
.huella-chart .chart-bar { fill: currentColor; fill-opacity: 0.28; stroke: none; }
.huella-chart .chart-bar.is-peak { fill-opacity: 0.72; }
.huella-chart text { stroke: none; font-family: var(--sans); }
.huella-chart .chart-count { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.huella-chart .chart-label { fill: var(--muted); font-size: 11px; }

/* One line per age, under its chart. */
.huella-milestones {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
}
.huella-milestones li { display: inline-flex; align-items: baseline; gap: 0.35rem; }
.milestone-age { font-family: var(--serif); font-size: 1.15rem; }

/* ---------- Palette ---------- */
.huella-palette { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.huella-palette li { line-height: 0; }
svg.huella-swatch {
  width: clamp(2.5rem, 11vw, 3.5rem);
  height: clamp(2.5rem, 11vw, 3.5rem);
  stroke: var(--line);
  stroke-width: 1;
  filter: drop-shadow(0 1px 2px #0000001f);
}

/* ---------- Chips: tags, people, years ---------- */
.huella-chips li, .huella-years .room-chips li, .huella-entry .room-chips li, .year-picker .room-chips li { padding: 0; }
.huella-chips a, .huella-chips li > span,
.huella-years .room-chips a, .huella-entry .room-chips a, .year-picker .room-chips a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0 1rem;
  border-radius: 999px;
  color: var(--ink);
}
.huella-chips a:hover, .huella-years .room-chips a:hover, .huella-entry .room-chips a:hover, .year-picker .room-chips a:hover { text-decoration: none; background: var(--hover); }
.huella-years .room-chips a, .huella-entry-years .room-chips a, .year-picker .room-chips a { font-family: var(--serif); font-size: 1.15rem; }
.year-picker .room-chips li:has(a[aria-current]) { background: var(--ink); border-color: var(--ink); }
.year-picker .room-chips a[aria-current] { color: var(--paper); }

/* ---------- The way in, on the artist page and in a room ---------- */
.huella-entry { margin: 2rem 0 2.5rem; }
.gallery-room .huella-entry { margin: 0 0 1.5rem; }
.huella-entry .huella-entry-links { margin: 0 0 0.75rem; }
.huella-entry-years { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.huella-entry-years > .muted { display: inline-flex; align-items: center; gap: 0.4rem; }
.huella-entry-years .icon { width: 1rem; height: 1rem; }

/* ---------- The year ---------- */
.year-picker { margin: calc(clamp(2rem, 5vw, 3rem) * -0.5) 0 clamp(2rem, 5vw, 3rem); }

.year-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
  gap: 1.25rem clamp(1rem, 3vw, 2rem);
  margin: 0 0 clamp(2.5rem, 6vw, 3.75rem);
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.year-stats div { display: flex; flex-direction: column-reverse; min-width: 0; }
.year-stats dd {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 7vw, 3.5rem);
  line-height: 1;
  font-variant-numeric: lining-nums;
}
.year-stats dt { margin-top: 0.35rem; font-size: 0.85rem; color: var(--muted); }

.year-loved {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(46%, 14rem), 1fr));
  gap: 1.75rem clamp(1rem, 3vw, 2rem);
}

.year-month { margin: 2.25rem 0 0; }
.year-month-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.85rem;
  margin: 0 0 1rem;
}
.year-month-head h3 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(1.5rem, 4vw, 2rem); line-height: 1.1; }
.year-month-works {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(46%, 9.5rem), 1fr));
  gap: 1.5rem clamp(1rem, 3vw, 1.75rem);
}
.year-more { margin: 0.75rem 0 0; }

.year-notes { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.year-note {
  margin: 0;
  padding: 1rem 1.15rem;
  border-left: 2px solid var(--line);
  background: color-mix(in srgb, var(--paper) 70%, transparent);
}
.year-note p { margin: 0 0 0.5rem; font-family: var(--serif); font-style: italic; font-size: 1.15rem; line-height: 1.35; white-space: pre-line; overflow-wrap: anywhere; }
.year-note footer { font-size: 0.82rem; color: var(--muted); }

.year-closing {
  max-width: 34rem;
  margin: 0 auto clamp(2rem, 5vw, 3rem);
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.4rem, 3.5vw, 1.9rem);
  line-height: 1.3;
  text-align: center;
  text-wrap: balance;
}
.year-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; }
.year-actions .button { min-height: 2.75rem; }
.year-actions .button[aria-busy="true"] { opacity: 0.6; }
.year-sharing { max-width: 34rem; margin: 0 auto 1rem; text-align: center; }
.year-sharing .book-sharing-link { white-space: nowrap; }

@media (max-width: 40rem) {
  .year-actions { flex-direction: column; align-items: stretch; }
  .year-actions .button { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .huella-work .mat { transition: none; }
  .huella-work:hover .mat { transform: none; }
}
