/* SolarWinds SVG Library block styles. */
.sw-svg-block {
  padding-top: 48px;
  padding-bottom: 48px;
  color: #111111;
  /* Visible height of the stuck .sw26-header (eyebrow scrolls off via top: -29px). */
  --sw-svg-block-header-offset: 81px;
  --sw-svg-block-admin-bar-offset: 0px;
  --sw-svg-block-sticky-top: max(
    var(--sw-svg-block-header-offset),
    var(--sw-svg-block-admin-bar-offset)
  );

  /* WP admin bar is fixed above 600px only; 32px, or 46px at 782px and below. */
  body.admin-bar & {
    --sw-svg-block-admin-bar-offset: 32px;

    @media (max-width: 782px) {
      --sw-svg-block-admin-bar-offset: 46px;
    }

    @media (max-width: 600px) {
      --sw-svg-block-admin-bar-offset: 0px;
    }
  }

  /* Outranks the card's display: flex so JS filtering via [hidden] wins. */
  .sw-svg-block__card[hidden],
  .sw-svg-block__empty[hidden] {
    display: none;
  }

  .sw-svg-block__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .sw-svg-block__heading {
    margin: 0 0 16px;
    font-family: "Roboto Slab", serif;
    font-size: 2rem;
  }

  .sw-svg-block__description {
    max-width: 760px;
    margin-bottom: 24px;
    font-family: "Roboto", sans-serif;
    font-size: 1rem;
    line-height: 1.5;
  }

  .sw-svg-block__controls {
    position: sticky;
    top: var(--sw-svg-block-sticky-top);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px 0;
    background: #fff;
    border-bottom: 1px solid #efefef;
    box-shadow: 0 4px 6px -4px rgba(17, 17, 17, 0.12);
  }

  .sw-svg-block__search {
    flex: 1 1 auto;
    min-width: 0;
    height: 44px;
    margin: 0;
    padding: 0 14px;
    font-family: "Roboto", sans-serif;
    font-size: 1rem;
    color: #111111;
    background: #fff;
    border: 1px solid #767676;
    border-radius: 4px;

    &::placeholder {
      color: #6b6b6b;
      opacity: 1;
    }

    &:focus-visible {
      outline: 2px solid #111111;
      outline-offset: 2px;
      border-color: #111111;
    }
  }

  .sw-svg-block__count {
    flex: 0 0 auto;
    margin: 0;
    font-family: "Roboto", sans-serif;
    font-size: 0.875rem;
    color: #555555;
    white-space: nowrap;
  }

  .sw-svg-block__empty {
    margin: 0 0 24px;
    padding: 24px;
    font-family: "Roboto", sans-serif;
    text-align: center;
    background: #efefef;
    border-radius: 4px;
  }

  .sw-svg-block__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .sw-svg-block__card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 12px;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    transition:
      border-color 0.15s ease,
      box-shadow 0.15s ease;

    &:hover,
    &:focus-within {
      border-color: #00c8dc;
      box-shadow: 0 0 12px 0 rgba(17, 17, 17, 0.1);
    }
  }

  .sw-svg-block__figure {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 8px;
    margin: 0;
  }

  .sw-svg-block__img {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 96px;
    padding: 24px;
    object-fit: contain;
    background: #ffffff;
    border-radius: 4px;

    .sw-svg-block__card--light-icon & {
      background: #111111;
    }
  }

  .sw-svg-block__name {
    font-size: 0.75rem;
    line-height: 1.4;
    text-align: center;
    overflow-wrap: anywhere;

    & code {
      padding: 0;
      font-family:
        ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono",
        monospace;
      font-size: inherit;
      color: #111111;
      background: none;
    }
  }

  .sw-svg-block__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .sw-svg-block__copy {
    display: inline-flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 32px;
    margin: 0;
    padding: 4px 8px;
    font-family: "Roboto", sans-serif;
    font-size: 0.75rem;
    line-height: 1.2;
    color: #111111;
    white-space: nowrap;
    cursor: pointer;
    background: #fff;
    border: 1px solid #767676;
    border-radius: 4px;
    transition:
      background-color 0.15s ease,
      color 0.15s ease;

    &:hover {
      color: #fff;
      background: #111111;
      border-color: #111111;
    }

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

  .sw-svg-block__copy-icon {
    display: inline-block;
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    background-color: currentColor;
    -webkit-mask: url("../../assets/graphics/svg/copy-to-clipboard.svg")
      center / contain no-repeat;
    mask: url("../../assets/graphics/svg/copy-to-clipboard.svg") center /
      contain no-repeat;
  }

  @media (max-width: 1023px) {
    /* .sw26-header-top-mobile (57px) + header border; same value below 640px. */
    --sw-svg-block-header-offset: 58px;

    .sw-svg-block__heading {
      font-size: 1.75rem;
    }
  }

  @media (max-width: 767px) {
    padding-top: 32px;
    padding-bottom: 32px;

    .sw-svg-block__grid {
      grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
      gap: 12px;
    }
  }

  @media (max-width: 639px) {
    .sw-svg-block__heading {
      font-size: 1.5rem;
    }

    .sw-svg-block__controls {
      flex-direction: column;
      align-items: stretch;
      gap: 8px;
    }

    .sw-svg-block__grid {
      grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr));
    }

    .sw-svg-block__actions {
      flex-direction: column;
    }
  }
}
