/* Benny Graves — the song page, in the Living Poster's language: paper stock with grain, key-black ink and the
   cap-orange spot ink, the cover pasted up as a white-bordered print with masking tape, printed rules and buttons.
   Texture and print effects touch the paper, the tape and the lettering only — never the cover art. Every rule is
   under .view-song. Day: paper. Night: black stock, bone ink, luminous orange. */

.view-song {
  --sg-paper: #efeae0;
  --sg-ink: #181512;
  --sg-soft: rgba(24, 21, 18, .62);
  --sg-rule: rgba(24, 21, 18, .9);
  --sg-spot: #ff4a1f;
  --sg-spot-text: #c7300d;
  --sg-plate: #181512;
  --sg-border: #fbf9f4;
  --sg-tape: rgba(236, 228, 206, .9);
  --sg-tape-edge: rgba(120, 100, 60, .18);
  --sg-shadow: rgba(40, 28, 16, .34);
  --sg-label: #f6f1e7;
  --sg-grain: url(../finder/assets/grain-day.png);
  --sg-face: 'Anybody', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --sg-m: clamp(16px, 4vw, 56px);
  color: var(--sg-ink);
  background: var(--sg-grain) 0 0 / 320px 320px repeat, var(--sg-paper);
  font-family: var(--sg-face);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: clip;
}
html[data-theme="night"] .view-song {
  --sg-paper: #0e0d0c;
  --sg-ink: #f0e8d8;
  --sg-soft: rgba(240, 232, 216, .66);
  --sg-rule: rgba(240, 232, 216, .85);
  --sg-spot: #ff5a2a;
  --sg-spot-text: #ff6a3d;
  --sg-plate: #efe5d1;
  --sg-border: #ece6d9;
  --sg-tape: rgba(212, 202, 178, .8);
  --sg-tape-edge: rgba(0, 0, 0, .25);
  --sg-shadow: rgba(0, 0, 0, .7);
  --sg-label: #ece5d6;
  --sg-grain: url(../finder/assets/grain-night.png);
}
.view-song *, .view-song *::before, .view-song *::after { box-sizing: border-box }
.view-song :focus-visible { outline: 3px solid var(--sg-spot); outline-offset: 3px }
.view-song .sg-title:focus { outline: none } /* a heading that takes focus after a route change: no ring */
.view-song .sg-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0 }
.view-song svg { flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round }

.view-song .sg { display: block; padding-top: var(--bg-nav-h, 64px) }
.view-song .sg-in { max-width: 1240px; margin: 0 auto; padding: 14px var(--sg-m) calc(48px + env(safe-area-inset-bottom)) }
.view-song .sg-missing { padding: 40px 0 }
.view-song .sg-missing .sg-title { color: var(--sg-ink) }

/* small poster copy between two printed rules */
.view-song .sg-strip {
  display: flex; justify-content: space-between; gap: 12px; margin: 0; padding: 7px 0 6px;
  border-top: 2px solid var(--sg-ink); border-bottom: 2px solid var(--sg-ink);
  text-transform: uppercase; font-size: 12px; line-height: 1.2; letter-spacing: .14em; font-weight: 800; font-variation-settings: 'wdth' 82;
}
.view-song .sg-strip-r { color: var(--sg-spot-text); text-align: right }

/* ---------- the hero: the print and the copy ---------- */
.view-song .sg-hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 34px; margin-top: 34px }
.view-song .sg-print { position: relative; margin: 0 6px; transform: rotate(-1.2deg) }
.view-song .sg-print-face {
  display: block; padding: 4.5%; background: var(--sg-border);
  box-shadow: 0 .5px 0 rgba(0, 0, 0, .1), 0 1px 2px rgba(0, 0, 0, .12), 0 24px 40px -26px var(--sg-shadow);
}
.view-song .sg-print-face img { display: block; width: 100%; height: auto; aspect-ratio: 1; user-select: none; -webkit-user-drag: none }
/* masking tape over the print's border (never over the art) */
.view-song .sg-tape { position: absolute; display: block; height: 30px; pointer-events: none }
.view-song .sg-tape::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .25), transparent 40%, rgba(0, 0, 0, .05)), var(--sg-tape);
  clip-path: polygon(0 8%, 4% 0, 7% 12%, 10% 2%, 90% 0, 93% 14%, 96% 3%, 100% 10%, 100% 92%, 96% 100%, 93% 88%, 89% 100%, 11% 98%, 7% 86%, 4% 100%, 0 90%);
  box-shadow: inset 0 0 0 1px var(--sg-tape-edge);
}
.view-song .sg-tape { height: 26px }
/* tape lies on the white border only: its inner edge stops short of the art (border = 4.5% of the print) */
.view-song .sg-tape-a { left: 31%; top: -19px; width: 38%; transform: rotate(-1.6deg) }
.view-song .sg-tape-b { left: 34%; bottom: -19px; width: 32%; transform: rotate(1.4deg) }

.view-song .sg-copy { min-width: 0 }
.view-song .sg-artist {
  margin: 0 0 12px; text-transform: uppercase; font-weight: 900; font-variation-settings: 'wdth' 70; font-size: 18px; letter-spacing: .08em;
}
/* the title: spot ink over a halftone shadow plate, like the poster's name; it steps down until its longest word fits */
.view-song .sg-title {
  display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; color: var(--sg-spot); isolation: isolate;
  text-transform: uppercase; font-weight: 900; font-variation-settings: 'wdth' 60; font-size: clamp(48px, 15vw, 112px);
  line-height: .86; letter-spacing: -.005em; overflow-wrap: normal; hyphens: none; text-wrap: balance;
}
.view-song .sg-title > span { grid-area: 1 / 1; min-width: 0 }
.view-song .sg-t-plate {
  z-index: -1; transform: translate(.04em, .045em); color: transparent;
  background-image: radial-gradient(circle at center, var(--sg-plate) 0 33%, transparent 37%), radial-gradient(circle at center, var(--sg-plate) 0 33%, transparent 37%);
  background-size: 6px 6px; background-position: 0 0, 3px 3px;
  -webkit-background-clip: text; background-clip: text;
}

/* the facts, printed as ruled lines */
.view-song .sg-facts { margin: 30px 0 0; padding: 0; border-bottom: 2px solid var(--sg-ink) }
.view-song .sg-fact { display: grid; grid-template-columns: 7.2em minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 10px 0 9px; border-top: 1px solid var(--sg-rule) }
.view-song .sg-fact:first-child { border-top-width: 2px }
.view-song .sg-fact dt { text-transform: uppercase; font-weight: 800; font-variation-settings: 'wdth' 82; font-size: 11.5px; letter-spacing: .14em; color: var(--sg-soft) }
.view-song .sg-fact dd { margin: 0; text-transform: uppercase; font-weight: 850; font-variation-settings: 'wdth' 76; font-size: 18px; letter-spacing: .04em; line-height: 1.2 }
.view-song .sg-fact dd a { color: var(--sg-spot-text); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px }
.view-song .sg-e {
  display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 8px; vertical-align: 1px;
  background: var(--sg-ink); color: var(--sg-paper); font-size: 12px; font-weight: 900; letter-spacing: 0; line-height: 1;
}

/* buttons: the poster's printed buttons */
.view-song .sg-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 28px }
.view-song .sg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 52px; padding: 0 16px;
  border: 2.5px solid var(--sg-ink); background: var(--sg-paper); color: var(--sg-ink); text-decoration: none;
  text-transform: uppercase; letter-spacing: .08em; font-size: 14px; font-weight: 850; font-variation-settings: 'wdth' 80; line-height: 1; white-space: nowrap;
  transition: transform .15s ease; touch-action: manipulation;
}
.view-song .sg-btn:active { transform: translateY(1px) }
.view-song .sg-btn svg { width: 16px; height: 16px }
.view-song .sg-btn-ink { grid-column: 1 / -1; min-height: 58px; background: var(--sg-ink); color: var(--sg-paper); font-size: 16px }
.view-song .sg-i-play { fill: var(--sg-spot); stroke: none; width: 17px !important; height: 17px !important }
.view-song .sg-ext .sg-i-out { color: var(--sg-spot-text) }
@media (hover: hover) {
  .view-song .sg-btn:hover { box-shadow: 4px 4px 0 var(--sg-spot) }
  .view-song .sg-link:hover span { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px }
}
.view-song .sg-more { display: flex; flex-direction: column; gap: 0; margin: 20px 0 0 }
.view-song .sg-link {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 2px; border-bottom: 1px solid var(--sg-rule);
  color: var(--sg-ink); text-decoration: none; text-transform: uppercase; font-weight: 900; font-variation-settings: 'wdth' 68; font-size: 20px; letter-spacing: .02em;
}
.view-song .sg-link svg { width: 22px; height: 22px; color: var(--sg-spot-text) }

/* ---------- previous / next: two label slips with the neighbouring covers ---------- */
.view-song .sg-nb { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 44px }
.view-song .sg-tab {
  display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 10px 10px 12px; background: var(--sg-label); color: #1b1611;
  text-decoration: none; box-shadow: 0 1px 1px rgba(0, 0, 0, .16), 0 10px 18px -12px var(--sg-shadow); transition: transform .2s cubic-bezier(.3, 1.4, .5, 1);
}
.view-song .sg-tab-prev { transform: rotate(-.8deg) }
.view-song .sg-tab-next { transform: rotate(.8deg) }
.view-song .sg-tab-none { visibility: hidden }
.view-song .sg-tab img { display: block; width: 100%; height: auto; aspect-ratio: 1; padding: 0; background: #fbf9f4 }
.view-song .sg-tab-t { display: flex; flex-direction: column; gap: 5px; min-width: 0 }
.view-song .sg-tab em {
  display: flex; align-items: center; gap: 6px; font-style: normal; text-transform: uppercase; font-weight: 800; font-variation-settings: 'wdth' 82;
  font-size: 10.5px; letter-spacing: .12em; color: rgba(27, 22, 17, .62)
}
.view-song .sg-tab em svg { width: 14px; height: 14px; color: #a02a07 }
.view-song .sg-tab-next em { justify-content: flex-end }
.view-song .sg-tab-next .sg-tab-t { text-align: right }
.view-song .sg-tab b { font-weight: 900; font-variation-settings: 'wdth' 64; text-transform: uppercase; font-size: 18px; line-height: .98; color: #a02a07; overflow-wrap: anywhere }
@media (hover: hover) {
  .view-song .sg-tab:hover { transform: rotate(0deg) translateY(-4px) }
}

/* ---------- wider: print left, copy right; the slips go side by side under them ---------- */
@media (min-width: 760px) {
  .view-song .sg-in { padding-top: 18px }
  .view-song .sg-hero { grid-template-columns: minmax(0, 46%) minmax(0, 1fr); gap: clamp(36px, 5vw, 80px); align-items: start; margin-top: clamp(36px, 4vw, 56px) }
  .view-song .sg-print { margin: 0 10px 0 4px; position: sticky; top: calc(var(--bg-nav-h, 64px) + 24px) }
  .view-song .sg-title { font-size: clamp(56px, 7.4vw, 120px) }
  .view-song .sg-artist { font-size: 20px }
  .view-song .sg-fact dd { font-size: 20px }
  .view-song .sg-acts { grid-template-columns: repeat(3, auto); justify-content: start }
  .view-song .sg-btn-ink { grid-column: auto; min-height: 56px; padding: 0 28px }
  .view-song .sg-btn { padding: 0 22px }
  .view-song .sg-more { flex-direction: row; flex-wrap: wrap; gap: 8px 28px; margin-top: 26px }
  .view-song .sg-link { border-bottom: 0; padding: 0; font-size: 22px; justify-content: flex-start }
  .view-song .sg-nb { grid-template-columns: minmax(0, 460px) minmax(0, 460px); justify-content: space-between; gap: clamp(20px, 3vw, 40px); margin-top: clamp(56px, 6vw, 88px) }
  .view-song .sg-tab { flex-direction: row; align-items: center; gap: 16px; padding: 12px 18px 12px 12px }
  .view-song .sg-tab img { width: 96px; flex: none }
  .view-song .sg-tab-next { flex-direction: row-reverse; padding: 12px 12px 12px 18px }
  .view-song .sg-tab-t { flex: 1 }
  .view-song .sg-tab b { font-size: 24px }
}
@media (min-width: 1200px) {
  .view-song .sg-hero { grid-template-columns: minmax(0, 520px) minmax(0, 1fr) }
}

@media (prefers-reduced-motion: reduce) {
  .view-song .sg-btn, .view-song .sg-tab { transition: none }
}
