@use "variables";

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block;
}

pre {
  margin: 1.25rem 0;
  border-right: var(--color-accent) 0.3125rem solid;
  border-radius: var(--rounded-sm);
  background-color: var(--color-background-code);
  padding: 0.625rem 1.25rem;
  overflow: auto;
  font-weight: 500;
  font-family: var(--main-mono);

  code {
    border: 0;
    @include variables.roundedNone;
    background-color: transparent;
    padding: 0;
    color: var(--color-text);

    span {
      color: var(--shiki-light, inherit);

      @media (prefers-color-scheme: dark) {
        color: var(--shiki-dark, inherit);
      }

      .line .highlighted {
        background-color: rgba(142, 150, 170, 0.14);

        @media (prefers-color-scheme: dark) {
          background-color: rgba(101, 117, 133, 0.16);
        }
      }
    }
  }

  .highlighted {
    background-color: rgba(142, 150, 170, 0.14);

    @media (prefers-color-scheme: dark) {
      background-color: rgba(101, 117, 133, 0.16);
    }

    & {
      display: inline-block;
      transition: background-color 0.5s;
      margin: 0 -1.5rem;
      padding: 0 1.5rem;
      width: calc(99% + 2 * 1.5rem);
    }
  }

  .has-focused-lines .line:not(.has-focus) {
    opacity: 0.4;
    filter: blur(0.095rem);
    transition:
      filter 0.35s,
      opacity 0.35s;
  }
}

blockquote {
  margin: 1.25rem 0;
  border-radius: 0.5rem 0.8rem 0.8rem 0.5rem;
  border-inline-start: var(--color-accent) 0.3125rem solid;
  background-color: var(--color-background-second);
  padding: 0.625rem 1.1875rem;
  width: max-content;
  max-width: 97%;

  blockquote {
    margin: 0.3125rem 0;
    padding: 0.3125rem 0.625rem;
  }

  p:first-of-type {
    margin: 0 !important;
    color: var(--color-text-secondary);
  }
}

img,
video {
  transition:
    transform 0.4s,
    border-radius 0.4s,
    box-shadow 1.5s ease;
  margin: 0.625rem 0;
  border-radius: var(--rounded-sm);
  width: 100%;

  &:hover {
    transform: scale(1.1);
    cursor: zoom-in;
    box-shadow: var(--base-shadow);
    border-radius: var(--rounded);
  }
}

video:hover {
  transform: scale(1.06);
  @include variables.roundedNone;
}

figcaption {
  display: block;
  margin-top: -0.5rem;
  margin-bottom: 2rem;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  text-align: center;
}

hr {
  margin: 1.25rem 5%;
  @include variables.borderBasic(0.125rem);
  border-radius: var(--rounded);
}

mark {
  margin: 0;
  border-radius: var(--rounded-sm);
  background-color: var(--color-background-second);
  padding: 0.125rem 0.375rem;
  font-size: 0.875rem;
  color: var(--color-accent);
}

/* Miscellaneous */

ul,
ol {
  margin: 0;

  li::marker {
    color: var(--color-accent);
  }
}

ul {
  list-style: disc;
}

ol {
  list-style: decimal;
}

svg {
  fill: inherit;
}
