import { th } from "../core/theme.js";
import styled from "../core/styled.js";
import Box from "../box/box.js";

//#region src/prose/prose.tsx
const Prose = styled(Box)`
  --link-transition-duration: 0.5s;
  --list-margin: ${th.space(2)};
  --list-padding-left: ${th.space(4)};
  --nested-list-margin: ${th.space(.5)};
  --link-color: ${th.color("seaBlue.main")};
  --link-hover-color: ${th.color("seaBlue.35")};
  --bold-font-weight: ${th.fontWeight("bold")};

  display: block;

  /* Paragraphs */
  p + p {
    margin-top: ${th.space(2)};
  }

  /* Bold text */
  b,
  strong {
    font-weight: var(--bold-font-weight);
  }

  /* Unordered lists */
  ul {
    margin: var(--list-margin) 0;
    padding-left: var(--list-padding-left);
    list-style-type: disc;
  }

  /* Ordered lists */
  ol {
    margin: var(--list-margin) 0;
    padding-left: var(--list-padding-left);
    list-style-type: decimal;
  }

  /* List items */
  li {
    line-height: 1.6;
    &::marker {
      color: currentColor;
    }
  }

  /* Nested lists */
  ul ul,
  ol ul {
    list-style-type: circle;
    margin: var(--nested-list-margin) 0;
  }

  ul ul ul,
  ol ul ul {
    list-style-type: square;
  }

  /* Emphasis */
  em,
  i {
    font-style: italic;
  }

  /* Links - as in Link component */
  a {
    color: var(--link-color);
    cursor: pointer;
    padding-bottom: 2px;
    position: relative;
    text-decoration: none;

    background: linear-gradient(to right, currentcolor, currentcolor);
    background-size: 100% 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;

    transition: color var(--link-transition-duration) ease;

    &:hover,
    &:focus {
      animation: linkSwipe var(--link-transition-duration) ease forwards;
      background-size: 100% 1px;
      color: var(--link-hover-color);
    }

    &[target='_blank']::after,
    &[rel~='external']::after,
    &[rel~='noopener']::after {
      content: '';
      display: inline-block;
      position: absolute;
      width: 1rem;
      height: 1rem;

      background-color: currentColor;

      mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' version='1.1' viewBox='0 0 512 512' %3E%3Cpath d='M440 256h-16a8 8 0 0 0-8 8v200a16 16 0 0 1-16 16H48a16 16 0 0 1-16-16V112a16 16 0 0 1 16-16h200a8 8 0 0 0 8-8V72a8 8 0 0 0-8-8H48a48 48 0 0 0-48 48v352a48 48 0 0 0 48 48h352a48 48 0 0 0 48-48V264a8 8 0 0 0-8-8ZM500 0 364 .34a12 12 0 0 0-12 12v10a12 12 0 0 0 12 12l90-.34.7.71-323.19 323.15a12 12 0 0 0 0 17l5.66 5.66a12 12 0 0 0 17 0L477.29 57.34l.71.7-.34 90a12 12 0 0 0 12 12h10a12 12 0 0 0 12-12L512 12a12 12 0 0 0-12-12Z'/%3E%3C/svg%3E%0A");
      mask-repeat: no-repeat;
      mask-size: contain;
    }

    &[target='_blank'],
    &[rel~='external'],
    &[rel~='noopener'] {
      margin-right: 1.5rem;
      &::after {
        transform: translate(4px, 3px);
      }
    }
  }

  @keyframes linkSwipe {
    from {
      background-size: 0 1px;
    }
    to {
      background-size: 100% 1px;
    }
  }
`;
Prose.displayName = "Prose";

//#endregion
export { Prose as default };
globalThis.__vuiVersion__ = "4.0.0"
//# sourceMappingURL=prose.js.map