/*------------------------------------*
　ダウンロード共通CSS（アーカイブページ用）
\*------------------------------------*/

/* Noto Sans JP フォント適用 */
.download main,
.download .inner,
.download_list,
.download_card {
  font-family: "Noto Sans JP", sans-serif;
}

/* common.cssのmain要素のmin-width:980pxを上書き */
body main {
    min-width: 0 !important;
    width: 100% !important;
}

.download {
  main header {
    background: #fff;
    color: #23262D;
    font-weight: 700;
    text-align-last: left;
    height: fit-content;

    h1 {
      margin: 0;
      padding: 22px 0 0 0;
      font-size: 38px;
      line-height: 1.5em;
      font-weight: bold;
      letter-spacing: 0em;
    }
  }

  .inner {
    max-width: 1232px;
    padding: 0 20px;
    margin: 0 auto 160px;
    box-sizing: border-box;
  }

  /* パンくずリスト */
  #pankuzu {
    max-width: 1366px;
    width: 100%;
    padding: 0 30px;
    margin: 0 auto;
    box-sizing: border-box;
  }
}

/*------------------------------------*
　アーカイブページ専用CSS
\*------------------------------------*/

.download_category_filter {
  margin-top: 40px;
  margin-bottom: 80px;
}

.download_category_list_head {
  font-size: 16px;
  text-align: left;
  font-weight: 600;
  margin-bottom: 1em;
}

.download_category_list {
  display: flex !important;
  flex-wrap: wrap !important;
  list-style: none !important;
  padding: 24px !important;
  margin: 0 !important;
  background: #F2F2F3 !important;
  border-radius: 6px !important;

  li {
    margin: 0 15px 0 0 !important;
    padding: 0 !important;
    list-style: none !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;

    a {
      display: block;
      padding: 7px 16px;
      background-color: #FFFFFF;
      color: #666;
      text-decoration: none;
      border: 1px solid #DBDBDB;
      border-radius: 4px;
      font-size: 14px;
      transition: all 0.3s ease;
      line-height: 1.4;
      margin: 0;
      height: 100%;
      box-sizing: border-box;

      &.current {
        background-color: #213866;
        color: #fff;
        border: 1px solid #213866;
      }

      @media (hover: hover) {
        &:hover {
          background-color: #213866 !important;
          color: #fff !important;
          border: 1px solid #213866 !important;
        }
      }
    }
  }
}

/* ダウンロード一覧セクション */
.download_list_section {
  padding: 0 10px;
  margin-top: 64px;
}

.download_list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(20px, 8vw, 80px) clamp(16px, 5.6vw, 56px);
  list-style: none;
  padding: 0;
  margin: 0;
}

.download_card {
  text-align: left;

  a {
    display: block;
    text-decoration: none;
    color: inherit;
  }

  @media (hover: hover) {
    &:hover .download_thumbnail img {
      transform: scale(1.02);
    }
  }

  .download_thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 360/200;
    border-radius: 6px;
    overflow: hidden;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      transition: transform 0.3s ease;
    }
  }

  .no_thumbnail {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
    color: #999;
    font-size: 14px;
  }

  .download_content {
    padding: 16px 0 0;
  }

  /* ダウンロードボタンスタイル */
  .download_singleLink {
    margin-top: 16px;
  }

  .download_button_wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 18px 20px;
    color: #23262D;
    border-radius: 6px;
    transition: all 0.3s ease;
    overflow: hidden;
    border:1px solid #23262D;

    &::before {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
      transition: left 0.5s ease;
    }

    @media (hover: hover) {
      &:hover {

        &::before {
          left: 100%;
        }

        .download_arrow {
          transform: translateX(4px);
        }
      }
    }
  }

  .new_badge {
    background: #e3335b; /* より鮮やかな赤色 */
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 4px 9px;
    border-radius: 9999px;
    letter-spacing: 0.5px;
    line-height: 1.4;
    z-index: 2;
  }

  .download_button_text {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.05em;
    line-height: 1;
    padding-left: 0.5em;
  }

  .download_arrow {
    position: relative;
    width: 10px;
    height: 9px;
    svg {
      vertical-align: top;
      width:100%;
      height:auto;
    }
  }


  .download_date {
    color: #666;
    display: block;
    text-align: right;
  }

  .download_category {
    border: 1px solid #DBDBDB;
    color: #6E6E6E;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
  }

  .download_title {
    font-size: 24px;
    line-height: 1.4;
    margin: 0px;
    color: rgb(51, 51, 51);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* モバイル対応 */
  @media (max-width: 768px) {
    .download_content {
      padding: calc(24/750*100vw) 0 0;
    }

    .download_category {
      padding: calc(12/750*100vw) calc(16/750*100vw) calc(10/750*100vw);
      font-size: calc(24/750*100vw);
    }

    .download_title {
      font-size: calc(32/750*100vw);
      margin: 0;
    }

    /* ダウンロードボタン モバイル */
    .download_singleLink {
      margin-top: calc(24/750*100vw);
    }

    .download_button_wrapper {
      padding: calc(24/750*100vw) calc(32/750*100vw) calc(24/750*100vw) calc(24/750*100vw);
      border-radius: calc(12/750*100vw);
    }

    .new_badge {
      top: 50%;
      left:calc(24/750*100vw);
      transform:translateY(-50%);
      font-size: calc(18/750*100vw);
      padding: calc(4/750*100vw) calc(10/750*100vw);
      border-radius: 9999px;
    }

    .download_button_text {
      font-size: calc(26/750*100vw);
    }

    .download_arrow {
      width: calc(32/750*100vw);
      height: calc(32/750*100vw);

      &::before {
        width: calc(12/750*100vw);
        height: calc(3/750*100vw);
        left: calc(3/750*100vw);
      }

      &::after {
        border-left-width: calc(9/750*100vw);
        border-top-width: calc(6/750*100vw);
        border-bottom-width: calc(6/750*100vw);
      }
    }

    .no_thumbnail {
      font-size: calc(32/750*100vw);
    }
  }
}

/* ページネーション */
.download .pagenation {
  margin: 80px auto 150px;
}

@media (min-width: 769px) {
    .download_list {
        grid-template-columns: repeat(2, 1fr);
        gap: clamp(24px, 6vw, 80px) clamp(20px, 4vw, 56px);
    }
}

@media (min-width: 1200px) {
    .download_list {
        gap: 80px 56px;
    }
}

@media (max-width: 768px) {
    /* パンくずリスト */
    .download #pankuzu {
        padding: 0 calc(20/750*100vw);
    }

    /* 基本レイアウト */
    .download .inner {
        padding: 0 calc(40/750*100vw);
        margin:0 auto calc(160/750*100vw);
    }

    .download_list_section {
        padding: 0 calc(10/750*100vw);
    }
    .download_list {
        grid-template-columns: 1fr;
        gap: calc(80/750*100vw);
    }
    .download_category_filter {
        margin-top: calc(40/750*100vw);
        margin-bottom: calc(80/750*100vw);
    }
    .download_category_list {
        gap: calc(10/750*100vw);
        padding: calc(24/750*100vw) !important;
    }
    .download_category_list li {
        margin: 0 calc(15/750*100vw) 0 0 !important;
    }
    .download_category_list li a {
        font-size: calc(26/750*100vw);
        padding: calc(6/750*100vw) calc(12/750*100vw);
    }
    .download_category_list_head {
        font-size: calc(28/750*100vw);
        margin-bottom: calc(16/750*100vw);
    }

    .download .pagenation {
        margin: calc(80/750*100vw) auto calc(150/750*100vw);
    }

    /* ヘッダー */
    .download main header h1 {
        font-size: calc(52/750*100vw);
        line-height: 1.4;
        padding: calc(64/750*100vw) 0 0;
    }
}