.services-section,
.faq-section {
  padding: 88px clamp(24px, 5vw, 80px) 56px;
  background: #fffef3;
  color: #302b28;
  letter-spacing: 0.02em;
  word-spacing: 0;
}

.services-intro,
.faq-intro {
  max-width: 1370px;
  margin: 0 auto 58px;
}

.services-intro h2,
.faq-intro h2 {
  margin: 0 0 18px;
  color: #a13a33;
  font-size: clamp(36px, 4vw, 56px);
  font-weight: 700;
  line-height: 1.1;
}

.services-description,
.faq-description {
  max-width: 1000px;
  margin: 0;
  color: #71655e;
  font-size: 17px;
  line-height: 1.8;
}

.services-layout {
  --service-row-gap: 16px;
  --service-column-gap: clamp(28px, 3.8vw, 64px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr) minmax(0, 1fr);
  align-items: start;
  gap: var(--service-row-gap) var(--service-column-gap);
  max-width: 1370px;
  margin: 0 auto;
}

/* The centre image follows the open card. Each mobile image stays tied to its own card. */
.service-visual,
#service-design .service-inline-visual {
  --service-image: url("EditorialImages/garment-design-research-wall-daylight.webp");
}

.services-layout:not(:has(.service-item[open])) .service-visual,
.services-layout:has(#service-design[open]) .service-visual,
#service-design .service-inline-visual {
  --service-image-position: left center;
}

.services-layout:has(#service-sourcing[open]) .service-visual,
#service-sourcing .service-inline-visual {
  --service-image: url("EditorialImages/fabric-sourcing-swatch-wall.webp");
}

.services-layout:has(#service-sampling[open]) .service-visual,
#service-sampling .service-inline-visual {
  --service-image: url("EditorialImages/patterns-and-sampling-rack.webp");
  --service-image-position: left center;
}

.services-layout:has(#service-sewing[open]) .service-visual,
#service-sewing .service-inline-visual {
  --service-image: url("EditorialImages/cut-and-sew-shears.webp");
  --service-image-position: left center;
}

.services-layout:has(#service-finishing[open]) .service-visual,
#service-finishing .service-inline-visual {
  --service-image: url("EditorialImages/branding-and-finishing-embroidery.webp");
}

.services-layout:has(#service-quality[open]) .service-visual,
#service-quality .service-inline-visual {
  --service-image: url("EditorialImages/quality-checks-pearl-button.webp");
}

.service-column {
  display: grid;
  gap: var(--service-row-gap);
  min-width: 0;
}

@media (width > 900px) {
  .services-layout {
    container-type: inline-size;
    /* The image takes 7/15 of the width after gaps, with a 6:5 aspect ratio. */
    --service-image-height: clamp(400px, (100cqw - 2 * var(--service-column-gap)) * 7 / 18, 460px);
  }

  .service-column-right {
    grid-area: 1 / 3;
  }

  .service-column {
    display: flex;
    flex-direction: column;
    min-height: var(--service-image-height);
  }

  .service-item {
    flex: 1 0 0px;
  }

  /* Give the open card all the space left between the compact headings. */
  .service-column:has(> .service-item[open]) > .service-item:not([open]) {
    flex-grow: 0;
  }
}

@media (width > 900px) and (prefers-reduced-motion: no-preference) {
  .service-item {
    transition: flex-grow 320ms cubic-bezier(0.24, 0.75, 0.35, 1);
  }
}

.service-item {
  border-top: 1px solid #d9d1c4;
}

.service-item > summary {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 24px;
  align-items: center;
  gap: clamp(8px, 1vw, 16px);
  min-height: 68px;
  padding: 15px 0;
  cursor: pointer;
  list-style: none;
}

.service-item > summary::-webkit-details-marker {
  display: none;
}

.service-item > summary:focus-visible {
  outline: 2px solid #a13a33;
  outline-offset: 5px;
}

.service-item > summary svg {
  width: 28px;
  height: 28px;
  color: #a13a33;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.service-title {
  font-size: clamp(17px, 1.5vw, 21px);
  font-weight: 550;
  line-height: 1.3;
}

.service-toggle {
  position: relative;
  width: 24px;
  height: 24px;
  color: #a13a33;
}

.service-toggle::before,
.service-toggle::after {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 22.5px;
  height: 2px;
  background: currentColor;
  content: "";
  transform: translate(-50%, -50%);
}

.service-toggle::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.service-item > summary:hover .service-title {
  color: #a13a33;
}

.service-item[open] .service-toggle::after {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(0deg);
}

@media (prefers-reduced-motion: no-preference) {
  .service-toggle::after {
    transition: transform 260ms ease, opacity 260ms ease;
  }

  @supports selector(::details-content) and (transition-behavior: allow-discrete) {
    .service-item::details-content {
      display: grid;
      grid-template-rows: 0fr;
      opacity: 0;
      overflow: clip;
      transition:
        grid-template-rows 320ms cubic-bezier(0.24, 0.75, 0.35, 1),
        opacity 240ms ease,
        content-visibility 320ms allow-discrete;
    }

    .service-item[open]::details-content {
      grid-template-rows: 1fr;
      opacity: 1;
    }

    .service-detail-motion {
      min-height: 0;
      overflow: clip;
    }
  }
}

.service-detail {
  padding: 0 0 16px;
}

.service-detail p {
  margin: 0;
  color: #625850;
  font-size: 16px;
  line-height: 1.65;
}

.service-detail p + p {
  margin-top: 8px;
}

.service-detail strong {
  color: #302b28;
  font-weight: 700;
}

.service-visual,
.service-inline-visual {
  background-color: #392a21;
  background-image: var(--service-image);
  background-position: var(--service-image-position, center);
  background-size: cover;
}

.service-visual {
  grid-area: 1 / 2;
  width: 100%;
  height: var(--service-image-height);
}

.service-inline-visual {
  display: none;
}

.services-next-step {
  display: flex;
  justify-content: center;
  max-width: 1370px;
  margin: 62px auto 0;
  padding: 28px 0;
  border-top: 1px solid #d9d1c4;
  text-align: center;
}

.services-next-step a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  max-width: 100%;
  min-height: 44px;
  border-bottom: 1px solid #a13a33;
  color: #a13a33;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.services-next-step a:hover {
  color: #302b28;
}

.services-next-arrow {
  position: relative;
  flex: none;
  width: 1em;
  height: 1em;
}

.services-next-arrow::before,
.services-next-arrow::after {
  position: absolute;
  content: '';
}

.services-next-arrow::before {
  top: 0.14em;
  right: 0.14em;
  width: 0.6em;
  height: 0.6em;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
}

.services-next-arrow::after {
  top: calc(50% - 0.75px);
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transform: rotate(-45deg);
}

@media (max-width: 900px) {
  .services-section,
  .faq-section {
    padding-top: 64px;
  }

  .services-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
  }

  .service-visual {
    display: none;
  }

  /* Show the picture with the extra text when there is no central column. */
  .service-inline-visual {
    display: block;
    aspect-ratio: 3 / 2;
    margin-top: 16px;
  }
}

@media (max-width: 600px) {
  .services-section,
  .faq-section {
    padding: 56px 24px 40px;
  }

  .services-intro,
  .faq-intro {
    margin-bottom: 38px;
  }

  .services-description,
  .faq-description {
    font-size: 15px;
  }

  .services-layout {
    --service-row-gap: 10px;
    grid-template-columns: minmax(0, 1fr);
  }

  .services-next-step {
    margin-top: 40px;
  }

  .services-next-step a {
    gap: 14px;
    font-size: 13px;
    letter-spacing: 0.04em;
  }
}
