/* Digital Marketing page: "How Digital Marketing Helps Your Business Grow" (Figma bento grid).
   1240px wide. Columns 397 / 187 / 608 with 24px gaps; rows 309 / 309 / 18 / 309.
   Gray cards use a soft grain on #F1F1EF, green cards use the site's noise on #5B6D49. */

.ect-dm-help,
.ect-dm-help * {
  box-sizing: border-box;
}

.ect-dm-help {
  width: min(1240px, calc(100% - 48px));
  margin: 72px auto;
  font-family: "Montserrat", "Montserrat Variable", sans-serif;
  color: #000;
}

.ect-dm-help__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 16px;
}

body.service-page .ect-dm-help .ect-dm-help__heading {
  max-width: 686px;
  margin: 0;
  font-family: "Montserrat", "Montserrat Variable", sans-serif !important;
  font-size: 42px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  color: #000 !important;
}

.ect-dm-help__intro {
  flex: none;
  width: 484px;
  margin: 16px 0 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

.ect-dm-help__grid {
  display: grid;
  grid-template-columns: 397fr 187fr 608fr;
  grid-template-rows: 309px 309px 18px 309px;
  gap: 24px;
}

.ect-dm-help__card {
  display: flex;
  min-width: 0;
  padding: 16px;
  overflow: hidden;
  border-radius: 16px;
  /* Figma: fill #F1F1EF + Monotone noise #5B6D49 at 34% (size 0.5, density 100%). */
  background-color: #f1f1ef;
  background-image: url("../img/noise-on-gray.40137d71694a.png");
  background-repeat: repeat;
  background-size: 320px 320px;
}

.ect-dm-help__card--green {
  /* Figma: fill #5B6D49 + Monotone noise #D9D9D9 at 40%. */
  background-color: #5b6d49;
  background-image: url("../img/noise-on-green.0a043fc97d8c.png");
  background-repeat: repeat;
  background-size: 320px 320px;
  color: #fff;
}

.ect-dm-help__media {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
}

.ect-dm-help__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* No src yet: the browser shows the alt text, centred, until a picture is added. */
.ect-dm-help__img:not([src]) {
  width: auto;
  height: auto;
  max-width: 100%;
  padding: 16px;
  color: #5b6d49;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
}

.ect-dm-help__copy {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

body.service-page .ect-dm-help .ect-dm-help__title {
  margin: 0;
  font-family: "Montserrat", "Montserrat Variable", sans-serif;
  font-size: 30.51px;
  font-weight: 600;
  line-height: 1.25;
  color: inherit;
}

.ect-dm-help__text {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: inherit;
}

/* Tall card: picture, then title and text underneath. */
.ect-dm-help__card--tall {
  grid-column: 1;
  grid-row: 1 / span 3;
  flex-direction: column;
  gap: 8px;
  padding: 15px 16px 16px;
}

.ect-dm-help__card--tall .ect-dm-help__media {
  height: 443px;
  margin-bottom: 8px;
}

/* Green card A: picture on the left, text on the right. */
.ect-dm-help__card--a {
  grid-column: 2 / span 2;
  grid-row: 1;
  gap: 16px;
}

.ect-dm-help__card--a .ect-dm-help__media {
  width: 432px;
  height: 100%;
}

.ect-dm-help__card--a .ect-dm-help__copy,
.ect-dm-help__card--c .ect-dm-help__copy {
  padding-top: 30px;
}

/* Green card B: text on the left, picture on the right. */
.ect-dm-help__card--b {
  grid-column: 2 / span 2;
  grid-row: 2;
  gap: 24px;
}

.ect-dm-help__card--b .ect-dm-help__copy {
  flex: 0 0 310px;
  padding-top: 30px;
}

.ect-dm-help__card--b .ect-dm-help__media {
  flex: 1 1 0;
  height: 100%;
}

/* Green card C: picture on the left, text on the right. */
.ect-dm-help__card--c {
  grid-column: 1 / span 2;
  grid-row: 4;
  gap: 16px;
}

.ect-dm-help__card--c .ect-dm-help__media {
  width: 276px;
  height: 100%;
}

.ect-dm-help__card--c .ect-dm-help__copy {
  padding-top: 18px;
}

/* Gray card D: text on the left, picture on the right. */
.ect-dm-help__card--d {
  grid-column: 3;
  grid-row: 3 / span 2;
  gap: 16px;
}

.ect-dm-help__card--d .ect-dm-help__copy {
  gap: 15px;
  padding-top: 3px;
}

.ect-dm-help__card--d .ect-dm-help__media {
  width: 249px;
  height: 100%;
}

/* Tablet: two columns, every card keeps its picture and text side by side. */
@media (max-width: 1199px) {
  .ect-dm-help {
    margin: 56px auto;
  }

  .ect-dm-help__header {
    flex-direction: column;
    gap: 12px;
  }

  body.service-page .ect-dm-help .ect-dm-help__heading {
    font-size: clamp(28px, 4.4vw, 36px) !important;
  }

  .ect-dm-help__intro {
    width: auto;
    max-width: 560px;
    margin: 0;
  }

  .ect-dm-help__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-rows: auto;
  }

  .ect-dm-help__card,
  .ect-dm-help__card--tall,
  .ect-dm-help__card--a,
  .ect-dm-help__card--b,
  .ect-dm-help__card--c,
  .ect-dm-help__card--d {
    grid-column: auto;
    grid-row: auto;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }

  .ect-dm-help__card--tall {
    grid-column: 1 / -1;
  }

  .ect-dm-help__media,
  .ect-dm-help__card--tall .ect-dm-help__media,
  .ect-dm-help__card--a .ect-dm-help__media,
  .ect-dm-help__card--b .ect-dm-help__media,
  .ect-dm-help__card--c .ect-dm-help__media,
  .ect-dm-help__card--d .ect-dm-help__media {
    flex: none;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    margin: 0;
  }

  .ect-dm-help__card--b .ect-dm-help__media {
    order: -1;
  }

  .ect-dm-help__card--d .ect-dm-help__media {
    order: -1;
  }

  .ect-dm-help__card--a .ect-dm-help__copy,
  .ect-dm-help__card--b .ect-dm-help__copy,
  .ect-dm-help__card--c .ect-dm-help__copy,
  .ect-dm-help__card--d .ect-dm-help__copy {
    flex: none;
    padding-top: 0;
    gap: 8px;
  }
}

@media (max-width: 700px) {
  .ect-dm-help {
    width: calc(100% - 32px);
  }

  .ect-dm-help__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .ect-dm-help__card--tall {
    grid-column: auto;
  }

  body.service-page .ect-dm-help .ect-dm-help__title {
    font-size: 24px;
  }
}
