:root { --sc-regular-thumb: 180px; }

/* Founder 2026-11-23: one existing native card size for regular thumbnails.
   Feature art, page headers, banners, and players are intentionally excluded. */
#items .a_row {
  align-items: start;
}

.a_row > .item:is(
  .bof_m_track,
  .bof_m_album,
  .bof_m_artist,
  .bof_p_show,
  .bof_p_episode,
  .bof_a_book,
  .bof_a_writer,
  .bof_r_station,
  .bof_u_playlist
) {
  box-sizing: border-box !important;
  width: var(--sc-regular-thumb) !important;
  min-width: var(--sc-regular-thumb) !important;
  max-width: var(--sc-regular-thumb) !important;
  margin-right: 14px !important;
}

.a_row > .item:is(
  .bof_m_track,
  .bof_m_album,
  .bof_m_artist,
  .bof_p_show,
  .bof_p_episode,
  .bof_a_book,
  .bof_a_writer,
  .bof_r_station,
  .bof_u_playlist
) > .cover_wrapper,
.a_row > .item:is(
  .bof_m_track,
  .bof_m_album,
  .bof_m_artist,
  .bof_p_show,
  .bof_p_episode,
  .bof_a_book,
  .bof_a_writer,
  .bof_r_station,
  .bof_u_playlist
) .cover_wrapper {
  box-sizing: border-box !important;
  width: var(--sc-regular-thumb) !important;
  height: var(--sc-regular-thumb) !important;
  aspect-ratio: 1 / 1 !important;
  overflow: hidden !important;
}

.a_row > .item:is(.bof_m_artist,.bof_a_writer) .cover_wrapper {
  border-radius: 50% !important;
}
html body.sc-photo-artist-list #items .a_row > .item.bof_m_artist .cover_wrapper {
  border-radius: 50% !important;
}

.a_row > .item:is(
  .bof_m_track,
  .bof_m_album,
  .bof_m_artist,
  .bof_p_show,
  .bof_p_episode,
  .bof_a_book,
  .bof_a_writer,
  .bof_r_station,
  .bof_u_playlist
) .cover_wrapper :is(picture,img) {
  box-sizing: border-box !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
}

.sc-ext-grid {
  grid-template-columns: repeat(auto-fill,var(--sc-regular-thumb)) !important;
  justify-content: start;
  gap: 14px !important;
}
.sc-ext-card {
  width: var(--sc-regular-thumb) !important;
  min-width: var(--sc-regular-thumb) !important;
  max-width: var(--sc-regular-thumb) !important;
}
.sc-ext-thumb {
  width: var(--sc-regular-thumb) !important;
  height: var(--sc-regular-thumb) !important;
  aspect-ratio: 1 / 1 !important;
  overflow: hidden !important;
}
.sc-ext-thumb img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
}

/* Desktop podcast/audiobook category pages are complete grids, not one oversized
   no-wrap row. Keeping the row inside its content box prevents the last covers
   from being clipped when the sidebar is open. */
@media (min-width: 761px) {
  body.page_p_category_single .main_content .widget .slider_wrapper {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    overflow: visible !important;
  }
  body.page_p_category_single .main_content .widget .slider_wrapper > .a_row {
    display: grid !important;
    grid-template-columns: repeat(auto-fill,var(--sc-regular-thumb)) !important;
    justify-content: start !important;
    gap: 24px 14px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }
  body.page_p_category_single .main_content .widget .slider_wrapper > .a_row > .item {
    margin-right: 0 !important;
  }
}

/* Home shelves are regular cards. Their artwork uses the same native 180px
   size; banners, genre tiles and other feature imagery remain untouched. */
.sc-v5-rail {
  grid-auto-columns: calc(var(--sc-regular-thumb) + 22px) !important;
}
.sc-v5-card {
  box-sizing: border-box !important;
  width: calc(var(--sc-regular-thumb) + 22px) !important;
  min-width: calc(var(--sc-regular-thumb) + 22px) !important;
  max-width: calc(var(--sc-regular-thumb) + 22px) !important;
}
.sc-v5-card .sc-v5-art {
  width: var(--sc-regular-thumb) !important;
  height: var(--sc-regular-thumb) !important;
  aspect-ratio: 1 / 1 !important;
}
.sc-v5-card .sc-v5-art img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
}

/* sc_photo_refresh injects its own late stylesheet. The html qualifier keeps
   this one-size rule authoritative without changing its playback controls. */
html body.sc-photo-radio-list #items .a_row,
html body.sc-photo-artist-list #items .a_row {
  grid-template-columns: repeat(auto-fill,var(--sc-regular-thumb)) !important;
  justify-content: start !important;
  gap: 30px 22px !important;
}

@media (max-width: 760px) {
  html body.sc-photo-radio-list #items .slider_wrapper,
  html body.sc-photo-artist-list #items .slider_wrapper {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory !important;
  }
  html body.sc-photo-radio-list #items .a_row,
  html body.sc-photo-artist-list #items .a_row {
    grid-auto-flow: column !important;
    grid-auto-columns: var(--sc-regular-thumb) !important;
    grid-template-columns: none !important;
    grid-template-rows: repeat(2,max-content) !important;
    justify-content: start !important;
    gap: 18px 10px !important;
    width: max-content !important;
    min-width: 100% !important;
    max-width: none !important;
    padding: 0 12px 8px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }
  .a_row > .item:is(
    .bof_m_track,
    .bof_m_album,
    .bof_m_artist,
    .bof_p_show,
    .bof_p_episode,
    .bof_a_book,
    .bof_a_writer,
    .bof_r_station,
    .bof_u_playlist
  ) {
    margin-right: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }
  .a_row > .item:is(
    .bof_m_track,
    .bof_m_album,
    .bof_m_artist,
    .bof_p_show,
    .bof_p_episode,
    .bof_a_book,
    .bof_a_writer,
    .bof_r_station,
    .bof_u_playlist
  ) > .data {
    box-sizing: border-box !important;
    padding: 8px 3px 0 !important;
  }
}
