@use 'sass:math';
@use '@cfpb/cfpb-design-system/src/abstracts' as *;
@use './search' as *;
@use './search-bar' as *;

.u-readable-width {
  // Magic number: matches max-width for content set in cf-layout
  max-width: 41.875rem;
}

.u-break-word {
  // These two values usurp the deprecated `word-break: break-word;`.
  overflow-wrap: anywhere;
  word-break: normal;
}

.prepaid-agreements {
  dt,
  dd {
    display: block;
    margin-left: 0;
  }

  dt {
    margin-bottom: math.div(
        math.div($grid-gutter-width, 6),
        $base-font-size-px
      ) +
      em;

    @include heading-4($has-margin-bottom: false, $is-responsive: false);
  }

  dd + dt {
    margin-top: math.div(math.div($grid-gutter-width, 2), $base-font-size-px) +
      em;
  }
}

.prepaid-agreements-search {
  padding-top: 0 !important;

  .o-multiselect__label {
    // These two values usurp the deprecated `word-break: break-word;`.
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .filters {
    &__applied {
      padding: math.div(math.div($grid-gutter-width, 2), $base-font-size-px) +
        em;
    }
    .o-multiselect .m-tag-group {
      display: none;
    }
  }

  @include respond-to-min($bp-lg-min) {
    .content__sidebar {
      width: 33% !important;
    }

    .content__main {
      width: 67% !important;
    }
  }

  .search__wrapper {
    label.h2 {
      display: block;
      max-width: none;
      margin-bottom: math.div(
          math.div($grid-gutter-width, 1.5),
          $base-font-size-px
        ) +
        em;
    }
  }

  .search__results {
    .content__sidebar {
      .o-expandable:nth-child(4n) {
        border-bottom: none;
      }
    }

    .results__item {
      h4 {
        max-width: none;
      }
    }
  }

  .database-disclaimer {
    padding: math.div($grid-gutter-width, $base-font-size-px) + em;
    padding-bottom: 0;
  }
}

.prepaid-agreements-detail {
  dd {
    margin-bottom: math.div(
        math.div($grid-gutter-width, 1.5),
        $base-font-size-px
      ) +
      em;
  }
}
