/* Keep every editorial heading inside its own column. */
.product-slide figcaption,
.product-gallery-item figcaption,
.product-photo-archive-card figcaption,
.product-media-card figcaption,
.product-media-tabs button > span,
.product-media-group-head > b {
  display: none !important;
}

.site-hero-copy {
  min-width: 0;
}

.site-hero h1 {
  width: 100%;
  max-width: 100%;
  font-size: clamp(40px, 3vw, 58px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  word-break: normal;
}

/* Override the runtime catalog's more specific desktop title rule. */
body .site-hero .site-hero-copy h1 {
  width: 100% !important;
  max-width: calc(100% - 8px) !important;
  font-size: clamp(40px, 3vw, 58px) !important;
  line-height: 1.1 !important;
  letter-spacing: -0.02em !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}

/* Catalog headings use another hero template and must not overflow its narrower copy column. */
body .catalog-hero .catalog-hero-copy {
  min-width: 0;
}

body .catalog-hero .catalog-hero-copy h1 {
  width: 100% !important;
  max-width: calc(100% - 8px) !important;
  font-size: clamp(52px, 4vw, 72px) !important;
  line-height: 1.1 !important;
  letter-spacing: -0.02em !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}

@media (min-width: 901px) {
  .site-hero {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  }

  .site-hero-copy {
    padding-right: clamp(28px, 3vw, 56px);
    padding-left: clamp(28px, 3vw, 56px);
  }
}

@media (min-width: 901px) and (max-width: 1250px) {
  .site-hero h1 {
    font-size: clamp(38px, 4.4vw, 50px);
  }

  body .site-hero .site-hero-copy h1 {
    font-size: clamp(38px, 4vw, 48px) !important;
  }

  body .catalog-hero .catalog-hero-copy h1 {
    font-size: clamp(48px, 4.5vw, 58px) !important;
  }
}

@media (max-width: 900px) {
  .site-hero h1 {
    font-size: clamp(38px, 10vw, 56px);
  }

  body .site-hero .site-hero-copy h1 {
    max-width: 100% !important;
    font-size: clamp(36px, 10vw, 52px) !important;
  }

  body .catalog-hero .catalog-hero-copy h1 {
    max-width: 100% !important;
    font-size: clamp(40px, 11vw, 52px) !important;
  }
}

/* Category pages: compact heading followed immediately by the project cards. */
body.kelo-project-category .site-hero,
body.kelo-project-category .catalog-hero {
  display: block !important;
  min-height: 0 !important;
  padding-top: 52px !important;
  padding-right: max(32px, calc((100vw - 1440px) / 2)) !important;
  padding-bottom: 30px !important;
  padding-left: max(32px, calc((100vw - 1440px) / 2)) !important;
  border-bottom: 0;
  background: #f5f4ef;
}

body.kelo-project-category .site-hero-copy,
body.kelo-project-category .catalog-hero-copy {
  display: block;
  max-width: 1080px;
  padding: 0 !important;
}

body.kelo-project-category .site-hero-image,
body.kelo-project-category .catalog-hero-image,
body.kelo-project-category .catalog-hero-meta,
body.kelo-project-category .site-hero-copy > .kicker,
body.kelo-project-category .catalog-hero-copy > .kicker,
body.kelo-project-category .site-hero-lead,
body.kelo-project-category .catalog-hero-lead,
body.kelo-project-category .site-hero-copy > .primary-button,
body.kelo-project-category .catalog-hero-copy > .primary-button,
body.kelo-project-category .product-catalog > .section-title-row {
  display: none !important;
}

body.kelo-project-category .site-hero-copy .breadcrumbs,
body.kelo-project-category .catalog-hero-copy .breadcrumbs {
  margin-bottom: 28px;
}

body.kelo-project-category .site-hero h1,
body.kelo-project-category .catalog-hero h1,
body.kelo-project-category .site-hero .site-hero-copy h1,
body.kelo-project-category .catalog-hero .catalog-hero-copy h1 {
  max-width: 980px !important;
  margin: 12px 0 0 !important;
  font-size: clamp(44px, 4.6vw, 72px) !important;
  line-height: 1.1 !important;
  letter-spacing: -0.02em !important;
  overflow-wrap: normal !important;
}

body.kelo-project-category .product-catalog {
  padding-top: 18px !important;
}

body.kelo-project-category .product-catalog .catalog-chips {
  margin-top: 0;
  margin-bottom: 30px;
}

@media (max-width: 900px) {
  body.kelo-project-category .site-hero,
  body.kelo-project-category .catalog-hero {
    padding-top: 30px !important;
    padding-right: 20px !important;
    padding-bottom: 20px !important;
    padding-left: 20px !important;
  }

  body.kelo-project-category .site-hero-copy .breadcrumbs,
  body.kelo-project-category .catalog-hero-copy .breadcrumbs {
    margin-bottom: 20px;
  }

  body.kelo-project-category .site-hero h1,
  body.kelo-project-category .catalog-hero h1,
  body.kelo-project-category .site-hero .site-hero-copy h1,
  body.kelo-project-category .catalog-hero .catalog-hero-copy h1 {
    margin-bottom: 14px !important;
    font-size: clamp(38px, 11vw, 52px) !important;
  }

  body.kelo-project-category .product-catalog {
    padding-top: 14px !important;
  }
}

/* Tablet typography: keep large serif letters and adjacent lines from colliding. */
@media (min-width: 651px) and (max-width: 1180px) {
  body .product-hero h1,
  body .site-hero h1,
  body .site-hero .site-hero-copy h1,
  body .catalog-hero h1,
  body .catalog-hero .catalog-hero-copy h1,
  body.kelo-project-category .site-hero h1,
  body.kelo-project-category .catalog-hero h1,
  body.kelo-project-category .site-hero .site-hero-copy h1,
  body.kelo-project-category .catalog-hero .catalog-hero-copy h1 {
    line-height: 1.1 !important;
    letter-spacing: 0 !important;
  }

  body .product-hero h1 {
    font-size: clamp(48px, 6vw, 64px) !important;
    text-wrap: balance;
  }
}
