/* The enterprise open source page reuses the AI page's section styles; only the sections unique to this page live here */
@import url("/css/layouts/ai.css");

.adopt-intro {
  max-width: 65ch;
  margin-bottom: 2rem;
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--dark-blue);
}

/* four partner logos on the same four columns as the What We Deliver cards */
.adopt-partner-logos {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;

  @media not (min-width: 700px) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 1.5rem;
  }
}


[id="sectors"] .adopt-intro {
  margin: 1rem 0 0;
}


/* === QUESTIONS === */

[id="adopt-questions"] {
  padding: 5rem 0;
}

.adopt-questions-split {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 4rem;
  align-items: start;

  @media not (min-width: 900px) {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  & p {
    color: var(--dark-blue);
    line-height: 1.6;
  }
}

.adopt-question-list {
  margin-top: 0;

  & strong {
    display: block;
  }
}


/* === WHAT WE DELIVER: six tiles, as on the AI page === */

[id="ai-services"] {
  & .adopt-intro {
    margin: 1rem 0 0;
    color: var(--off-white);
  }

  /* always three on top and three below, down to phone width; all tiles the same height */
  & .ai-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 1fr;

    @media not (min-width: 650px) {
      grid-template-columns: 1fr;
    }
  }

  /* the Posit tile shows the wordmark in the icon slot: same height, wider, left aligned */
  & .ai-tile img.adopt-tile-logo {
    align-self: flex-start;
    width: auto;
    height: 56px;
    padding: 12px 0;
    box-sizing: border-box;
  }
}


/* === OUR PRODUCTS === */

[id="adopt-products"] {
  padding: 5rem 0;
}

.adopt-product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;

  @media not (min-width: 1100px) {
    grid-template-columns: 1fr;
  }

  /* everything centred in the card, so the space either side is even */
  & article {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    padding: 2.5rem 2rem;
    background: var(--off-white);
  }

  & h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: var(--medium);
    color: var(--burgundy);
  }

  /* bulleted, left-aligned lines in a block that is itself centred in the card,
     so the bullets line up and the space either side stays even */
  & ul {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 0.5rem;
    padding-left: 1.2rem;
    text-align: left;
    list-style: disc;
  }

  & li {
    max-width: none;
    margin: 0 0 0.6rem;
    line-height: 1.6;
    color: var(--dark-blue);
  }
}

.adopt-product-lead {
  margin: 0;
  font-weight: var(--medium);
  color: var(--dark-blue);
  line-height: 1.6;
}


/* product name with its logo, as on the PHUSE leaflet */
.adopt-product-name {
  display: flex;
  align-items: center;
  gap: 0.75rem;

  & img {
    height: 3.25rem;
    width: auto;
  }
}


/* === ALIGNMENT ACROSS CARD PAIRS === */

/* Coadun, Litmus and Diffify: bullets follow straight on from each card's own lead,
   and the buttons line up along the bottom of the row */
@media (min-width: 1100px) {
  .adopt-product-grid article {
    min-width: 0;

    & ul {
      flex: 1;
    }

    & .buttony-link {
      margin-top: auto;
      align-self: center;
      max-width: 100%;
      box-sizing: border-box;
    }
  }
}

/* case studies: here they follow the light blue products band, so they need top padding */
[id="evidence"] {
  padding-top: 5rem;
}

/* logo, title and buttons share rows across the two case study cards */
@media (min-width: 900px) {
  [id="evidence"] .case-study-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-row: span 3;
    grid-template-rows: subgrid;
    justify-content: center;
    align-items: center;
    column-gap: 1rem;
    row-gap: 1rem;

    & .case-study-image,
    & .case-study-title {
      grid-column: 1 / -1;
    }

    & .case-study-title {
      align-self: center;
    }

    /* keep the two buttons together in the middle */
    & .case-study-web {
      justify-self: end;
    }

    & .case-study-pdf {
      justify-self: start;
    }
  }
}


/* === PHONES === */

@media not (min-width: 700px) {
  /* smaller partner logos so the two-up rows have room to breathe */
  .adopt-partner-logos img {
    height: calc(var(--logo-h) * 0.7);
  }

  .adopt-product-grid article {
    padding: 1.5rem;

    & ul {
      flex: none;
    }

    & .buttony-link {
      margin-top: 0;
    }
  }
}
