/*
 * サービス(連盟 + 企業向けサービス)ページ専用 CSS。
 *
 * 深い multi-parent × multi-child cross-product が selector 数膨張を起こす
 * 箇所では native CSS nesting (`&`) を許容している (plain CSS で browser
 * が直接 parse するため Sass 依存はなし)。
 *
 * 注意: `rgb(125, 125, 125Z)` (1 箇所、`Z` 混入)は typo を意図的に残した
 * もの。該当 rule (details summary::after の color) は parser に拒否される
 * が、当時から運用されている挙動 (= color が UA default になる) を保つため
 * 修正していない。
 *
 * 共通 hero (`.page-top` / `.scrolldown` / `.corporate-top h2` /
 * `.service-top h2` / `@keyframes scrolldown`) は `layouts/_base.css` 側、
 * 本 file は federation page 固有 selector のみ扱う。
 */

/* 共通項目 ==================== */
.service section {
  padding: 5rem 10vw;
  margin: 0 auto;
  color: rgb(50, 50, 50);
  z-index: 5;
  position: relative;
}

/* federation page section bg を `.service section.odd-section` /
 * `.service section.even-section` (specificity 0,0,2,1) で co-locate。
 * `.odd-section` / `.even-section` (specificity 0,0,1,0) のグローバル定義は
 * 他 page 用途のため `_base.css` に残置。 */
.service section.odd-section {
  background-color: rgb(248, 248, 248);
}

.service section.even-section {
  background-color: rgb(243, 243, 243);
}

@media (max-width: 959px) {
  .service section {
    padding: 2rem 5vw;
  }
}

/* Page top ==================== */
/*
 * top_4_* variants は `app/assets/images/generated/top/` に build 時生成。
 * Propshaft は `/generated/...` の logical path を
 * `/assets/generated/...-{fingerprint}` に rewrite する。
 */
/* DPR ベースの image-set は mobile DPR 2+ で 2x (1600w) を引いて
   viewport 360px に対し過剰な download になるため viewport size 基準に切替。 */
.jusdl-top::before {
  background-image: linear-gradient(rgba(0, 0, 0, .6), rgba(0, 0, 0, .6)),
                    url("/assets/generated/top/top_4_768-1118c4fd.avif");
}

@media (min-width: 960px) {
  .jusdl-top::before {
    background-image: linear-gradient(rgba(0, 0, 0, .6), rgba(0, 0, 0, .6)),
                      url("/assets/generated/top/top_4_1600-71bdbb0a.avif");
  }
}

@supports not (background-image: url("dummy.avif")) {
  .jusdl-top::before {
    background-image: linear-gradient(rgba(0, 0, 0, .6), rgba(0, 0, 0, .6)),
                      url("/assets/generated/top/top_4_768-a99f6651.webp");
  }
}

.jhsdl-top::before {
  background-image: linear-gradient(rgba(0, 0, 0, .6), rgba(0, 0, 0, .6)),
                    url("/assets/generated/others/jhsdl-top_768-c1621801.avif");
}

@media (min-width: 960px) {
  .jhsdl-top::before {
    background-image: linear-gradient(rgba(0, 0, 0, .6), rgba(0, 0, 0, .6)),
                      url("/assets/generated/others/jhsdl-top_1600-34899391.avif");
  }
}

@supports not (background-image: url("dummy.avif")) {
  .jhsdl-top::before {
    background-image: linear-gradient(rgba(0, 0, 0, .6), rgba(0, 0, 0, .6)),
                      url("/assets/generated/others/jhsdl-top_768-f6e79d66.webp");
  }
}

.jcsdl-top::before {
  background-image: linear-gradient(rgba(0, 0, 0, .6), rgba(0, 0, 0, .6)),
                    url("/assets/generated/others/jcsdl-top_768-06338bbc.avif");
}

@media (min-width: 960px) {
  .jcsdl-top::before {
    background-image: linear-gradient(rgba(0, 0, 0, .6), rgba(0, 0, 0, .6)),
                      url("/assets/generated/others/jcsdl-top_1600-57b02900.avif");
  }
}

@supports not (background-image: url("dummy.avif")) {
  .jcsdl-top::before {
    background-image: linear-gradient(rgba(0, 0, 0, .6), rgba(0, 0, 0, .6)),
                      url("/assets/generated/others/jcsdl-top_768-58006d75.webp");
  }
}

/* JUSDL用 */
.jusdl-top h2::after {
  content: "全日本大学ストリートダンス連盟";
  white-space: nowrap;
}

/* JHSDL用 */
.jhsdl-top h2::after {
  content: "全日本高等学校ストリートダンス連盟";
  white-space: nowrap;
}

/* JCSDL用 */
.jcsdl-top h2::after {
  content: "全日本社会人ストリートダンス連盟";
  white-space: nowrap;
}

/* JUSDL ==================== */
.service-jusdl h2 {
  font-size: 36px;
  margin-top: 3rem;
  margin-bottom: 1rem;
}

.service-jusdl .about-jusdl {
  display: flex;
  flex-direction: row;
}

.service-jusdl .about-jusdl .describe-jusdl {
  width: 40%;
  white-space: nowrap;
}

.service-jusdl .about-jusdl .describe-jusdl p {
  margin: 1rem;
}

.service-jusdl .about-jusdl .describe-jusdl h3 {
  margin-top: 1.5rem;
  margin-left: 1rem;
  font-size: 24px;
}

.service-jusdl .about-jusdl .describe-jusdl ul {
  margin-left: 1.5rem;
}

.service-jusdl .about-jusdl .describe-jusdl ul li {
  margin-bottom: 0.25rem;
  font-size: 14px;
}

.service-jusdl .about-jusdl .jusdl-map {
  width: 60%;
}

.service-jusdl .about-jusdl .jusdl-map picture {
  display: block;
}

.service-jusdl .about-jusdl .jusdl-map img {
  width: 100%;
  height: auto;
}

@media (max-width: 959px) {
  .service-jusdl .about-jusdl .describe-jusdl {
    width: 100%;
    white-space: normal;
  }

  .service-jusdl .about-jusdl .describe-jusdl p {
    margin: 0.5rem 0 0 1rem;
  }

  .service-jusdl .about-jusdl .describe-jusdl h3 {
    margin-top: 0.5rem;
    margin-left: 1rem;
    font-size: 20px;
  }

  .service-jusdl .about-jusdl .jusdl-map {
    margin: 0 auto;
  }
}

@media (max-width: 519px) {
  .service-jusdl {
    margin-bottom: 0;
  }

  .service-jusdl h2 {
    font-size: 22px;
    margin: 2rem 0 0 0;
  }

  .service-jusdl .about-jusdl {
    flex-direction: column-reverse;
  }

  .service-jusdl .about-jusdl .describe-jusdl p {
    font-size: 14px;
  }

  .service-jusdl .about-jusdl .describe-jusdl ul li {
    font-size: 12px;
  }

  .service-jusdl .about-jusdl .jusdl-map {
    width: 100%;
  }
}

@media (min-width: 520px) and (max-width: 959px) {
  .service-jusdl .about-jusdl .jusdl-map {
    width: 95%;
  }
}

.service-jhsdl .about-jhsdl,
.service-jcsdl .about-jcsdl {
  margin-top: 2rem;

  & p {
    margin-bottom: 1rem;
  }
}


/* ALL JAPAN ==================== */
/* MissCollegeDancer ==================== */
.service-all-japan,
.service-miss-college-dancer,
.service-japan-allstars {
  & p {
    font-size: 24px;
  }

  & h2 {
    font-size: 36px;
    margin-bottom: 1.5rem;
  }

  & .service-all-japan-content,
  & .service-miss-college-dancer-content,
  & .service-japan-allstars-content {
    display: flex;
    flex-direction: row;

    & .describe-all-japan,
    & .describe-miss-college-dancer,
    & .describe-japan-allstars {
      width: 50%;

      & details {
        width: 95%;
        font-size: 14px;
        margin: 1rem 0;

        & summary {
          font-size: 26px;
          display: block;
          border-bottom: solid 1px rgb(215, 215, 215);
          padding-left: 0.5rem;
          padding-bottom: 0.5rem;
          cursor: pointer;
          position: relative;

          &::-webkit-details-marker {
            display: none;
          }

          /* chevron-down (Heroicons) を inline SVG data-URI として
             background に焼く。色は元の `rgb(125, 125, 125)` を fill に直接指定。 */
          &::after {
            content: '';
            display: block;
            width: 0.9rem;
            height: 0.9rem;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237d7d7d'%3E%3Cpath fill-rule='evenodd' d='M12.53 16.28a.75.75 0 0 1-1.06 0l-7.5-7.5a.75.75 0 0 1 1.06-1.06L12 14.69l6.97-6.97a.75.75 0 1 1 1.06 1.06l-7.5 7.5Z' clip-rule='evenodd' /%3E%3C/svg%3E");
            background-size: contain;
            background-repeat: no-repeat;
            position: absolute;
            top: 50%;
            right: 0.5rem;
            transform: translateY(-50%);
          }
        }

        &.js-animation {
          & summary {
            &::after {
              transition: transform .3s ease-in;
            }
            &.rotated::after {
              transform: translateY(-50%) rotateX(180deg);
            }
          }
        }

        & .details-contents {
          overflow: hidden;
        }

        & span {
          display: inline-block;
          padding: 0.5rem 0.5rem 1rem 1rem;
          width: 100%;

          & table {
            width: 100%;
            border-collapse: collapse;

            & tr {
              & th {
                border-bottom: solid 1px rgb(215, 215, 215);
                padding: 0.5rem 0;
              }

              & td {
                padding-left: 0.5rem;
              }

              & td:nth-child(2) {
                padding-top: 0.5rem;
              }

              & td:nth-child(1) {
                border-bottom: solid 1px rgb(215, 215, 215);
                padding-bottom: 0.5rem;
              }
            }
          }
        }

        & dl {
          display: flex;
          flex-wrap: wrap;
          margin-top: 0;
          padding: 0 0.5rem 1rem 1rem;

          & dt {
            width: 35%;
            border-bottom: solid 1px rgb(215, 215, 215);
            padding: 0.5rem 0;
          }

          & dd {
            width: 65%;
            margin-left: 0;
            border-bottom: solid 1px rgb(215, 215, 215);
            padding: 0.5rem 0;

            & .rep-league-univ {
              font-size: 12px;
              padding: 0;
            }
          }
        }
      }
    }

    & .describe-miss-college-dancer {
      & details {
        margin-left: 5%;
      }
    }

    & .all-japan-img,
    & .miss-college-dancer-img,
    & .japan-allstars-img {
      width: 50%;

      & .service_swiper {
        aspect-ratio: 4 / 3;
        overflow: hidden;

        & .swiper-wrapper {
          display: flex;
          height: 100%;
          transition: transform .5s ease;
        }

        & .swiper-slide {
          flex: 0 0 100%;
        }

        & .swiper-button-prev,
        & .swiper-button-next {
          width: 1.7rem;
          height: 1.7rem;
        }
        & .swiper-button-prev { left: .7rem; }
        & .swiper-button-next { right: .7rem; }

        & .swiper-pagination {
          gap: 0.3rem;
          & .swiper-pagination-bullet {
            height: 3px;
          }
        }
      }
    }
  }

  /* placeholder の <div> も lazy mount 後の <iframe> も同じ class で
     aspect-ratio を効かせるため CSS aspect-ratio に揃える */
  & .youtube-container {
    display: block;
    margin: 5rem auto 0 auto;
    width: 64%;
    aspect-ratio: 16 / 9;
    border: 0;
  }
}

@media (max-width: 959px) {
  .service-all-japan,
  .service-miss-college-dancer,
  .service-japan-allstars {
    & .youtube-container {
      margin: 0.75rem auto 2rem auto;
      width: 100%;
    }
  }
}

@media (max-width: 519px) {
  .service-all-japan,
  .service-miss-college-dancer,
  .service-japan-allstars {
    & p {
      font-size: 14px;
    }

    & h2 {
      font-size: 22px;
      margin-bottom: 0.5rem;
    }

    & .service-all-japan-content,
    & .service-miss-college-dancer-content,
    & .service-japan-allstars-content {
      flex-direction: column-reverse;

      & .describe-all-japan,
      & .describe-miss-college-dancer,
      & .describe-japan-allstars {
        width: 100%;

        & details {
          width: 100%;
          font-size: 12px;
          margin: 0.5rem 0;

          & summary {
            font-size: 16px;
          }

          & span {
            padding: 0.5rem 0.5rem 0.5rem 1rem;
          }

          & dl {
            padding: 0 0.5rem 0.5rem 1rem;

            & dt {
              padding: 0.5rem 0 0.5rem 0.25rem;
            }

            & dd {
              & .rep-league-univ {
                font-size: 10px;
              }
            }
          }
        }
      }

      & .all-japan-img,
      & .miss-college-dancer-img,
      & .japan-allstars-img {
        width: 100%;
        margin-bottom: 0.75rem;

        & .swiper-button-prev,
        & .swiper-button-next {
          margin: -0.5rem;

          &::after {
            scale: 0.5;
          }

          &:hover::after {
            scale: 0.6;
          }
        }
      }
    }
  }
}

@media (min-width: 520px) and (max-width: 959px) {
  .service-all-japan,
  .service-miss-college-dancer,
  .service-japan-allstars {
    & .service-all-japan-content,
    & .service-miss-college-dancer-content,
    & .service-japan-allstars-content {
      & .describe-all-japan,
      & .describe-miss-college-dancer,
      & .describe-japan-allstars {
        & details {
          & summary {
            font-size: 22px;
          }
        }
      }
    }
  }
}

.service-miss-college-dancer {
  text-align: right;
}

.service-miss-college-dancer p {
  display: inline-block;
  margin-right: 0.5rem;
}

.service-miss-college-dancer h2 {
  display: inline-block;
}

.service-miss-college-dancer div {
  text-align: left;
}

.service-miss-college-dancer div .swiper-pagination {
  text-align: center;
}

.service-miss-college-dancer .youtube-container {
  margin-bottom: 5rem;
}

@media (max-width: 519px) {
  .service-miss-college-dancer {
    text-align: left;
  }

  .service-miss-college-dancer p {
    display: block;
    margin-right: 0;
  }

  .service-miss-college-dancer h2 {
    display: block;
  }

  .service-miss-college-dancer .service-miss-college-dancer-content {
    flex-direction: column;
  }

  .service-miss-college-dancer .youtube-container {
    margin-bottom: 2rem;
  }
}
