/* SABIR V23.1 — correct mobile overflow of Darija bundle artwork only.
 * Loaded after catalogue styles; does not change paragraph alignment.
 */

/* Root cause: .book-card-media img from the old catalogue is more specific
 * than .v228-collection-cover, imposing auto width and 100% height.
 * All three absolute images then become too wide for narrow catalogue cards,
 * and the montage's old overflow:visible lets them escape the card. */
.v228-collection-card,
.v228-collection-card .book-card-media,
.v228-collection-card .book-card-content,
.v228-collection-gallery,
.v226-preorder-cover {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.v228-collection-card .book-card-media {
  overflow: hidden;
  isolation: isolate;
  width: 100%;
  padding: clamp(10px, 2vw, 25px);
}
.v228-collection-card .book-card-media .v228-collection-montage {
  box-sizing: border-box;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  width: min(100%, 340px);
}
.v228-collection-card .book-card-media .v228-collection-cover,
.v228-collection-gallery .v228-collection-cover,
.v226-preorder-cover .v228-collection-cover {
  width: 43%;
  height: 73%;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center bottom;
  box-sizing: border-box;
}
.v228-collection-gallery .v228-collection-montage,
.v226-preorder-cover .v228-collection-montage {
  max-width: 100%;
  min-width: 0;
}
.v228-collection-card .book-card-content,
.v228-collection-card .book-card-content h3,
.v228-collection-card .book-card-content .book-meta {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* On small displays the ordinary catalogue reverts to a two-column
 * 44% cover / 56% text split. The three-cover product needs a whole
 * row for its artwork, not that narrow 44% area. */
@media (max-width: 700px) {
  .v228-collection-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
  }
  .v228-collection-card .book-card-media {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    height: auto;
    padding: 12px;
    overflow: hidden;
  }
  .v228-collection-card .book-card-media .v228-collection-montage {
    position: relative;
    display: block;
    width: min(100%, 300px);
    max-width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 1.16 / 1;
    margin-inline: auto;
  }
  .v228-collection-card .book-card-content {
    width: 100%;
    max-width: 100%;
    min-height: 0;
  }
}
@media (max-width: 380px) {
  .v228-collection-card .book-card-media {
    padding: 8px;
  }
  .v228-collection-card .book-card-media .v228-collection-montage {
    width: min(100%, 250px);
  }
}

