/* ==========================================================================
   sdgs/index.html 専用スタイル
   Tailwindビルド対象外の独自CSS（ネイティブCSSネスト）。
   .text-left / .text-center / .text-right はTailwindユーティリティに
   置き換え済みのためここには含まない。
   ========================================================================== */
@keyframes gradient {
  0% {
    background-position: 0 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

.sdgs {
  /* サイト共通のstyle.cssがbodyを白文字前提（ダークテーマ）にしているため、
     元ページの既定文字色（黒）を明示的に指定し直す。指定していないと、
     例えば.section-titleの白背景の上で文字が白文字のまま見えなくなる。 */
  color: #000;
  font-size: 1.6rem;
  font-family: "Noto Sans JP", sans-serif;
  /* 元は<body>全体にかかっていた背景。.bg-f配下（お取り組み紹介エリア）は
     各セクションが自前の背景（白背景・目標別の写真）で覆っているため見えないが、
     末尾の出典リンク部分ではこのグラデーションが透けて見える設計だったため、
     .hero-bgだけでなく.sdgs全体に適用する。 */
  background: linear-gradient(90deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
  background-size: 400% 400%;
  animation: gradient 30s infinite;
  background-position: 0 0;

  h1,
  h2,
  h3,
  blockquote {
    padding: 0;
    margin: 0;
    display: block;
  }

  img {
    /* Tailwindのpreflightがimgをdisplay:block・vertical-align:middleにするため、
       text-align: centerでの中央揃えや、画像の後に続くテキストとの行間に
       依存している元デザインに合わせて、両方とも既定値に戻す。 */
    display: inline;
    vertical-align: baseline;
    width: 100%;
    height: auto;
  }

  a {
    color: #fff;
  }

  .hero {
    padding: 20px;
    color: #fff;
    max-width: 1200px;
    margin: 0 auto;

    h1 {
      display: block;
      margin-bottom: 8vw;
    }
    h2 {
      margin-bottom: 8vw;
      text-align: center;
    }
    h3 {
      margin-bottom: 5vw;
      text-align: center;
    }

    @media (min-width: 768px) {
      padding: 50px 20px;

      h1 {
        margin-bottom: 100px;
      }
      h2 {
        margin-bottom: 100px;

        img {
          width: 60%;
        }
      }
      h3 {
        margin-bottom: 20px;

        img {
          width: 70%;
        }
      }
      blockquote,
      cite {
        width: 70%;
        margin: 0 auto;
        display: block;
        line-height: 2;
      }
    }
  }

  .sdgs__sources {
    padding: 2vw;
    text-align: center;

    a {
      display: block;
      text-decoration: underline;
      margin: 1rem 0;
    }

    @media (min-width: 768px) {
      a {
        display: inline;
        margin: 0 25px;
      }
    }
  }

  .section-title_sdgs {
    padding: 50px 20px;
    text-align: center;
    background-color: #fff;

    h2 {
      font-size: 2rem;
      max-width: 700px;
      margin: 0 auto;
    }

    @media (min-width: 768px) {
      padding: 100px 20px;

      h2 {
        font-size: 4rem;
      }
    }
  }

  .block {
    background-size: cover !important;
    text-align: center;
    color: #fff;
    padding: 30px 0;
    position: relative;
    opacity: 0;
    visibility: hidden;
    transform: translateY(40px);
    transition: all 1s;

    @media (min-width: 769px) {
      padding: 150px 0;
    }

    &::before {
      content: "";
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      display: block;
      background-color: rgba(0, 0, 0, 0.2);
    }

    @media (max-width: 768px) {
      p {
        font-size: 1.2rem;
      }
    }

    h2 {
      font-size: 4rem;
    }
    h3 {
      display: flex;
      align-items: center;
      justify-content: center;
      flex: 1 1 20%;
      font-size: 2rem;
      font-weight: 100;
      line-height: 1.2;

      @media (min-width: 768px) {
        font-size: 5rem;
      }
    }
    p {
      text-align: left;
      padding: 5px 10px;
      margin-bottom: 0;
    }
    .item-body {
      position: relative;
      z-index: 5;
      width: 100%;
      max-width: 1200px;
      margin: 0 auto;
      display: flex;
      align-content: center;
      justify-content: space-between;
    }
    .item {
      flex: 0 0 45%;
    }

    &.s1 {
      background-image: url(/sdgs/img/001.jpg);
      .item {
        padding-left: 15px;
      }
      p {
        background-color: #e30320;
      }
    }
    &.s2 {
      background-image: url(/sdgs/img/002.jpg);
      .item {
        padding-right: 15px;
      }
      p {
        background-color: #d6a509;
      }
    }
    &.s3 {
      background-image: url(/sdgs/img/003.jpg);
      .item {
        padding-left: 15px;
      }
      p {
        background-color: #17963f;
      }
    }
    &.s4 {
      text-align: left;
      background-image: url(/sdgs/img/004.jpg);
      .item {
        padding-right: 15px;
      }
      p {
        background-color: #c4172b;
      }
    }
    &.s5 {
      text-align: left;
      background-image: url(/sdgs/img/005.jpg);
      .item {
        padding-left: 15px;
      }
      p {
        background-color: #e63b1c;
      }
    }
    &.s11 {
      text-align: center;
      background-image: url(/sdgs/img/011.jpg);
      position: relative;

      .item {
        width: 70%;
        margin: 0 auto;
        z-index: 5;
        position: relative;

        @media (min-width: 768px) {
          width: 800px;
        }
      }
      p {
        background-color: #f4a100;
      }
      h3 {
        position: absolute;
        margin-top: 10px;
        left: 35%;
        z-index: 5;

        @media (min-width: 768px) {
          margin-top: 25px;
          left: 40%;
        }
      }
    }
    &.s12 {
      background-image: url(/sdgs/img/012.jpg);
      .item {
        padding-left: 15px;
        flex: 0 0 60%;
      }
      p {
        background-color: #d29103;
      }
    }
  }

  .vrl {
    writing-mode: vertical-rl;
  }

  .is-show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0px);
  }
}
