@import '../../mixins.scss';

%common-imagetext-style {
  padding: 0.5em 0;
  color: var(--pp-color-black-light-3);
  font-size: 34rpx;
  line-height: 52rpx;
}

%caption {
  margin-top: 12rpx;
  font-size: 27rpx;
  color: var(--pp-color-black-light-5);
  line-height: 1.7em;
}

.imagetext {
  &__gallery {
    position: relative;
    @extend %common-imagetext-style;

    .caption {
      position: relative;
      @extend %caption;
    }
  }

  &__paragraph {
    position: relative;
    @extend %common-imagetext-style;

    .p, p {
      line-height: 1.6em;
      margin: 0;

      &:empty {
        &:before {
          display: block;
          content: '.';
          opacity: 0;
        }
      }
    }
    .b, b {
      font-weight: 500;
    }
  }

  &__material {
    position: relative;
    @extend %common-imagetext-style;
  }

  &__video {
    position: relative;
    @extend %common-imagetext-style;

    .wrap {
      @include flex;
      width: 100%;
      position: relative;
      overflow: hidden;
      transform: translateZ(0);
      min-height: 150*2rpx;
      background-color: #000;
      border-radius: var(--video-border-radius, 0*2rpx);
  
      &:before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 3;
        background-color: rgba(0,0,0,0.05);
        transition: background-color ease-in-out 0.3s;
        pointer-events: none;
      }

      .poster {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 2;
        pointer-events: none;

        .image {
          width: 100%;
          height: 100%;
        }
      }

      .bottom-toolbar {
        @include flex;
        z-index: 9;
        position: absolute;
        bottom: 10*2rpx;
        right: 13*2rpx;
        color: rgba(#fff, 0.9);
        font-size: 22*2rpx;
        transition: all 0.3s cubic-bezier(0.39, 0.575, 0.565, 1);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;

        .item {
          @include flex;
          margin-left: 25rpx;

          &:first-child {
            margin-left: 0;
          }
        }
      }
  
      .button {
        @include flex;
        z-index: 9;
        position: absolute;
        top: 50%;
        left: 50%;
        width: 65*2rpx;
        height: 65*2rpx;
        border-radius: 50%;
        transform: translate3d(-50%, -50%, 0);
        background-color: rgba(255,255,255,.6);
        backdrop-filter: blur(5*2rpx);
        color: var(--pp-color-primary);
        font-size: 35*2rpx;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.39, 0.575, 0.565, 1);
        -webkit-tap-highlight-color: transparent;
      }
  
      &.play {
        &:before {
          background-color: rgba(0,0,0,0);
        }
  
        .button {
          opacity: 0;
        }
      }
    }
  
    video {
      width: 100%;
      height: 100%;
      display: block;
      position: relative;
      z-index: 1;
    }

    .caption {
      @extend %caption;
    }
  }

  &__header {
    position: relative;
    @extend %common-imagetext-style;

    .h {
      font-weight: bold;
      line-height: 1.25em;

      &.left {
        text-align: left;
      }
      &.center {
        text-align: center;
      }
      &.right {
        text-align: right;
      }
      &.justify {
        text-align: justify;
      }

      &-1 {
        font-size: 1.8em;
      }
      &-2 {
        font-size: 1.5em;
      }
      &-3 {
        font-size: 1.17em;
      }
      &-4 {
        font-size: 1em;
      }
      &-5 {
        font-size: 0.83em;
      }
      &-6 {
        font-size: 0.67em;
      }
    }
  }
}