/* Oficina da Música: the page of one of the "Músicos da casa".
   Loaded after home.css (tokens, navigation, buttons, section heading, footer)
   and catalog.css (breadcrumb, .vh). */

.ar-page {
  padding-bottom: clamp(72px, 10vw, 136px);
}

/* ---------- The musician ---------- */

/* The portrait was shot on black and its black is the page ground
   (tools/make_artist_page.py): no frame, he stands on the page beside his name. */
.ar-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 3vw, 48px);
  padding: clamp(4px, 1vw, 16px) var(--pad) 0;
}

/* Display: the name takes the page headline's voice, one line each. */
.ar-page h1 {
  font-size: clamp(2.75rem, min(5.35vw, 10.4vh), 5.5rem);
  font-weight: 800;
  font-stretch: 125%;
  line-height: 0.94;
  letter-spacing: -0.022em;
}

.ar-page h1 span {
  display: block;
}

/* Lede, on a wider measure than the home page's 34ch: it is one long sentence. */
.ar-lede {
  max-width: 42ch;
  margin-top: clamp(16px, 2vw, 26px);
  font-size: clamp(1.0625rem, 1.35vw, 1.25rem);
  line-height: 1.45;
  color: var(--ink-2);
  text-wrap: pretty;
}

.ar-portrait {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 820px;
}

/* The picture already fades to the ground, but lossy WebP lands its flat
   border one level off the page colour. The mask dissolves that last step,
   so no edge of the frame can be found. */
.ar-portrait img {
  width: 100%;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent),
    linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent),
    linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
  mask-composite: intersect;
}

.ar-portrait figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
}

.ar-credit {
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--ink-3);
}

/* ---------- The story ---------- */

.ar-story,
.ar-records,
.ar-follow {
  padding: clamp(72px, 10vw, 136px) var(--pad) 0;
}

.chapters {
  display: grid;
  gap: clamp(48px, 7vw, 104px);
}

.chapter {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: center;
  column-gap: clamp(10px, 1.4vw, 18px);
}

.chapter-text {
  grid-column: 1 / span 5;
  grid-row: 1;
}

/* Never drawn wider than the photograph is (--w, written by the generator). */
.chapter-photo {
  grid-column: 7 / span 6;
  grid-row: 1;
  justify-self: end;
  width: 100%;
  max-width: calc(var(--w) * 1px);
}

.chapter:nth-child(even) .chapter-text {
  grid-column: 8 / span 5;
}

.chapter:nth-child(even) .chapter-photo {
  grid-column: 1 / span 6;
  justify-self: start;
}

/* Title large */
.chapter h3 {
  font-size: clamp(1.25rem, 2vw, 1.625rem);
  font-weight: 750;
  font-stretch: 116%;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.chapter-text p {
  max-width: 58ch;
  margin-top: 0.9em;
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}

.chapter-text h3 + p {
  margin-top: clamp(12px, 1.4vw, 18px);
}

.chapter-text cite {
  font-style: normal;
  color: var(--ink);
}

.chapter-photo img {
  width: 100%;
  border-radius: var(--radius);
  background: var(--ground-2);
}

/* A story told in prose, without a photograph beside each paragraph. */
.ar-prose {
  max-width: 68ch;
}

.ar-prose p {
  margin-top: 0.95em;
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}

.ar-prose p:first-child {
  margin-top: 0;
}

.ar-prose cite {
  font-style: normal;
  color: var(--ink);
}

/* The instrument, linked to its category. The photograph is a catalog
   cut-out, so it sits on the same paper as the product cards. */
.ar-bass,
.ar-shots {
  padding: clamp(72px, 10vw, 136px) var(--pad) 0;
}

.bass-link {
  display: grid;
  grid-template-columns: minmax(180px, 300px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 4vw, 56px);
  max-width: 920px;
  color: var(--ink);
  text-decoration: none;
}

.bass-link:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 6px;
  border-radius: var(--radius);
}

.bass-photo {
  display: grid;
  place-items: center;
  aspect-ratio: 47 / 58;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--paper);
}

.bass-photo img {
  width: 84%;
  height: 84%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.bass-photo.is-dark {
  background: #000;
}

.bass-photo.is-dark img {
  width: 100%;
  height: 100%;
  mix-blend-mode: normal;
}

.bass-text h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.75rem);
  font-weight: 800;
  font-stretch: 122%;
  line-height: 1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.bass-text p {
  max-width: 36ch;
  margin-top: 0.75em;
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
}

.bass-go {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 44px;
  margin-top: 12px;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.2em;
}

.bass-go .ico {
  width: 1em;
  height: 1em;
  transition: transform 0.3s var(--ease-out);
}

.bass-link:hover .bass-go,
.bass-link:focus-visible .bass-go {
  color: var(--red-hi);
}

.bass-link:hover .bass-go .ico,
.bass-link:focus-visible .bass-go .ico {
  transform: translateX(3px);
}

.shot-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 18px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.shot-row img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: 50% 18%;
  border-radius: var(--radius);
  background: var(--ground-2);
}

.shot-row li:nth-child(2) img {
  object-position: 50% 42%;
}

.shot-row li:nth-child(3) img {
  object-position: 78% 78%;
}

/* ---------- The records ---------- */

/* A record is its cover and three lines. The title is the link, stretched
   over the whole item, so the link is named by the title alone. Covers are
   the artist's artwork, shown as it is; a pale one is held under the ground's
   light at rest so it is not a white field, and comes up on hover. */
.record,
.record-lead {
  position: relative;
}

.record img,
.record-lead img {
  border-radius: 10px;
  background: var(--ground-2);
  filter: brightness(0.86);
  transition: filter 0.4s;
}

.record:hover img,
.record:focus-within img,
.record-lead:hover img,
.record-lead:focus-within img {
  filter: brightness(1);
}

.record a,
.record-lead a {
  color: var(--ink);
  text-decoration: none;
}

.record a::after,
.record-lead a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
}

.record a:focus-visible,
.record-lead a:focus-visible {
  outline: none;
}

.record a:focus-visible::after,
.record-lead a:focus-visible::after {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

/* The newest record, larger, with what it is. */
.record-lead {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: center;
  column-gap: clamp(10px, 1.4vw, 18px);
}

.record-lead img {
  grid-column: 1 / span 4;
  width: 100%;
}

.record-lead-text {
  grid-column: 6 / span 6;
}

/* Record title: the section heading's voice, one step down. */
.record-lead h3 {
  font-size: clamp(1.75rem, 3.2vw, 2.75rem);
  font-weight: 800;
  font-stretch: 122%;
  line-height: 1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.record-lead p {
  max-width: 50ch;
  margin-top: 0.9em;
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}

.record-lead .record-meta {
  margin-top: 12px;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--ink-3);
}

.record-go {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 44px;
  margin-top: clamp(10px, 1.4vw, 18px);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.2em;
}

.record-go .ico {
  width: 1em;
  height: 1em;
  transition: transform 0.3s var(--ease-out);
}

.record-lead:hover .record-go,
.record-lead:focus-within .record-go {
  color: var(--red-hi);
}

.record-lead:hover .record-go .ico,
.record-lead:focus-within .record-go .ico {
  transform: translate(2px, -2px);
}

/* The others stand on one line, like records on a shelf: not every cover is
   square, so each keeps its shape and its foot on the line. */
.record-shelf {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(28px, 3.4vw, 48px) clamp(10px, 1.4vw, 18px);
  margin-top: clamp(48px, 6vw, 88px);
}

.record-cover {
  display: grid;
  align-items: end;
  justify-items: start;
  aspect-ratio: 1;
}

.record-cover img {
  width: calc(100% * var(--fit, 1));
}

.record-text {
  display: grid;
  gap: 3px;
  margin-top: 12px;
}

/* Card title */
.record-name {
  font-size: 1.0625rem;
  font-weight: 700;
  font-stretch: 112%;
  line-height: 1.2;
  text-wrap: balance;
}

.record-meta {
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  color: var(--ink-3);
}

.record-note {
  margin-top: 3px;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--ink-2);
  text-wrap: pretty;
}

.record:hover .record-name {
  text-decoration: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.2em;
}

/* ---------- Where to hear and follow ---------- */

.ar-follow .sec-head {
  align-items: center;
  margin-bottom: 0;
}

.follow-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.follow-list .btn {
  justify-content: space-between;
  width: 100%;
  padding: 0 1.3em;
}

.follow-list .ico {
  color: var(--ink-3);
  transition: transform 0.3s var(--ease-out), color 0.2s;
}

.follow-list .btn:hover .ico,
.follow-list .btn:focus-visible .ico {
  color: var(--ink);
  transform: translate(2px, -2px);
}

/* What ties the musician to the house, and the way back to the others. */
.ar-back {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 48px;
  margin-top: clamp(40px, 5vw, 72px);
  padding-top: clamp(20px, 2.4vw, 32px);
  border-top: 1px solid var(--line-soft);
}

.ar-back p {
  max-width: 52ch;
  color: var(--ink-2);
  text-wrap: pretty;
}

.ar-back .text-link {
  min-height: 44px;
}

/* ---------- Narrower screens ---------- */

@media (max-width: 1260px) {
  .record-shelf {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 959px) {
  /* The Display formula bottoms out here; the name keeps its lead over the
     section headings while it shares the row with the portrait. */
  .ar-page h1 {
    font-size: clamp(2.75rem, 6.6vw, 4.75rem);
  }

  .chapter {
    grid-template-columns: 1fr;
    row-gap: clamp(20px, 3.4vw, 28px);
  }

  .chapter-text,
  .chapter-photo,
  .chapter:nth-child(even) .chapter-text,
  .chapter:nth-child(even) .chapter-photo {
    grid-column: 1;
    grid-row: auto;
  }

  .chapter-text p {
    max-width: 64ch;
  }

  .chapter-photo,
  .chapter:nth-child(even) .chapter-photo {
    justify-self: start;
    max-width: min(640px, calc(var(--w) * 1px));
  }

  .record-name {
    font-size: 1rem;
  }

  .record-lead {
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    column-gap: clamp(20px, 4vw, 36px);
  }

  .record-lead img,
  .record-lead-text {
    grid-column: auto;
  }

  .record-shelf {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ar-follow .sec-head {
    align-items: start;
  }
}

@media (max-width: 720px) {
  /* Display role on a phone. */
  .ar-page h1 {
    font-size: clamp(2.5rem, 11.6vw, 4.75rem);
  }

  /* Name, sentence and actions first; the portrait under them. */
  .ar-hero {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .ar-portrait {
    justify-self: center;
    max-width: 560px;
  }

  .bass-link {
    grid-template-columns: 1fr;
    max-width: 420px;
  }
}

@media (max-width: 640px) {
  .record-lead {
    grid-template-columns: 1fr;
    row-gap: 20px;
  }

  .record-lead img {
    max-width: 320px;
  }

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

@media (max-width: 359px) {
  .follow-list {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .record img,
  .record-lead img,
  .record-go .ico,
  .follow-list .ico,
  .bass-go .ico {
    transition: none;
  }
}
