/* =========================================================
   music.css  (load AFTER style.css)
   Avatar vinyl dropdown + music reviews/recommendations view
   ========================================================= */

:root {
  --photo: 120px;                          /* profile picture size */
  --vinyl-disc: calc(var(--photo) * 0.5);  /* visible vinyl = 50% of the photo */
  --disc-fill: 0.70;                       /* share of vinyl.gif's canvas the disc fills; tweak if it looks off */
  --music: #C62828;
  --gold: #D4AF37;
}

:root[data-theme="dark"] { --music: #FF8A80; }

@media (max-width: 760px) {
  :root { --photo: 56px; }
}


/* ---------- Avatar + dropdown ---------- */

.avatar { position: relative; flex: none; }

.avatar-btn {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.avatar-btn .brand-photo {
  width: var(--photo);
  height: var(--photo);
}

a.brand-text { color: inherit; text-decoration: none; }

.vinyl-drop {
  position: absolute;
  top: 100%;
  left: 50%;
  padding-top: 8px;               /* keeps hover alive between photo and vinyl */
  z-index: 110;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -14px) scale(0.85);
  transform-origin: top center;
  transition: opacity 0.2s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}

/* Opened by music.js (hover, tap or keyboard) and retracted on click-away */
.avatar.open .vinyl-drop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
  transition-delay: 0s;
}

.vinyl-btn {
  position: relative;
  display: block;
  width: var(--vinyl-disc);
  height: var(--vinyl-disc);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: none;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.vinyl-btn img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(var(--vinyl-disc) / var(--disc-fill));
  height: calc(var(--vinyl-disc) / var(--disc-fill));
  max-width: none;
  transform: translate(-50%, -50%);
}

.vinyl-btn:hover { box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35), 0 0 0 3px var(--music); }


/* ---------- View switching ---------- */

html[data-view="music"] #top,
html:not([data-view="music"]) #music-view { display: none; }

html[data-view="music"] .toc-list--site,
html:not([data-view="music"]) .toc-list--music { display: none; }


/* ---------- Music view ---------- */

.card--music-intro {
  --c: var(--music);
  border: 1px solid var(--line);
  border-right: 4px solid var(--c);
  border-radius: 6px 28px 28px 6px;
}

.card--music-intro p:first-of-type { margin-top: 0; }

.card--review {
  --c: var(--music);
  border: 3px solid var(--c);
  border-radius: 36px 6px 36px 6px;
}

.review-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
}

.review-head p { margin: 0; }

.rating {
  color: var(--c);
  font: 700 1.5rem/1 var(--font-display);
  white-space: nowrap;
}

.rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.5rem;
  margin: 2.5rem 0 3.5rem;
}

.rec-grid .card { margin: 0; padding: 1.25rem; }

.card--rec {
  --c: var(--music);
  border: 1px solid var(--line);
  border-top: 3px solid var(--c);
}

.card--rec h3 { font-size: 1.2rem; }

.back-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 500 0.95rem var(--font-body);
  cursor: pointer;
}

.back-btn:hover { border-color: var(--music); color: var(--music); }

@media (max-width: 650px) {
  .review-head { flex-direction: column; gap: 0.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .vinyl-drop { transition: none; }
}


/* =========================================================
   Music view theme: red, black and gold trim
   (overrides both light and dark themes while in the music view)
   ========================================================= */

:root[data-view="music"][data-theme] {
  --bg: #0B0B0B;
  --bar-bg: #120707;
  --ink: #F4EBD3;
  --muted: #BBAA84;
  --line: #5E4B17;
  --accent: var(--gold);
  --music: #E02424;
  --banner-tint: rgba(8, 8, 8, 0.68);
}

/* Banner: the album-cover collage, tiled across the header */
:root[data-view="music"] .site-bar {
  background-image:
    linear-gradient(var(--banner-tint), var(--banner-tint)),
    url("assets/music-banner.jpg");
  background-size: cover, auto 100%;
  background-repeat: no-repeat, repeat-x;
  background-position: center;
  border-bottom: 3px solid var(--gold);
}

:root[data-view="music"] .brand-photo { border-color: var(--gold); }
:root[data-view="music"] .bar-nav > a:hover { border-bottom-color: var(--gold); }
:root[data-view="music"] .theme-toggle { display: none; } /* the music view has its own fixed palette */

/* Headings: gold with a red underline */
#music-view h2 {
  display: inline-block;
  padding-bottom: 0.25rem;
  border-bottom: 3px solid var(--music);
  color: var(--gold);
}

/* Gold trim on every card in the music view */
#music-view .card { border-color: var(--gold); }

#music-view .card--review {
  box-shadow: inset 0 0 0 3px var(--bg), inset 0 0 0 4px var(--gold);
}

#music-view .card--rec { border-top: 3px solid var(--music); }

#music-view .card h3 { color: var(--gold); }
#music-view .rating { color: var(--music); }

.back-btn { border-color: var(--gold); }
.back-btn:hover { border-color: var(--music); color: var(--music); }

/* Footer in the music view */
:root[data-view="music"] .footer-links a:hover { color: var(--gold); }


/* Header text in the music view: bright white / light gold with a dark halo,
   so it stays readable over the busy album-cover banner */
:root[data-view="music"] .site-bar { color: #FFFFFF; }

:root[data-view="music"] .brand-name,
:root[data-view="music"] .brand-sub,
:root[data-view="music"] .bar-nav > a,
:root[data-view="music"] .toc summary {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 10px rgba(0, 0, 0, 0.85);
}

:root[data-view="music"] .brand-name { color: #FFFFFF; }
:root[data-view="music"] .brand-sub  { color: #F5DC8A; }

:root[data-view="music"] .bar-nav > a:hover,
:root[data-view="music"] .toc summary:hover { color: var(--gold); }


/* =========================================================
   Music page: back button + Spotify player
   ========================================================= */

.music-top { margin: 0 0 1.5rem; }

.card--spotify {
  --c: var(--music);
  margin: 1.25rem 0 3rem;
  padding: 1rem;
  border: 3px solid var(--gold);
  border-radius: 24px;
  box-shadow: inset 0 0 0 3px var(--bg), inset 0 0 0 4px var(--gold);
}

.card--spotify iframe {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 12px;
}

.spotify-note { margin: 0; color: var(--muted); }

.spotify-note code { color: var(--gold); }


/* =========================================================
   Featured recommendation + rating badge
   ========================================================= */

.rec-grid .card--featured { grid-column: 1 / -1; padding: 1.75rem; }
.card--featured p:not(.item-sub) { max-width: 46rem; }
.card--featured h3 { font-size: 1.6rem; }
.card--featured h3 a { text-decoration: none; }
.card--featured h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }

.rec-cover-link {
  display: block;
  width: min(100%, 16rem);
  margin-bottom: 1rem;
}

.rec-cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border: 2px solid var(--gold);
  border-radius: 12px;
  transition: filter 0.15s;
}

.rec-cover-link:hover .rec-cover { filter: brightness(1.12); }

/* Rating badge: big bold number over a progress bar */
.score {
  display: inline-block;
  min-width: 11rem;
  margin: 1rem 0 0.25rem;
  padding: 0.85rem 1.25rem 1rem;
  text-align: center;          /* add this line */
  background: #1C1C1C;
  border: 2px solid var(--gold);
  border-radius: 14px;
}
/* The number and "/100" share one size and color */
.score-num {
  display: block;
  color: #FFFFFF;
  font: 700 2rem/1 var(--font-display);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.score-max { font: inherit; color: inherit; }

.score-bar {
  display: block;
  height: 8px;
  margin-top: 0.7rem;
  background: #5A5A5A;
  border-radius: 999px;
  overflow: hidden;
}

.score-fill {
  display: block;
  width: calc(var(--score) * 1%);
  height: 100%;
  background: #5FBF5A;            /* green = a good rating */
  border-radius: inherit;
}
