@use '../tokens/components';
@use '../functions/tokens';
@use '../mixins/utilities';

tokens.$default-map: components.$post-teaser;

.teaser-card {
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;

  img {
    height: tokens.get('teaser-card-sm-image-height');
    min-height: tokens.get('teaser-card-sm-image-height');
    width: 100%;
    object-fit: cover;
    border-top-left-radius: tokens.get('card-border-radius', components.$post-cards);
    border-top-right-radius: tokens.get('card-border-radius', components.$post-cards);
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p {
    margin: 0;
    @include utilities.word-break;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    font-size: tokens.get('teaser-card-sm-heading-font-size');
  }

  // Card content (text + button)
  > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: tokens.get('teaser-card-sm-section-content-padding');
    gap: tokens.get('teaser-card-sm-section-content-gap');
    height: 100%;
    justify-content: space-between;

    // Card text button
    > div {
      display: flex;
      flex-direction: column;
      gap: tokens.get('teaser-card-sm-content-gap');
    }
  }

  &.teaser-card-lg {
    img {
      height: tokens.get('teaser-card-lg-image-height');
      min-height: tokens.get('teaser-card-lg-image-height');
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
      font-size: tokens.get('teaser-card-lg-heading-font-size');
    }

    > div {
      padding: tokens.get('teaser-card-lg-section-content-padding');
      gap: tokens.get('teaser-card-lg-section-content-gap');

      > div {
        gap: tokens.get('teaser-card-lg-content-gap');
      }
    }
  }
}
