/*
  Structure after decorate:
  .stock-investing-cards.block
    .stock-investing-cards-list
      .stock-investing-card
        a.stock-investing-card-link            (only when a link is authored)
          .stock-investing-card-top
            .stock-investing-card-icon > picture
          .stock-investing-card-desc > p
          span.stock-investing-card-cta        (only when link text is not the raw URL)
*/

/* section heading/intro above the block */
.stock-investing-cards-container .default-content-wrapper h2{
  text-align: center;
}

.stock-investing-cards-container .default-content-wrapper p {
    font-size: 16px;
}

.stock-investing-cards {
  container: stock-investing-cards / inline-size;
  margin: 24px 0;
}

.stock-investing-cards .stock-investing-cards-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.stock-investing-cards .stock-investing-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  text-align: center;
  border: none;
  border-radius: 8px;
  background: var(--color-white);
  box-shadow: var(--primary-boxshadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stock-investing-cards .stock-investing-card:has(.stock-investing-card-link):hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px 0 rgb(30 51 72 / 16%);
}

.stock-investing-cards .stock-investing-card-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.stock-investing-cards .stock-investing-card-link:hover {
  text-decoration: none;
}

/* logo: fixed box so square and wide logos render at a consistent size */
.stock-investing-cards .stock-investing-card-top {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 12px;
}

.stock-investing-cards .stock-investing-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 160px;
  height: 64px;
}

.stock-investing-cards .stock-investing-card-icon picture {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.stock-investing-cards .stock-investing-card-icon img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}

/* description */
.stock-investing-cards .stock-investing-card-desc p {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-text-secondary);
}

.stock-investing-cards .stock-investing-card-desc p + p {
  margin-top: 8px;
}

/* cta */
.stock-investing-cards .stock-investing-card-cta {
  margin-top: auto;
  padding-top: 12px;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  line-height: 20px;
  color: var(--link-color);
}

.stock-investing-cards .stock-investing-card-cta::before {
  content: '\2192';
  margin-right: 6px;
}

.stock-investing-cards .stock-investing-card-link:hover .stock-investing-card-cta {
  text-decoration: underline;
}

/*
  Responsive: columns follow the block's own width (not the viewport),
  so it also fits when the section is narrow, e.g. next to a form.
  >= 660px: 3 per row | 400-659px: 2 per row | < 400px: 1 per row
*/
@container stock-investing-cards (width < 660px) {
  .stock-investing-cards .stock-investing-cards-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .stock-investing-cards .stock-investing-card {
    padding: 20px;
  }
}

@container stock-investing-cards (width < 400px) {
  .stock-investing-cards .stock-investing-cards-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stock-investing-cards .stock-investing-card {
    padding: 15px;
  }

  .stock-investing-cards .stock-investing-card-icon {
    max-width: 140px;
    height: 56px;
  }
}

@media (width <= 768px) {
  .stock-investing-cards {
    margin: 16px 0;
  }

  .stock-investing-cards .stock-investing-card {
    border: 1px solid rgb(0 0 0 / 10%);
  }
}
