.home-catalog {
  --gallery-heading: #f0e4ce;
  --gallery-text: #d6c8b1;
  --gallery-link: #e7ce9f;
  --gallery-rule: #ad95684d;
  --gallery-title: 22px;
  --gallery-lead-title: 27px;
  --gallery-copy: 17px;
  --gallery-action: 15px;
  --gallery-target: 44px;
  --gallery-column-gap: 34px;
  --gallery-row-space: 28px;
  --gallery-caption-space: 12px;
  --gallery-preview: 2.85;
  --gallery-lead-preview: 1.73;
  padding-block: 0 9px;
  margin-top: -60px;
}

#main-content-home .home-catalog-gallery {
  position: relative;
  z-index: 2;
  width: min(1100px, calc(100% - 72px));
  margin-inline: auto;
}

#main-content-home .home-catalog-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto auto auto;
  column-gap: var(--gallery-column-gap);
  padding: var(--gallery-row-space) 0;
  margin: 0;
  list-style: none;
}

#main-content-home .home-catalog-row + .home-catalog-row {
  border-top: 1px solid var(--gallery-rule);
}

#main-content-home .home-catalog-item {
  display: grid;
  grid-row: span 3;
  grid-template-rows: subgrid;
  align-items: start;
  min-width: 0;
}

#main-content-home .home-catalog-art {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: var(--gallery-preview);
  isolation: isolate;
}

#main-content-home .home-catalog-lead .home-catalog-art {
  aspect-ratio: var(--gallery-lead-preview);
}

/* Soften the picture edges against the existing Home scene. */
#main-content-home .home-catalog-art img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  mask-image:
    linear-gradient(to right, transparent, #000 2.5%, #000 97.5%, transparent),
    linear-gradient(to bottom, #000 80%, #000a 94%, transparent);
  mask-composite: intersect;
}

#main-content-home .home-catalog-explorer img {
  object-position: center;
  mask-image:
    linear-gradient(to right, transparent, #000 3%, #000 97%, transparent),
    linear-gradient(to bottom, #000 91%, transparent);
}

#main-content-home .home-catalog-avdi img { object-position: 47% 50%; }
#main-content-home .home-catalog-albums img { object-position: 50% 46%; }
#main-content-home .home-catalog-games img { object-position: 50% 56%; }
#main-content-home .home-catalog-sanctuary img { object-position: 50% 52%; }

#main-content-home .home-catalog-appearance,
#main-content-home .home-catalog-market {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
}

#main-content-home .home-catalog-appearance img:first-child { object-position: 70% 63%; }
#main-content-home .home-catalog-appearance img:last-child { object-position: 72% 69%; }
#main-content-home .home-catalog-market { grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); }
#main-content-home .home-catalog-market img:first-child { object-position: 50% 20%; }
#main-content-home .home-catalog-market img:last-child { object-position: 50% 44%; }

#main-content-home .home-catalog-caption {
  min-width: 0;
  padding-block: var(--gallery-caption-space) calc(var(--gallery-caption-space) * .45);
}

@layer ar-home-catalog {
  body[data-ar-page="home"] #main-content-home .home-catalog-item h3 {
    color: var(--gallery-heading) !important;
    font: 500 var(--gallery-title)/1.12 Georgia, 'Times New Roman', serif !important;
    text-transform: none !important;
    text-shadow: none !important;
    letter-spacing: 0 !important;
    margin: 0 !important;
    overflow-wrap: anywhere;
  }

  body[data-ar-page="home"] #main-content-home .home-catalog-lead h3 {
    font-size: var(--gallery-lead-title) !important;
  }

  body[data-ar-page="home"] #main-content-home .home-catalog-item p {
    color: var(--gallery-text) !important;
    font: 400 var(--gallery-copy)/1.38 Georgia, 'Times New Roman', serif !important;
    margin: .35em 0 0 !important;
    text-transform: none !important;
    text-shadow: none !important;
  }

  body[data-ar-page="home"] #main-content-home .home-catalog-link {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    align-self: end;
    min-height: var(--gallery-target);
    min-width: var(--gallery-target);
    max-width: 100%;
    color: var(--gallery-link) !important;
    background: transparent;
    border: 0;
    padding: 0;
    font: 500 var(--gallery-action)/1.22 Georgia, 'Times New Roman', serif !important;
    font-variant: normal !important;
    text-transform: none !important;
    text-shadow: none !important;
    text-decoration: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  body[data-ar-page="home"] #main-content-home .home-catalog-link:hover {
    color: #fff1d5 !important;
  }

  body[data-ar-page="home"] #main-content-home .home-catalog-link > .gallery-action-label {
    font: inherit !important;
    font-variant: normal !important;
    border-bottom: 1px solid #bda77a8c;
  }

  body[data-ar-page="home"] #main-content-home .home-catalog-link:hover > .gallery-action-label {
    border-color: currentColor;
  }

  body[data-ar-page="home"] #main-content-home .home-catalog-link--primary > .gallery-action-label {
    border-bottom: 0;
  }

  body[data-ar-page="home"] #main-content-home .home-catalog-link:focus-visible {
    outline: 2px solid #ead5ac;
    outline-offset: 3px;
  }

  body[data-ar-page="home"] #main-content-home .home-catalog-link--primary {
    background: #d9c299;
    border: 1px solid #f3dfb7b0;
    border-radius: 2px;
    padding-inline: .68em;
    color: #1c150e !important;
    font-weight: 600 !important;
    text-decoration: none;
  }

  body[data-ar-page="home"] #main-content-home .home-catalog-link--primary:hover {
    background: #ebd6ae;
    color: #1c150e !important;
  }
}

@media (max-width: 620px) {
  html:not([data-unified-phone-layout]) .home-catalog {
    --gallery-title: 17px;
    --gallery-lead-title: 19px;
    --gallery-copy: 15px;
    --gallery-action: 14px;
    --gallery-column-gap: 14px;
    --gallery-row-space: 18px;
    --gallery-caption-space: 6px;
    --gallery-preview: 1.92;
    --gallery-lead-preview: 1.72;
    margin-top: 0;
  }

  html:not([data-unified-phone-layout]) #main-content-home .home-catalog-gallery {
    width: calc(100% - 34px);
  }
}

html[data-unified-phone-layout] .home-catalog {
  --gallery-title: 47px;
  --gallery-lead-title: 51px;
  --gallery-copy: 41px;
  --gallery-action: 40px;
  --gallery-target: 138px;
  --gallery-column-gap: 35px;
  --gallery-row-space: 50px;
  --gallery-caption-space: 19px;
  --gallery-preview: 1.92;
  --gallery-lead-preview: 1.72;
  margin-top: -22px;
  padding-block-end: 35px;
}

html[data-unified-phone-layout] #main-content-home .home-catalog-gallery {
  width: auto;
  margin-inline: 43px 63px;
}

@media (min-device-width: 375px) and (orientation: portrait) {
  html[data-unified-phone-layout] .home-catalog {
    --gallery-title: 43px;
    --gallery-lead-title: 49px;
    --gallery-copy: 37px;
    --gallery-action: 37px;
    --gallery-target: 115px;
    --gallery-row-space: 43px;
    --gallery-caption-space: 16px;
  }
}

@media (orientation: portrait) {
  @layer ar-home-catalog {
    html[data-unified-phone-layout] body[data-ar-page="home"] #main-content-home .offer-grid {
      display: block !important;
    }

    html[data-unified-phone-layout] body[data-ar-page="home"] #main-content-home .offer-grid > .offer-card {
      display: grid !important;
      grid-template-columns: minmax(0, .87fr) minmax(0, 2fr);
      align-items: start !important;
      column-gap: 32px;
      padding: 26px 15px !important;
      border: 0 !important;
      text-align: left !important;
    }

    html[data-unified-phone-layout] body[data-ar-page="home"] #main-content-home .offer-grid > .offer-card + .offer-card {
      border-top: 1px solid #ad95684d !important;
    }

    html[data-unified-phone-layout] body[data-ar-page="home"] #main-content-home .offer-grid .offer-num {
      display: none !important;
    }

    html[data-unified-phone-layout] body[data-ar-page="home"] #main-content-home .offer-grid .offer-card :is(h3, p) {
      width: auto !important;
      max-width: none !important;
      min-width: 0 !important;
      margin: 0 !important;
      text-align: left !important;
    }

    html[data-unified-phone-layout] body[data-ar-page="home"] #main-content-home .offer-grid .offer-card h3 {
      font-size: 44px !important;
      line-height: 1.14 !important;
    }

    html[data-unified-phone-layout] body[data-ar-page="home"] #main-content-home .offer-grid .offer-card p {
      font-size: 41px !important;
      line-height: 1.39 !important;
    }
  }
}

@media (min-device-width: 375px) and (orientation: portrait) {
  @layer ar-home-catalog {
    html[data-unified-phone-layout] body[data-ar-page="home"] #main-content-home .offer-grid .offer-card h3 {
      font-size: 39px !important;
    }

    html[data-unified-phone-layout] body[data-ar-page="home"] #main-content-home .offer-grid .offer-card p {
      font-size: 36px !important;
    }
  }
}

@media (orientation: landscape) {
  html[data-unified-phone-layout] .home-catalog {
    --gallery-title: 29px;
    --gallery-lead-title: 32px;
    --gallery-copy: 24px;
    --gallery-action: 23px;
    --gallery-target: 64px;
    --gallery-column-gap: 32px;
    --gallery-row-space: 24px;
    --gallery-caption-space: 11px;
    --gallery-preview: 2.75;
    --gallery-lead-preview: 1.73;
  }

  @layer ar-home-catalog {
    html[data-unified-phone-layout] body[data-ar-page="home"] #main-content-home .offer-grid .offer-card h3 {
      font-size: 27px !important;
    }

    html[data-unified-phone-layout] body[data-ar-page="home"] #main-content-home .offer-grid .offer-card p {
      font-size: 23px !important;
      line-height: 1.4 !important;
    }
  }
}

@media (max-device-width: 675px) and (orientation: landscape) {
  html[data-unified-phone-layout] .home-catalog {
    --gallery-target: 78px;
  }
}

