#MainContent,
body {
  background-color: #F2F4F7;
}

h1.page-title {
  font-family: baskerville-italic !important;
  margin-bottom: 1.25rem !important;
  letter-spacing: 0 !important;
  font-size: 42px !important;
}

.category-page p {
  font-size: 16px;
}

.category-page .rte {
  width: 60%;
}

@media (max-width: 768px) {
  .category-page .rte {
    width: 100%;
  }
}

.category-blocks {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1.5rem 0;
}

.category-blocks > a {
  display: block;
  border: 1px solid #D0D5DD;
}

.category-blocks > a:hover {
  box-shadow: 0px 0px 2px 1px rgb(0 0 0 / 10%);
  opacity: 0.8;
}

/* Height tracks the tile's width rather than being fixed per breakpoint, so the cells
   stay square at every column count. A hand-picked category image takes the same box so
   that a row mixing the two still lines up. */
.category-blocks-img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 1;
  object-fit: cover;
}

/* Product mosaic — the tile image built from the products a tile leads to; rendered by
   snippets/category-tile-mosaic.html. Three products in one row, and every frame is the
   same square, so the only thing that varies between them is the product — an earlier
   version led with a large hero above a smaller strip, and the mismatched frames were
   what made the tile look untidy. The 3:1 box divided three ways leaves each cell
   square, and matches .category-blocks-img so a row mixing the two still lines up. */
.category-mosaic {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr;
  /* Shows through between cells as hairlines, matching the tile border. */
  gap: 1px;
  background-color: #D0D5DD;
  aspect-ratio: 3 / 1;
}

.category-mosaic__cell {
  position: relative;
  overflow: hidden;
  background-color: #fff;
}

/* Product shots are cut-outs on white and come both portrait and landscape, so they are
   contained rather than cropped — which leaves bars down the sides or along the top.
   Same fix the product cards use (component-card.css .blur-image): a stretched, blurred
   copy of the same image sits underneath and fills them. Both layers are absolutely
   positioned so they stack. */
.category-mosaic__img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  box-sizing: border-box;
  z-index: 1;
}

.category-mosaic__img--blur {
  object-fit: fill;
  opacity: 0.25;
  filter: blur(4px);
  -webkit-filter: blur(4px);
  z-index: 0;
}

/* Last cell carries the count on plain white — no product behind it. Earlier versions
   put a third product back there behind a wash, but a wash pale enough to show the
   product could not carry the figures over a dark one (navy on a 10% wash over black is
   1.2:1), and a wash strong enough to fix that hid the product anyway. Empty white
   settles it, and gives the row somewhere to breathe. */
.category-mosaic__count {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15em;
  color: #0A2749;
  text-align: center;
  line-height: 1.1;
  padding: 0.5rem;
  box-sizing: border-box;
  /* Above both image layers. */
  z-index: 2;
}

/* Collections holding only one product show it full width with the count along the
   bottom, instead of a row with a hole in it. */
.category-mosaic--single {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.category-mosaic--single .category-mosaic__count {
  inset: auto 0 0 0;
  flex-direction: row;
  align-items: baseline;
  justify-content: center;
  gap: 0.4em;
  /* Solid white for the same reason the count frame is: this bar sits over a sharp
     product image, so anything translucent is at the mercy of what is behind it. */
  background: #fff;
  border-top: 1px solid #D0D5DD;
  padding: 0.6rem;
}

.category-mosaic__count strong {
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  font-weight: bold;
  letter-spacing: -0.02em;
}

.category-mosaic--single .category-mosaic__count strong {
  font-size: 0.95rem;
}

.category-mosaic__count small {
  font-size: clamp(0.58rem, 1.1vw, 0.68rem);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0A2749;
}

.category-blocks-desc {
  display: flex;
  flex-direction: row;
  align-items: center;
  background-color: #fff;
}

/* The mosaic is rendered by a snippet, which cannot set a variable the section can
   read back, so the divider a hand-picked image gets via .add-border-top is applied
   here off the sibling instead. */
.category-blocks-desc.add-border-top,
.category-mosaic + .category-blocks-desc {
  border-top: 1px solid #D0D5DD;
}

.category-blocks-desc > div:first-child {
  border-right: 1px solid #D0D5DD;
  flex-grow: 1;
}

.category-blocks-desc h3 {
  font-size: 16px;
  letter-spacing: -0.3px;
  padding: 0.75rem 0.9rem;
  font-weight: bold;
}

.category-blocks-desc::after {
  content: "";
  display: block;
  width: 46px;
  height: 12px;
  background-repeat: no-repeat;
  background-position: center;
  text-align: center;
  margin: 0 auto;
}

.category-blocks-desc h3 {
  width: 100%;
}

/* Column count climbs with width so tiles stay roughly 310-370px wide throughout.
   Because height follows width, holding the width down with columns is what keeps each
   block small — letting tiles run full width would just make them tall again. */
@media (min-width: 700px) {
  .category-blocks {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    padding: 2rem 0;
  }
}

@media (min-width: 1024px) {
  .category-blocks {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1400px) {
  .category-blocks {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* The ipad end responds to the mobile end in vertical screen */

/* @custom-media --tablet (max-width: 959px); */

/* @custom-media --gt-mobile (min-width: 751px); */

/* detectingScreen need to consider the configuration of the tablet */