/* Music page — "Apple Radio Songbook"
   Pulls into the existing .archive-banner / .panel / .archive-button system. */

.app-view--music[hidden] { display: none; }
.app-view--music {
  display: block;
}

/* Banner reuses .archive-banner; only swap text styling subtly. */
.archive-banner--music .archive-banner__sign p {
  font-style: italic;
}

/* --- Stats strip (reuses .archive-stats grid spacing) --- */

.archive-stats--music article::after {
  content: "♪";
  font-family: "Rye", Georgia, serif;
  font-size: 38px;
  right: 18px;
  top: 16px;
  color: rgba(96, 114, 53, .15);
}

/* --- Now Spinning panel --- */

.music-now {
  position: relative;
}

.music-now__body {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 22px;
  align-items: center;
  padding-top: 4px;
}

/* Phonograph: vinyl record with paper sleeve corner peeking */
.music-now__phono {
  position: relative;
  width: 230px;
  height: 230px;
  margin: 4px auto 0;
}

.music-now__phono::before {
  /* Paper sleeve behind the disc */
  content: "";
  position: absolute;
  inset: 8px -10px -6px 14px;
  background:
    repeating-linear-gradient(0deg, rgba(120, 70, 30, .07) 0 1px, transparent 1px 22px),
    linear-gradient(135deg, #fff6d7 0%, #f3dba6 100%);
  border: 2px solid #b07a3d;
  border-radius: 6px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 247, 218, .55),
    inset 0 -8px 14px rgba(133, 84, 33, .12),
    0 6px 14px rgba(61, 30, 9, .35);
  transform: rotate(-3deg);
  z-index: 0;
}

.music-now__phono::after {
  /* Hand-written "Now Spinning" tape across the sleeve */
  content: "Now Spinnin'";
  position: absolute;
  bottom: -2px;
  right: -16px;
  padding: 2px 10px 1px;
  font-family: "Kalam", "Special Elite", Georgia, cursive;
  font-size: 13px;
  color: #6f2c16;
  background: #fff4d4;
  border: 1px dashed #9e6329;
  border-radius: 3px;
  transform: rotate(-6deg);
  z-index: 2;
  pointer-events: none;
}

.music-now__disc-rot {
  width: 200px;
  height: 200px;
  margin: 12px auto 0;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
  border-radius: 50%;
  cursor: grab;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.music-now__disc-rot:focus-visible {
  box-shadow: 0 0 0 3px rgba(217, 109, 53, .45);
}

.music-now__disc-rot.is-grabbing,
.music-now__disc-rot:active {
  cursor: grabbing;
}

.music-now__disc-rot .music-now__disc {
  margin: 0;
}

.music-now__disc {
  --label-inner: #d96d35;
  --label-outer: #a13018;
  --label-edge: #6b2a13;
  --label-ink: #fff4d4;
  --disc-tint: var(--label-inner);
  position: relative;
  width: 200px;
  height: 200px;
  margin: 12px auto 0;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at center, #181008 0 1px, #0c0804 1px 3px),
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, .14) 0 8%, transparent 18%);
  box-shadow:
    inset 0 0 0 2px #2a1a0a,
    inset 0 0 12px rgba(255, 255, 255, .06),
    0 6px 12px rgba(0, 0, 0, .35);
  display: grid;
  place-items: center;
  animation: music-spin 4.5s linear infinite;
  animation-play-state: paused;
  z-index: 1;
}

.music-now__disc.is-playing {
  animation-play-state: running;
  will-change: transform;
}

.music-now__disc::before {
  content: "";
  position: absolute;
  inset: 5%;
  border-radius: 50%;
  background: radial-gradient(circle at center, transparent 38%, var(--disc-tint) 42%, transparent 70%);
  mix-blend-mode: screen;
  opacity: .3;
  pointer-events: none;
}

.music-now__disc::after {
  /* Catch-light arc on the vinyl */
  content: "";
  position: absolute;
  inset: 2%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, .35) 0 14%, transparent 18%),
    radial-gradient(circle at 70% 78%, rgba(255, 255, 255, .14) 0 9%, transparent 12%);
  pointer-events: none;
}

.music-now__label {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--label-inner) 0 55%, var(--label-outer) 100%);
  color: var(--label-ink);
  border: 2px solid var(--label-edge);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
  display: grid;
  place-items: center;
  font-family: "Rye", Georgia, serif;
  font-size: 22px;
  letter-spacing: .03em;
  position: relative;
  z-index: 1;
}

.music-now__label::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  background: #fff1c8;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .45);
}

@keyframes music-spin {
  to { transform: rotate(360deg); }
}

.music-now__notes {
  padding-right: 8px;
}

.music-now__eyebrow {
  font-family: "Rye", Georgia, serif;
  font-size: 12px;
  letter-spacing: .04em;
  color: #8d5a1a;
  margin-bottom: 4px;
}

.music-now__title {
  font-family: "Rye", "IM Fell English SC", Georgia, serif;
  font-size: 32px;
  line-height: 1.05;
  color: var(--apple);
  text-shadow: 0 1px 0 #fff2c7;
  margin-bottom: 2px;
}

.music-now__subtitle {
  font-family: "Kalam", "Special Elite", cursive;
  font-size: 17px;
  color: #6c3018;
  margin-bottom: 8px;
}

.music-now__artist {
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: 15px;
  color: #5e3a1d;
  margin-bottom: 10px;
}

.music-now__desc-wrap {
  margin: 8px 0 12px;
  padding: 9px 12px 9px 14px;
  color: #4b2c16;
  font-family: "IM Fell English", Georgia, serif;
  font-size: 15px;
  line-height: 1.42;
  background: linear-gradient(90deg, rgba(174, 67, 35, .12), rgba(255, 241, 200, .35));
  border-left: 4px solid var(--apple);
  border-radius: 0 4px 4px 0;
}

.music-now__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.music-now__tag {
  padding: 3px 9px 2px;
  color: #6c3018;
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  background: linear-gradient(#fff3ce, #edcf8e);
  border: 1px dashed rgba(151, 88, 36, .72);
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 250, 229, .65);
}

.music-now__seek {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 12px;
  padding: 6px 12px;
  background:
    repeating-linear-gradient(0deg, rgba(120, 70, 30, .07) 0 1px, transparent 1px 18px),
    linear-gradient(#fff6d7, #f3dba6);
  border: 1px dashed rgba(151, 88, 36, .55);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 250, 229, .65);
}

.music-now__seek-bar {
  flex: 1;
  min-width: 0;
  height: 14px;
  margin: 0;
  accent-color: #a13018;
  cursor: pointer;
}

.music-now__time {
  font-family: "Special Elite", monospace;
  font-size: 12px;
  color: #6c3018;
  min-width: 36px;
  text-align: center;
  letter-spacing: .02em;
}

.music-now__volume {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px 3px;
  background: linear-gradient(#fff3ce, #edcf8e);
  border: 1px dashed rgba(151, 88, 36, .65);
  border-radius: 3px;
  font-size: 13px;
}

.music-now__volume input {
  width: 84px;
  accent-color: #a13018;
  cursor: pointer;
}

.music-now__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.music-now__actions .archive-button {
  min-height: 38px;
  padding: 8px 16px 7px;
  font-size: 14px;
}

.music-now__play {
  background:
    repeating-linear-gradient(90deg, rgba(255, 236, 175, .15) 0 1px, transparent 1px 7px),
    linear-gradient(#c14e22, #7e2510);
  border-color: #3e1808;
}

.music-now__source[hidden] { display: none; }

/* --- Filter board (record-shop chalkboard) --- */

.music-filterboard {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 1fr auto auto;
  gap: 12px;
  align-items: end;
  padding: 14px 16px 13px;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .07) 0 2px, transparent 2px 11px),
    linear-gradient(#7c5236, #4e3018);
  border: 3px solid #2d1a0a;
  border-radius: 6px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 228, 180, .15),
    inset 0 -10px 18px rgba(0, 0, 0, .26),
    0 3px 0 rgba(0, 0, 0, .25);
  color: #fff4d4;
}

.music-filterboard .filter-field span {
  color: #fff4d4;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .45);
  font-family: "Rye", Georgia, serif;
  font-size: 11px;
  letter-spacing: .04em;
  display: block;
  margin-bottom: 4px;
}

.music-filterboard .filter-field input,
.music-filterboard .filter-field select {
  width: 100%;
  background: #fff4d4;
  color: #2b190b;
  border: 2px solid #2d1a0a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
  padding: 7px 9px;
  font-family: "Caudex", Georgia, serif;
  font-size: 14px;
  border-radius: 3px;
}

.music-filterboard .archive-button {
  min-height: 38px;
  align-self: end;
}

/* --- Shelf header --- */

.music-shelf__head {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.music-shelf__count {
  margin-left: auto;
  font-family: "Special Elite", monospace;
  font-size: 13px;
  color: #5d381b;
  background: rgba(255, 244, 212, .55);
  padding: 3px 9px;
  border: 1px dashed rgba(165, 99, 37, .55);
  border-radius: 3px;
}

.music-radio-count {
  font-family: "Kalam", "Special Elite", cursive;
  font-size: 13px;
  color: #6f2c16;
  background: linear-gradient(#fff4d4, #edcf8e);
  padding: 3px 9px 2px;
  border: 1px dashed rgba(151, 88, 36, .65);
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 250, 229, .65);
}

.music-shelf__head .pagination--top {
  margin: 0;
}

/* --- Record shelf grid --- */

.music-shelf .panel__body {
  padding: 18px 20px 26px;
  background:
    radial-gradient(circle at 20% 18%, rgba(133, 84, 33, .08) 0 1px, transparent 2px),
    radial-gradient(circle at 80% 78%, rgba(133, 84, 33, .08) 0 1px, transparent 2px),
    linear-gradient(180deg, rgba(255, 247, 217, .5), rgba(243, 219, 166, .3));
}

.music-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(244px, 1fr));
  gap: 28px 22px;
  padding: 6px 4px 2px;
}

/* Wood shelf board beneath the rows */
.music-grid::before {
  content: "";
  display: none;
}

.music-empty {
  grid-column: 1 / -1;
  text-align: center;
  font-family: "Kalam", "Special Elite", cursive;
  font-size: 17px;
  color: #6f2c16;
  padding: 32px 12px;
}

/* --- The Record card (sleeve + vinyl peeking out) --- */

.record {
  --label-inner: #d96d35;
  --label-outer: #a13018;
  --label-edge: #6b2a13;
  --label-ink: #fff4d4;
  position: relative;
  contain: layout;
  padding-top: 36px;       /* room for disc peeking above sleeve */
  padding-right: 18px;     /* room for disc peeking right */
  transition: transform .35s cubic-bezier(.2, .75, .2, 1.05);
  touch-action: pan-y;
}

.record:hover {
  transform: translateY(-3px);
  z-index: 3;
}

.record--dragging {
  z-index: 8;
  cursor: grabbing;
  transition: none;
}

.record--dragging .record__sleeve {
  box-shadow:
    inset 0 0 0 2px rgba(255, 247, 218, .65),
    inset 0 0 0 4px rgba(217, 109, 53, .18),
    0 12px 24px rgba(61, 30, 9, .34);
}

.record--swipe-add .record__sleeve::before {
  content: "+";
  color: rgba(78, 115, 50, .35);
}

.record--swipe-remove .record__sleeve::before {
  content: "−";
  color: rgba(161, 48, 24, .32);
}

.record--crated {
  animation: record-crate-in .62s cubic-bezier(.18, .75, .18, 1.06);
}

.record--uncrated {
  animation: record-crate-out .62s cubic-bezier(.18, .75, .18, 1.06);
}

@keyframes record-crate-in {
  0% { transform: translateX(0) rotate(0); }
  42% { transform: translateX(28px) rotate(5deg); }
  70% { transform: translateX(-7px) rotate(-2deg); }
  100% { transform: translateX(0) rotate(0); }
}

@keyframes record-crate-out {
  0% { transform: translateX(0) rotate(0); }
  42% { transform: translateX(-28px) rotate(-5deg); }
  70% { transform: translateX(7px) rotate(2deg); }
  100% { transform: translateX(0) rotate(0); }
}

.record:hover .record__disc {
  transform: translate(28px, -22px) rotate(-7deg);
}

.record__disc {
  position: absolute;
  top: 0;
  right: 0;
  width: 122px;
  height: 122px;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at center, #181008 0 1px, #0c0804 1px 3px),
    radial-gradient(circle at 32% 32%, rgba(255, 255, 255, .18) 0 8%, transparent 18%);
  box-shadow:
    inset 0 0 0 2px #2a1a0a,
    inset 0 0 6px rgba(255, 255, 255, .06),
    -4px 4px 8px rgba(0, 0, 0, .35);
  display: grid;
  place-items: center;
  transform: translate(14px, -14px) rotate(-4deg);
  transition: transform .35s cubic-bezier(.2, .75, .2, 1.05);
  z-index: 2;
  pointer-events: none;
}

.record__disc::before {
  content: "";
  position: absolute;
  inset: 2%;
  border-radius: 50%;
  background: radial-gradient(circle at 28% 22%, rgba(255, 255, 255, .28) 0 12%, transparent 16%);
  pointer-events: none;
}

.record__label-disc {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--label-inner) 0 55%, var(--label-outer) 100%);
  color: var(--label-ink);
  border: 2px solid var(--label-edge);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
  display: grid;
  place-items: center;
  position: relative;
  font-family: "Rye", Georgia, serif;
  font-size: 12px;
  letter-spacing: .03em;
}

.record__label-disc::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  background: #fff1c8;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .45);
}

.record__letters {
  text-shadow: 0 1px 0 rgba(0, 0, 0, .4);
}

.record--current .record__disc,
.record--spinning .record__disc {
  animation: music-spin 4.5s linear infinite;
  animation-play-state: paused;
}

.record--spinning .record__disc {
  animation-play-state: running;
  will-change: transform;
}

.record__sleeve {
  position: relative;
  padding: 16px 16px 14px;
  color: #3a2413;
  background:
    radial-gradient(circle at 18% 18%, rgba(127, 80, 31, .07) 0 1px, transparent 2px),
    radial-gradient(circle at 82% 82%, rgba(127, 80, 31, .07) 0 1px, transparent 2px),
    repeating-linear-gradient(0deg, rgba(120, 70, 30, .06) 0 1px, transparent 1px 24px),
    linear-gradient(180deg, #fff5d9 0%, #f1dba1 100%);
  border: 2px solid #b07a3d;
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 247, 218, .55),
    inset 0 0 0 4px rgba(182, 112, 43, .12),
    0 4px 10px rgba(61, 30, 9, .22);
  z-index: 1;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Inner dashed border like the .panel system */
.record__sleeve::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px dashed rgba(165, 99, 37, .45);
  border-radius: 3px;
  pointer-events: none;
}

.record--current .record__sleeve {
  border-color: #7a3617;
  box-shadow:
    inset 0 0 0 2px rgba(255, 247, 218, .65),
    inset 0 0 0 4px rgba(217, 109, 53, .22),
    0 0 0 1px rgba(217, 109, 53, .35),
    0 8px 18px rgba(120, 50, 20, .32);
}

.record--in-radio .record__sleeve {
  border-color: #607235;
}

.record--in-radio .record__sleeve::before {
  content: "♫";
  color: rgba(78, 115, 50, .24);
}

.record--source-only {
  opacity: .88;
}

.record__sleeve-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-right: 56px; /* leave room for peeking disc */
  font-family: "Rye", Georgia, serif;
  font-size: 11px;
  letter-spacing: .04em;
  color: #8d5a1a;
}

.record__num {
  color: var(--apple);
  font-size: 12px;
}

.record__year,
.record__press {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 3px;
  border: 1px dashed rgba(151, 88, 36, .65);
  background: rgba(255, 246, 215, .65);
  font-family: "Special Elite", monospace;
  font-size: 11px;
  letter-spacing: 0;
  color: #5d381b;
}

.record__year--unknown {
  color: #8a6638;
  font-style: italic;
}

.record__press--local {
  border-color: rgba(78, 115, 50, .65);
  background: rgba(213, 230, 188, .8);
  color: #3f5b1f;
}

.record__press--stream {
  border-color: rgba(58, 100, 128, .55);
  background: rgba(206, 226, 236, .82);
  color: #2c4860;
}

.record__title {
  margin-top: 4px;
  font-family: "Rye", "IM Fell English SC", Georgia, serif;
  font-size: 19px;
  line-height: 1.08;
  color: var(--apple);
  text-shadow: 0 1px 0 #fff2c7;
}

.record__subtitle {
  font-family: "Kalam", "Special Elite", cursive;
  font-size: 13.5px;
  color: #6c3018;
  margin-top: 1px;
}

.record__artist {
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: 14px;
  color: #5e3a1d;
  margin-top: 2px;
}

.record__notes {
  flex: 1;
  margin-top: 6px;
  font-family: "IM Fell English", Georgia, serif;
  font-size: 13.5px;
  line-height: 1.4;
  color: #4b2c16;
}

.record__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.record__tag {
  padding: 2px 7px 1px;
  color: #6c3018;
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: 12px;
  line-height: 1;
  background: linear-gradient(#fff3ce, #edcf8e);
  border: 1px dashed rgba(151, 88, 36, .65);
  border-radius: 3px;
}

.record__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.record__play {
  min-height: 30px;
  padding: 5px 12px 4px;
  font-size: 12.5px;
}

.record__crate {
  min-height: 30px;
  padding: 5px 10px 4px;
  color: #2b190b;
  font-size: 12px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .18) 0 1px, transparent 1px 7px),
    linear-gradient(#e8d18a, #b98a43);
  border-color: #75501d;
}

.record--in-radio .record__crate {
  color: #fff4d4;
  background:
    repeating-linear-gradient(90deg, rgba(255, 236, 175, .13) 0 1px, transparent 1px 7px),
    linear-gradient(#7d9a4f, #405f28);
  border-color: #28401a;
}

.record__crate--disabled {
  color: #8a6638;
}

.record__source {
  font-family: "Special Elite", monospace;
  font-size: 12px;
  color: #6f2c16;
  text-decoration: underline dotted rgba(133, 84, 33, .55);
  text-underline-offset: 3px;
}

.record__source:hover {
  color: #a13018;
  background: transparent;
}

.record--current .record__play {
  background:
    repeating-linear-gradient(90deg, rgba(255, 236, 175, .16) 0 1px, transparent 1px 7px),
    linear-gradient(#c14e22, #7e2510);
  border-color: #3e1808;
}

/* Liner-note flourish in the corner of every sleeve */
.record__sleeve::before {
  content: "♪";
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: rgba(96, 114, 53, .18);
  font-family: "Rye", Georgia, serif;
  font-size: 38px;
  line-height: 1;
  pointer-events: none;
  z-index: 0;
}

.music-crate-toast {
  position: fixed;
  right: 42px;
  bottom: 38px;
  z-index: 30;
  max-width: 280px;
  padding: 9px 13px 8px;
  color: #4b2c16;
  font-family: "Kalam", "Special Elite", cursive;
  font-size: 15px;
  line-height: 1.25;
  background:
    repeating-linear-gradient(0deg, rgba(120, 70, 30, .07) 0 1px, transparent 1px 18px),
    linear-gradient(#fff6d7, #f3dba6);
  border: 2px solid #9e6329;
  border-radius: 5px;
  box-shadow: 0 7px 18px rgba(61, 30, 9, .34);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px) rotate(2deg) scale(.96);
  transition: opacity .2s ease, transform .32s cubic-bezier(.18, .75, .18, 1.08);
}

.music-crate-toast.is-showing {
  opacity: 1;
  transform: translateY(0) rotate(-1deg) scale(1);
}

.music-crate-toast--add {
  border-color: #607235;
}

.music-crate-toast--remove,
.music-crate-toast--warn {
  border-color: #a13018;
}
