/* stylelint-disable declaration-block-no-redundant-longhand-properties */
@charset "UTF-8";

.l-modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1500;
  display: none;
  place-items: center;
  width: 100%;
  height: 100%;
}

.l-modal.is-open {
  display: grid;
}

.l-modal.l-modal--youtube {
  z-index: 1501;
}

.l-modal__bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
}

.l-modal__container {
  position: relative;
  max-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.l-modal__contents {
  position: relative;
}

.l-modal__contents:has(.c-youtube) {
  aspect-ratio: 16 / 9;
}

.l-modal__contents:has(.c-youtube--vertical) {
  aspect-ratio: 9 / 16;
}

.l-modal__close {
  position: absolute;
  top: 0;
  right: 0;
}

/* --------------------------------------------------------------

  smart phone

-------------------------------------------------------------- */
@media (max-width: 750px) {
  .l-modal__contents {
    width: calc(100vw - (var(--gutter-sp) * 100vw / var(--design-sp)));
    max-height: calc(
      98vh - (var(--gutter-sp) * 100vw / var(--design-sp) * 4) * 2
    );
  }

  .l-modal__contents:has(.c-youtube) {
    max-height: unset;
  }

  .l-modal__contents:has(.c-youtube--vertical) {
    width: 315px;
    max-height: unset;
  }

  @supports (height: 100dvh) {
    .l-modal__contents {
      max-height: calc(
        100dvh - (var(--gutter-sp) * 100vw / var(--design-sp) * 4) * 2
      );
    }
  }
}

/* --------------------------------------------------------------

  pc

-------------------------------------------------------------- */
@media (min-width: 751px) {
  .l-modal__contents {
    width: calc(100vw - var(--gutter-pc) * var(--fs) * 2);
    max-width: 1080px;
  }

  .l-modal__contents.l-modal__contents--narrow {
    max-width: 768px;
  }

  .l-modal__contents.l-modal__contents--tin {
    width: 432px;
  }
}

@media (orientation: landscape) {
  .mobile .l-modal__contents.l-modal__contents--narrow {
    width: min(768px, 66vw);
  }

  .mobile .l-modal__close {
    right: calc(20 * var(--fs));
  }
}
