/**
 * @file
 * Global typography for the HaKiGo theme.
 *
 * Consumes the font family tokens defined in variables.css.
 */

* {
  font-family: var(--font-default);
}

html {
  font-size: 100%;
}

/**
 * @container needs an ancestor, html has none, so we need a
 * @media query as a dupliacte.
 */
@media (width >= 576px) {
  html {
    font-size: 110%;
  }
}

@media (width >= 768px) {
  html {
    font-size: 120%;
  }
}

@media (width >= 992px) {
  html {
    font-size: 140%;
  }
}

@media (width >= 1200px) {
  html {
    font-size: 150%;
  }
}

h1,
h2,
h3,
h4,
h5,
h6 {
  &,
  span {
    font-family: var(--font-heading);
    font-weight: 400;
  }

  span {
    font-size: 3rem;
  }
}

h2 {
  font-weight: 300;

  hgroup & {
    margin-block-start: 0.2rem;
    font-size: 1.2rem;
  }
}

h3 {
  font-size: 0.8rem;
  font-weight: 300;
}

.sub-heading {
  margin-block-end: 0.5rem;
  font-family: var(--font-highlight);
  font-size: 0.8rem;
  text-transform: lowercase;
}

.card-painpoint {
  font-weight: 300;
  line-height: 1.5;
}

.card-ideal-state {
  font-weight: 500;
  line-height: 1.3;
}

.card-tag,
.card-weight {
  font-family: var(--font-heading);
}

.card-link {
  font-family: var(--font-highlight);
}

.text-highlight {
  p,
  h1,
  h2 {
    &,
    & a,
    & span {
      margin: 0;

      font-family: var(--font-highlight);
      font-size: clamp(1.1rem, 5.5vw, 6rem);
      font-feature-settings:
        "calt" 1,
        "rlig" 1,
        "rvrn" 1,
        "kern" 1,
        "rclt" 1,
        "ss06" 1,
        "ss05" 1,
        "ss04" 1,
        "ss07" 1,
        "ss11" 1,
        "liga" 1,
        "dlig" 1;
      font-weight: 450;
      line-height: 1.3325;
      text-transform: lowercase;
    }

    & a,
    span {
      padding: 0.18em 0.24em 0.11em;
      border: 0.075em solid;
      text-decoration: none;
      white-space: nowrap;

      &.link__highlight--company {
        color: var(--color-highlight-company);
      }

      &.link__highlight--services {
        margin-left: -0.315em;
        color: var(--color-highlight-services);
      }

      &.link__highlight--cases {
        color: var(--color-highlight-cases);
      }
    }

    & a {
      background-image: linear-gradient(currentcolor, currentcolor);
      background-repeat: no-repeat;
      background-position: 0 100%;
      background-size: 0% 0.075em;
      filter: drop-shadow(0 0 0 transparent) drop-shadow(0 0 0 transparent);

      transition:
        background-size 0.3s ease,
        border-color 0.3s ease,
        filter 0.3s ease;

      &:hover,
      &.is-highlighted {
        border-color: transparent;
        background-size: 100% 0.075em;
        filter: drop-shadow(0 0 0.2em currentcolor)
          drop-shadow(0 0 0.4em currentcolor);
      }
    }
  }
}

.node__content p {
  line-height: 1.6;
}
