/**
 * @interface
 * var(--post-timeline-cover-divider: '') - show a top divider for a covered first item
 */

@layer components {
  @scope (blog-post-timeline) to ([data-component]) {
    :scope {
      display: block;
    }

    ol {
      list-style: none;
      margin: 0;
      padding: 0;
    }

    li {
      position: relative;

      &::after,
      &:first-child::before {
        content: "";
        position: absolute;
        right: calc(50% - 50vw);
        left: calc(50% - 50vw);
        border-bottom: 1px solid rgb(0 0 0 / 10%);
        pointer-events: none;
      }

      :root[data-color-scheme="dark"] & {
        &::after,
        &:first-child::before {
          border-color: rgb(255 255 255 / 10%);
        }
      }

      &:first-child::before {
        content: var(--post-timeline-cover-divider, none);
        top: 0;
        z-index: 1;
      }

      &::after {
        bottom: 0;
      }
    }
  }
}
