/* Critical catalog presentation is loaded globally by BaseLayout so persistent
   page-shell navigation never depends on route-local Astro CSS arriving later. */

/* Release cards intentionally contain separate Details and Compact/player title
   actions. Exactly one may be visible at a time. */
.release-title-player-link { display: none; }
[data-catalog-view='compact'] .release-title-details-link { display: none; }
[data-catalog-view='compact'] .release-title-player-link { display: inline; }

/* Music Detail actions share one alignment contract at every viewport: provider
   labels and their chevrons sit together at the left edge, while Release Details
   remains a full-width action. The shared ReleaseDetailsLink template removes
   its underline in every layout. */
.catalog-page [data-catalog-view='detail'] .release-card-copy .streaming-links {
  width: 100% !important;
  max-width: none !important;
  justify-content: flex-start !important;
}
.catalog-page [data-catalog-view='detail'] .release-card-copy .streaming-links a,
.catalog-page [data-catalog-view='detail'] .release-card-copy .release-details-link {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: .4rem !important;
  text-align: left !important;
}
.catalog-page [data-catalog-view='detail'] .release-card-copy .release-details-link {
  width: 100% !important;
  max-width: none !important;
}

/* Above the mobile breakpoint, Music Detail and homepage Latest Releases use
   the same corresponding action typography as the homepage Current Release:
   providers follow .platform-pills a; Release Details follows .text-link. */
@media (min-width: 821px) {
  .catalog-page [data-catalog-view='detail'] .release-card-copy .streaming-links a,
  body.home-page #latest-music .latest-music-card-copy .platform-pills a {
    font-size: .7rem !important;
    font-weight: 800 !important;
    letter-spacing: .08em !important;
  }
  .catalog-page [data-catalog-view='detail'] .release-card-copy .release-details-link,
  body.home-page #latest-music .latest-music-card-copy .release-details-link {
    font-size: .78rem !important;
    font-weight: 800 !important;
    letter-spacing: .09em !important;
  }
}

/* As the homepage narrows, stop forcing Latest Releases into two half-width
   cards. Use the same media proportions and unboxed rhythm as Music Detail,
   while leaving the existing wide-desktop two-card presentation untouched. */
@media (max-width: 1100px) {
  body.home-page #latest-music .latest-music-grid {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
  body.home-page #latest-music .latest-music-card {
    grid-template-columns: minmax(12rem, 18rem) minmax(0, 1fr) !important;
    gap: clamp(1.5rem, 3.5vw, 3.5rem) !important;
    align-items: start !important;
    padding: clamp(1.4rem, 2.5vw, 2.1rem) 0 !important;
    border: 0 !important;
    border-top: 1px solid rgba(247,244,233,.13) !important;
    background: transparent !important;
  }
  body.home-page #latest-music .latest-music-card:last-child {
    border-bottom: 1px solid rgba(247,244,233,.13) !important;
  }
  body.home-page #latest-music .latest-music-art {
    width: 100% !important;
    max-width: 18rem !important;
    margin: 0 !important;
  }
  body.home-page #latest-music .latest-music-card-copy h3 {
    margin: .3rem 0 .75rem !important;
    font-size: clamp(1.8rem, 3vw, 2.65rem) !important;
    line-height: 1 !important;
  }
  body.home-page #latest-music .latest-music-card-copy > .spotify-player-shell {
    width: min(100%, 34rem) !important;
    margin: .9rem 0 .8rem !important;
  }
  body.home-page #latest-music .latest-music-card-copy .platform-pills {
    margin: .85rem 0 0 !important;
    gap: .65rem 2rem !important;
  }
  body.home-page #latest-music .latest-music-card-copy .release-details-link {
    margin-top: 1.15rem !important;
  }
}

/* Detail is the mandatory mobile catalog presentation. */
@media (max-width: 820px) {
  .catalog-page [data-catalog-view='detail'] .release-card.ow-content-columns {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  /* Once the Music catalog converts to Detail, its provider actions and
     Release Details row fill the same card width as the player. */
  .catalog-page [data-catalog-view='detail'] .release-card-copy .streaming-links,
  .catalog-page [data-catalog-view='detail'] .release-card-copy .streaming-links a,
  .catalog-page [data-catalog-view='detail'] .release-card-copy .release-details-link {
    width: 100% !important;
    max-width: none !important;
  }

  .home-page .latest-music-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  body.home-page #latest-music .latest-music-card {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  /* Match the Music Detail template's mobile artwork alignment. */
  body.home-page #latest-music .latest-music-art {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Match the Music Detail template's shared mobile action typography. */
  body.home-page #latest-music .latest-music-card-copy .platform-pills a,
  body.home-page #latest-music .latest-music-card-copy .release-details-link {
    font-size: var(--ow-mobile-action-text-size) !important;
    line-height: var(--ow-mobile-action-line-height) !important;
    letter-spacing: var(--ow-mobile-action-letter-spacing) !important;
  }
}

/* Filter/date controls must not depend on Music-page document-head swaps. */
.catalog-date-range {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: .5rem;
}
.catalog-date-field {
  display: grid;
  gap: .25rem;
  color: rgba(247,244,233,.58);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.catalog-date-control {
  position: relative;
  display: grid;
  grid-template-columns: minmax(8.4rem, 9.5rem) 2.65rem;
  min-height: 2.65rem;
}
.catalog-date-text,
.catalog-date-picker-native {
  box-sizing: border-box;
  min-height: 2.65rem;
  border: 1px solid rgba(247,244,233,.2);
  border-radius: 0;
  background: #11140f;
  color: var(--light);
  color-scheme: dark;
  font: inherit;
}
.catalog-date-text {
  width: 100%;
  min-width: 0;
  padding: .45rem .65rem;
  border-right: 0;
  font-size: .76rem;
  letter-spacing: .01em;
  text-transform: none;
}
.catalog-date-text::placeholder { color: rgba(247,244,233,.4); opacity: 1; }
.catalog-date-text[aria-invalid='true'] { border-color: rgba(217,95,71,.82); }
.catalog-date-picker-native {
  width: 2.65rem;
  padding: 0;
  cursor: pointer;
  font-size: 0;
  color: transparent;
}
.catalog-date-calendar-icon {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: .78rem;
  width: 1.05rem;
  height: 1.05rem;
  color: rgba(247,244,233,.72);
  pointer-events: none;
  transform: translateY(-50%);
}
.catalog-date-picker-native::-webkit-datetime-edit,
.catalog-date-picker-native::-webkit-date-and-time-value { display: none; }
.catalog-date-picker-native::-webkit-calendar-picker-indicator {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: .7rem;
  cursor: pointer;
  opacity: 0;
}
.catalog-date-text:hover,
.catalog-date-text:focus-visible,
.catalog-date-picker-native:hover,
.catalog-date-picker-native:focus-visible {
  border-color: rgba(217,165,71,.72);
}
.catalog-date-control:focus-within .catalog-date-calendar-icon,
.catalog-date-control:hover .catalog-date-calendar-icon { color: var(--ember); }
.catalog-date-text:focus-visible,
.catalog-date-picker-native:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid rgba(217,165,71,.42);
  outline-offset: 2px;
}
.catalog-date-clear {
  min-height: 2.65rem;
  padding: .45rem .7rem;
  border: 1px solid rgba(247,244,233,.16);
  background: rgba(247,244,233,.02);
  color: rgba(247,244,233,.72);
  cursor: pointer;
  font: inherit;
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.catalog-date-clear:hover:not(:disabled),
.catalog-date-clear:focus-visible:not(:disabled) {
  border-color: rgba(217,165,71,.55);
  color: var(--light);
}
.catalog-date-clear:disabled { cursor: default; opacity: .34; }

@media (max-width: 820px) {
  .catalog-date-range { width: 100%; }

  /* If no current release is configured, the remaining Music quick-nav action
     spans the full mobile tray and retains the normal secondary-action styling. */
  .mobile-music-nav--single {
    grid-template-columns: 1fr !important;
  }
  .mobile-music-nav--single > a:first-child {
    background: rgba(217,165,71,.1) !important;
    color: var(--light) !important;
  }
  .mobile-music-nav--single > a:first-child:hover,
  .mobile-music-nav--single > a:first-child:focus-visible {
    background: var(--light) !important;
    color: var(--ink) !important;
  }

  /* Mobile Music Detail view: keep Release Details aligned with the provider
     links without the divider used by permanent release-page route links. */
  .catalog-page .release-card-copy .release-details-link {
    padding-top: .22rem !important;
    border-top: 0 !important;
  }

  /* Mobile homepage: move only the kicker and H1 down to the requested 2rem
     offset. The lede/paragraph and every other hero element are unchanged. */
  .home-page .hero-copy > .kicker,
  .home-page .hero-copy > h1 {
    transform: translateY(-2rem) !important;
  }

  /* The homepage reserves space below the footer for the fixed mobile quick-nav.
     Paint that reserve with the site background so the fixed hero layer cannot
     show through as a strip above the buttons. This does not alter layout. */
  .home-page .site-footer {
    position: relative;
  }
  .home-page .site-footer::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: calc(4.8rem + env(safe-area-inset-bottom, 0px));
    background: var(--ink);
    pointer-events: none;
  }
}

@media (max-width: 520px) {
  .catalog-date-field { flex: 1 1 11.5rem; }
  .catalog-date-control { grid-template-columns: minmax(0, 1fr) 2.65rem; }
}
