/* Legacy-parity text rendering: the old Creditas site sets
 * -webkit-font-smoothing: antialiased globally, which renders type
 * lighter/thinner on macOS. Webflow Code Components live in isolated
 * shadow roots, so this must be declared per-component on :host to
 * inherit into the shadow tree (the property does not cross the
 * shadow boundary). Without it, Blink defaults to subpixel smoothing
 * and identical 400-weight text looks heavier than the old site. */
:host {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/**
 * MediaGalleryCard — individual card used inside a MediaGallery grid.
 *
 * Class naming: single-class, no BEM `__` separator; element rules nested
 * under `.media-gallery-card`. The title is `.card-title` so the parent
 * section's `.media-gallery .title` doesn't reach it.
 *
 * Tokens inlined from @creditas-ui/themes standard:
 *   colors.neutral.10 #f1f3f2  .60 #52605a  .100 #292929  primary.40 #8edb00
 *   radius.4xl 16px (card) · radius.pill 50px (button)
 *   card image height ~178px · body padding 24px 20px · body gap 12px
 */

.media-gallery-card,
.media-gallery-card *,
.media-gallery-card *::before,
.media-gallery-card *::after {
  box-sizing: border-box;
}

.media-gallery-card {
  display: flex;
  flex-direction: column;
  gap: var(--media-gallery-card-gap, 0);
  background-color: #f1f3f2;
  border-radius: 16px;
  overflow: hidden;
  font-family: 'Helvetica Now Display', 'Helveticanowdisplay', sans-serif;
  color: #292929;

  &.row {
    flex-direction: row;
  }

  /* ---------- image ------------------------------------------------- */

  .image {
    display: block;
    width: 100%;
    height: 178px;
    object-fit: cover;
    flex-shrink: 0;
  }

  &.row .image {
    width: 42%;
    height: auto;
    min-height: 178px;
  }

  /* ---------- body -------------------------------------------------- */

  .body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px 20px;
    flex: 1;
  }

  &.row .body {
    min-width: 0;
  }

  @media (max-width: 767px) {
    &.row {
      flex-direction: column;

      .image {
        width: 100%;
        height: 178px;
        min-height: 0;
      }
    }
  }

  /* ---------- title ------------------------------------------------- */

  .card-title {
    margin: 0;
    font-family: 'Helvetica Now Display', 'Helveticanowdisplay', sans-serif;
    font-weight: 500;
    font-size: 20px;
    line-height: 28px;
    color: #292929;
  }

  /* ---------- description ------------------------------------------ */

  .description {
    margin: 0;
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    color: #52605a;
  }

  /* ---------- CTA button ------------------------------------------- */

  .button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    padding: 12px 24px;
    background-color: #8edb00;
    color: #292929;
    border: none;
    border-radius: 50px;
    font-family: 'Helvetica Now Display', 'Helveticanowdisplay', sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;

    &:hover {
      background-color: #4f9e00;
      color: #ffffff;
    }

    &:focus-visible {
      outline: 2px solid #8edb00;
      outline-offset: 2px;
    }
  }
}

