/* Product catalog: two wide tiles, a three-tile row, then repeat. */
.materials-section {
  --catalog-blue: #07366b;
  --catalog-ink: #163e59;
  padding-top: 80px;
  background: #fff;
}

.materials-head { margin-bottom: 30px; }
.materials-head > p { max-width: 430px; }

.materials-mosaic {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.material-card {
  position: relative;
  display: block;
  grid-column: span 3;
  aspect-ratio: 1.7;
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
  color: var(--catalog-ink);
  background: #e9e9e9;
}

.material-card--small {
  grid-column: span 2;
  aspect-ratio: 1;
}

.material-card img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 58%;
  mix-blend-mode: multiply;
  filter: grayscale(1);
  transition: transform .5s ease;
}

.material-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(233,233,233,.88), rgba(233,233,233,0) 35%);
}

.material-card__title {
  position: relative;
  z-index: 2;
  padding: 20px 24px;
  font-size: clamp(18px, 1.65vw, 26px);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -.025em;
}

.material-arrow {
  position: absolute;
  right: 22px;
  bottom: 18px;
  z-index: 2;
  display: block;
  width: 36px;
  height: 24px;
  transition: transform .25s ease;
}

.material-card--cta {
  background: var(--catalog-blue);
  color: #fff;
  transition: background .25s ease;
}

.material-card--cta::after { display: none; }
.material-card__cta-text {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 66px;
  color: #d4e0ef;
  font-size: clamp(14px, 1.15vw, 18px);
  line-height: 1.5;
}

.material-card:focus-visible {
  outline: 3px solid var(--catalog-blue);
  outline-offset: 3px;
  z-index: 3;
}

@media (hover: hover) {
  .material-card:hover img { transform: scale(1.035); }
  .material-card:hover .material-arrow { transform: translateX(5px); }
  .material-card--cta:hover { background: #0b467f; }
}

@media (max-width: 1000px) {
  .materials-section { padding-top: 64px; }
  .material-card__title { padding: 16px 18px; font-size: 18px; }
  .material-arrow { right: 17px; bottom: 14px; width: 32px; }
  .material-card__cta-text { left: 18px; right: 18px; bottom: 56px; }
}

@media (max-width: 600px) {
  .materials-section { padding-top: 54px; }
  .materials-head { margin-bottom: 24px; }
  .materials-mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .material-card, .material-card--small { grid-column: span 1; aspect-ratio: .92; }
  .material-card__title { padding: 13px 12px; font-size: 15px; }
  .material-card img { object-position: center; }
  .material-arrow { right: 12px; bottom: 12px; width: 29px; height: 20px; }
  .material-card__cta-text { left: 12px; right: 12px; bottom: 45px; font-size: 12px; }
}

/* Fit the complete catalog below the sticky site header. */
@media (min-width: 701px) {
  .materials-section {
    height: calc(100vh - 154px);
    height: calc(100svh - 154px);
    padding: 18px 4.5% 22px;
    display: flex;
    flex-direction: column;
    scroll-margin-top: 43px;
  }

  .materials-head {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-end;
    gap: 28px;
    margin-bottom: 16px;
  }

  .materials-head .eyebrow { margin-bottom: 10px; font-size: 10px; }
  .materials-head h2 { font-size: clamp(28px, 2.55vw, 42px); line-height: 1.08; }
  .materials-head > p { max-width: 390px; font-size: 13px; line-height: 1.5; }

  .materials-mosaic {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
  }

  .material-card, .material-card--small {
    grid-column: span 1;
    min-height: 0;
    aspect-ratio: auto;
  }

  .material-card__title { padding: 13px 16px; font-size: clamp(14px, 1.25vw, 19px); }
  .material-arrow { right: 15px; bottom: 11px; width: 30px; height: 22px; }
  .material-card__cta-text { left: 16px; right: 60px; bottom: 15px; font-size: 12px; line-height: 1.4; }
}

@media (min-width: 701px) and (max-width: 1000px) {
  .materials-head { gap: 20px; }
  .materials-head > p { max-width: 250px; font-size: 12px; }
  .materials-mosaic {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .material-card__title { padding: 10px 12px; font-size: 14px; }
  .material-card__cta-text { left: 12px; bottom: 12px; font-size: 11px; }
}

@media (min-width: 701px) and (max-height: 650px) {
  .materials-section { padding-top: 10px; padding-bottom: 16px; }
  .materials-head { margin-bottom: 10px; }
  .materials-head .eyebrow { margin-bottom: 6px; }
  .materials-head h2 { font-size: 28px; }
  .materials-head > p, .material-card__cta-text { display: none; }
  .material-card__title { padding-top: 10px; padding-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .material-card, .material-card img, .material-arrow { transition: none; }
  .material-card:hover img, .material-card:hover .material-arrow { transform: none; }
}
