/* ==========================================================================
   components.css — small reusable pieces
   Buttons, section titles, ad units, heart (favourite) toggle.
   ========================================================================== */

/* ---- Section title: big uppercase heading with a rule either side -------- */
.section-title {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin: 0 0 2.4rem;
  padding: 0;
  font-size: 3.4rem;
  line-height: 1;
  text-transform: uppercase;
  color: #fff;
  text-align: center;
}

.section-title::before,
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---- Buttons: outlined by default, .btn--red for the main action --------- */
.btn {
  display: inline-block;
  padding: 1.1rem 2rem 0.9rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 1.8rem;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s,
    transform 0.2s,
    border-color 0.2s;
}

.btn:hover {
  background: #fff;
  color: var(--ink);
  transform: translateY(-2px);
}

.btn--red {
  background: var(--red);
  border-color: var(--red);
}

.btn--red:hover {
  background: var(--red-hover);
  border-color: var(--red-hover);
  color: #fff;
}

/* ---- Hover effect (shared): the cover lifts and glows red, the picture zooms,
   and a dark layer with options fades in. Used on Offcasts, Favourites,
   Playlist and the homepages.
   Markup:  .fx > .fx__cover > img + .fx-actions > a.fx-action.fx-action--play …
   .fx--flat = no lift (for carousels, which would clip it).
   -------------------------------------------------------------------------- */
:root {
  --ico-play: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%230b0b0b' d='M9 6.2v11.6l9.5-5.8z'/></svg>");
  --ico-person: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='8.5' r='3.6' fill='%230b0b0b'/><path fill='%230b0b0b' d='M4.8 19.5c.6-3.6 3.6-5.4 7.2-5.4s6.6 1.8 7.2 5.4z'/></svg>");
  --ico-bell: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%230b0b0b' d='M12 3.8a1.4 1.4 0 0 1 1.4 1.4v.5c2.4.6 4 2.7 4 5.2v3.1l1.6 2.2v1H5v-1l1.6-2.2v-3.1c0-2.5 1.6-4.6 4-5.2v-.5A1.4 1.4 0 0 1 12 3.8zM10 19h4a2 2 0 0 1-4 0z'/></svg>");
  --ico-download: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%230b0b0b' d='M7.4 18.5a4.2 4.2 0 0 1-.6-8.3 5.6 5.6 0 0 1 10.5 1.3 3.5 3.5 0 0 1-.4 7z'/><path fill='white' d='M11 10.4h2v3.4l1.4-1.4 1.4 1.4L12 17.6 8.2 13.8l1.4-1.4 1.4 1.4z'/></svg>");
}

.fx__cover {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.fx__cover img {
  transition: transform 0.5s ease;
}

.fx:hover .fx__cover,
.fx:focus-within .fx__cover,
.fx.is-open .fx__cover {
  transform: translateY(-5px);
  box-shadow:
    0 0 0 2px var(--red),
    0 16px 36px rgba(255, 0, 32, 0.32);
}

.fx--flat:hover .fx__cover,
.fx--flat:focus-within .fx__cover,
.fx--flat.is-open .fx__cover,
.fx--flat.fx__cover:hover,
.fx--flat.fx__cover:focus-within,
.fx--flat.fx__cover.is-open {
  transform: none;
  box-shadow: none;
  outline: 2px solid var(--red);
  outline-offset: -2px;
}

.fx--flat .fx__cover::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 7;
  box-shadow: inset 0 0 0 2px var(--red);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.fx--flat:hover .fx__cover::before,
.fx--flat:focus-within .fx__cover::before,
.fx--flat.is-open .fx__cover::before {
  opacity: 1;
}

.fx:hover .fx__cover img,
.fx:focus-within .fx__cover img,
.fx.is-open .fx__cover img {
  transform: scale(1.05);
}

.fx-actions {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  gap: 1.6rem 2.4rem;
  padding: 1.6rem;
  background: rgba(8, 8, 8, 0.82);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s,
    visibility 0.25s;
}

.fx:hover .fx-actions,
.fx:focus-within .fx-actions,
.fx.is-open .fx-actions {
  opacity: 1;
  visibility: visible;
}

.fx__cover .heart {
  z-index: 6;
}

.fx-action {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fff;
}

.fx-action::before {
  flex: none;
  border-radius: 50%;
  background: #fff center / 62% no-repeat;
  transition:
    background-color 0.2s,
    transform 0.2s;
}

.fx-action::before {
  content: "";
  width: 3.4rem;
  height: 3.4rem;
}

.fx-action:hover {
  color: var(--red);
}

.fx-action:hover::before {
  transform: scale(1.1);
}

.fx-action--play::before {
  background-image: var(--ico-play);
}
.fx-action--producer::before {
  background-image: var(--ico-person);
}
.fx-action--subscribe::before {
  background-image: var(--ico-bell);
}
.fx-action--download::before {
  background-image: var(--ico-download);
}

@media (max-width: 700px) {
  .fx-actions {
    gap: 1.2rem;
    padding: 1rem;
  }
  .fx-action {
    font-size: 1.7rem;
    gap: 1rem;
  }
  .fx-action::before {
    width: 2.8rem;
    height: 2.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fx__cover,
  .fx__cover img {
    transition: none;
  }
}

/* ---- Ad units. The wrapper must not size or clip the creative. ------------ */
.ad-slot {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: auto;
  max-height: none;
  overflow: visible;
  background: transparent;
  border: 0;
}

.ad-slot--leader,
.ad-slot--tall,
.ad-slot--tile {
  aspect-ratio: auto;
  max-height: none;
}

/* ---- Heart: favourite toggle. Filled red = in favourites ------------------ */
.heart[hidden] {
  display: none;
}

.heart {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: transform 0.15s;
}

.heart:hover {
  transform: scale(1.15);
}

.heart:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

.heart svg {
  width: 20px;
  height: 20px;
  fill: #fff;
  stroke: none;
  /* soft shadow keeps the heart readable on any cover */
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7));
  transition: fill 0.2s;
}

.heart.is-fav svg {
  fill: var(--red);
}

/* ---- Carousel: horizontally scrolling row with prev/next arrows ---------- */
/* Markup: .carousel > .carousel__track > .carousel__item (+ arrows).
   Set --per-view on the track to change how many items show at once. */
.carousel {
  position: relative;
}

.carousel__track {
  --gap: 16px;
  --per-view: 4;
  display: flex;
  gap: var(--gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.carousel__track::-webkit-scrollbar {
  display: none;
}

.carousel__item {
  flex: 0 0 calc((100% - var(--gap) * (var(--per-view) - 1)) / var(--per-view));
  scroll-snap-align: start;
}

.carousel__arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 36px;
  height: 56px;
  padding: 0;
  border: 0;
  background: var(--red);
  transform: translateY(-50%);
  transition: background 0.2s;
}

.carousel__arrow:hover {
  background: var(--red-hover);
}

.carousel__arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--white);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.carousel__arrow--prev {
  left: -18px;
}

.carousel__arrow--next {
  right: -18px;
}

@media (max-width: 900px) {
  .carousel__arrow--prev {
    left: -8px;
  }

  .carousel__arrow--next {
    right: -8px;
  }
}

@media (max-width: 900px) {
  .section-title {
    gap: 1.2rem;
    font-size: 2.8rem;
  }
}

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

/* ---- Row version of the hover effect (lists): red frame, glow and photo zoom. ---- */
.fx-row {
  transition:
    background-color 0.25s ease,
    box-shadow 0.3s ease,
    transform 0.3s ease;
}

.fx-row:hover,
.fx-row:focus-within {
  box-shadow:
    inset 0 0 0 2px var(--red),
    0 10px 28px rgba(255, 0, 32, 0.22);
}

.fx-row img {
  transition: transform 0.5s ease;
}

.fx-row:hover img,
.fx-row:focus-within img {
  transform: scale(1.08);
}

@media (prefers-reduced-motion: reduce) {
  .fx-row,
  .fx-row img {
    transition: none;
  }
}

/* ---- "Find this song" service icons (Spotify, Apple Music, Tidal, Amazon Music,
   YouTube, SoundCloud). The links are added by services.js. The logos are black SVGs;
   they are inverted to white on the dark circles. ----------------------------- */
.svc-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.svc {
  forced-color-adjust: none;
  position: relative;
  flex: none;
  display: block;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  transition:
    background-color 0.2s,
    transform 0.2s;
}

.svc::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--svc) center / 56% no-repeat;
  filter: invert(0.85);
}

.svc:hover {
  background: var(--red);
}

.svc:hover::before {
  filter: invert(1);
}

.svc--spotify {
  --svc: url("../img/services/spotify.svg");
}
.svc--applemusic {
  --svc: url("../img/services/applemusic.svg");
}
.svc--tidal {
  --svc: url("../img/services/tidal.svg");
}
.svc--amazonmusic {
  --svc: url("../img/services/amazonmusic.svg");
}
.svc--email {
  --svc: url("../img/services/email.svg");
}
.svc--youtube {
  --svc: url("../img/services/youtube.svg");
}
.svc--soundcloud {
  --svc: url("../img/services/soundcloud.svg");
}

/* on the red playlist banner and on covers: white circles, black logos */
.svc-list--light .svc,
.fx-actions .svc {
  background: #fff;
}

.svc-list--light .svc::before,
.fx-actions .svc::before {
  filter: none;
}

.svc-list--light .svc:hover {
  background: var(--red);
}

.fx-actions .svc:hover {
  background: var(--red);
}

.svc-list--light .svc:hover::before,
.fx-actions .svc:hover::before {
  filter: invert(1);
}

/* on a cover: a dark layer with the icons, the heart stays on top */
.fx-actions .svc-list {
  justify-content: center;
  max-width: 17rem;
  gap: 0.9rem;
}

.fx-actions .svc {
  width: 4.4rem;
  height: 4.4rem;
}

/* ---- Calendar (Playlist, Offcasts and producer pages; see calendar.js) -------------- */
.cal {
  margin: 0 0 3rem;
  padding: 1.6rem;
  border: 1px solid #333;
  border-radius: 6px;
}

.cal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1.2rem;
}

.cal__month {
  margin: 0;
  font-size: 2.2rem;
  line-height: 1;
  text-transform: uppercase;
  color: #fff;
}

.cal__nav {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  padding: 0;
  border: 1px solid #444;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition:
    background-color 0.2s,
    border-color 0.2s;
}

.cal__nav svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cal__nav:hover:not(:disabled) {
  border-color: var(--red);
  background: var(--red);
}

.cal__nav:disabled {
  opacity: 0.3;
  cursor: default;
}

.cal__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.4rem;
  text-align: center;
}

.cal__dow {
  padding: 0.4rem 0;
  font-size: 1.3rem;
  letter-spacing: 0.1em;
  color: #8a8a8a;
}

.cal__day {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 0.2s,
    border-color 0.2s;
}

.cal__day:hover:not(:disabled) {
  border-color: var(--red);
  background: rgba(255, 0, 32, 0.12);
}

.cal__day:disabled {
  color: #555;
  cursor: default;
}

.cal__day.is-today {
  border-color: #777;
}

.cal__day.is-selected {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.cal__blank {
  aspect-ratio: 1;
}

/* a dot under the days that have an offcast */
.cal__day.has-item {
  font-weight: normal;
}

.cal__day.has-item::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--red);
}

.cal__day.is-selected.has-item::after {
  background: #fff;
}

/* the offcast the calendar just jumped to */
.is-picked .fx__cover,
.pr-offcast.is-picked {
  box-shadow:
    0 0 0 3px var(--red),
    0 0 36px rgba(255, 0, 32, 0.5);
}
