/*
Theme Name: cousa_okinawa
Author: Number_kazui
Description: 自作テーマ
Version: 1.0
*/

@import url(common.css);

/* 横スクロールを完全に防ぐ */
html,
body {
  overflow-x: hidden;
}

.article-slider {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  overflow: hidden;
  margin-top: 20px;
  position: relative;
  padding-bottom: 70px;
}
.article-slider .swiper-pagination {
  position: absolute;
  bottom: -35px;
  left: 0;
  width: 100%;
  text-align: center;
  z-index: 3;
}
.article-slider .swiper-pagination-bullet {
  background-color: rgba(0, 0, 0, 0.7);
  opacity: 1;
}

.article-slider .swiper-pagination-bullet-active {
  background-color: #b9b9b9;
}

.article-slider .mySwiper {
  overflow: visible;
}

.article-slider .swiper-slide {
  width: 34vw; /* ← スライド幅を調整して3枚が画面をやや超えて見える */
  opacity: 0.6;
  transform: scale(0.9);
  transition: all 0.5s ease;
}
@media (max-width: 768px) {
  .article-slider .swiper-slide {
    width: 70vw;
  }
}

.article-slider .swiper-slide-active {
  opacity: 1;
  transform: scale(1);
  z-index: 2;
}

.article-slider .swiper-slide .slide-content {
  position: relative;
  display: block;
  height: 40vh;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.article-slider .slide-content img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-slider .slide-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: 20px;
  color: #fff;
}

.article-slider .slide-category {
  background: rgba(255, 255, 255, 0.9);
  color: #000;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  display: inline-block;
  margin-bottom: 8px;
}

.article-slider .slide-title {
  font-size: 16px;
  font-weight: bold;
}

.article-slider .slide-title a {
  color: #fff;
  text-decoration: none;
}
.article-slider .swiper-button-prev,
.article-slider .swiper-button-next {
  color: white;
  width: 40px;
  height: 40px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
}

/* 左（前へ）ボタン */
.article-slider .swiper-button-prev {
  left: 35%;
}

/* 右（次へ）ボタン */
.article-slider .swiper-button-next {
  right: 35%;
}

@media (max-width: 768px) {
  .article-slider .swiper-slide {
    width: 70vw;
  }

  .article-slider .swiper-slide .slide-content {
    height: 25vh;
  }
  /* 左（前へ）ボタン */
  .article-slider .swiper-button-prev {
    left: 10%;
  }

  /* 右（次へ）ボタン */
  .article-slider .swiper-button-next {
    right: 10%;
  }
}

/* topics-contents */
.topics-contents {
  li {
    display: flex;
    align-items: center;
    gap: 3%;
    padding: 40px 3vw;

    &:nth-of-type(even) {
      flex-direction: row-reverse;
    }

    .topics-img {
      width: 40%;

      img {
        width: 100%;
        border-radius: 20px;
      }
    }

    .topics-text {
      h3 {
        font-size: clamp(1em, 1.7vw, 28px);
        font-weight: bold;
        margin-bottom: 3vh;
      }
      p {
        font-size: clamp(12px, 1.4vw, 20px);
        margin-bottom: 3vh;
      }
      a {
        padding: 5px 30px;
        border: 1px solid #333333;
        background-color: white;
        display: block;
        border-radius: 20px;
        margin-left: auto;
        width: fit-content;
        transition: all 0.3s ease;
        &:hover {
          background-color: #333;
          color: #fff;
          transform: translateY(-3px);
          box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
        }
      }
    }
  }
}

@media (max-width: 768px) {
  .topics-contents {
    flex-direction: column;
    padding: 0;

    li {
      flex-direction: column !important;
      gap: 5vw;
      padding: 8vw 5vw;

      .topics-img {
        width: 100%;
        img {
          width: 100%;
          height: auto;
          border-radius: 15px;
        }
      }

      .topics-text {
        h3 {
          font-size: clamp(16px, 5vw, 22px);
          margin-bottom: 2vh;
        }
        p {
          font-size: clamp(14px, 4vw, 18px);
          line-height: 1.6;
          margin-bottom: 2vh;
        }
        a {
          font-size: 0.95rem;
          padding: 10px 24px;
          margin-left: 0;
          width: 100%;
          text-align: center;
        }
      }
    }
  }
}

/* c-text */
.c-text {
  position: relative;
  overflow: hidden;
  width: 100vw;
  margin-inline: calc(50% - 50vw);
  padding: 1vh 0;
  background-color: rgb(186, 227, 249);
}

.c-text__inner {
  display: flex;
  width: max-content;
  animation: scrollText 30s linear infinite;
}

.c-text__item {
  white-space: nowrap;
  font-size: 1.5vw;
  color: rgb(29, 32, 136);
  margin-right: 5vw;
}

@keyframes scrollText {
  from {
    transform: translateX(0%);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (max-width: 768px) {
  .c-text__item {
    font-size: clamp(12px, 4vw, 16px); /* スマホでも読みやすく */
    margin-right: 8vw; /* 間隔もやや広めに */
  }

  .c-text__inner {
    animation: scrollTextMobile 20s linear infinite; /* スマホは少し速めに */
  }

  @keyframes scrollTextMobile {
    from {
      transform: translateX(0%);
    }
    to {
      transform: translateX(-50%);
    }
  }
}

/* news */

.news-section {
  padding: 2em 1em;
}
.news-header {
  text-align: center;
  margin-bottom: 1em;
}
.news-search-form {
  text-align: center;
  margin-bottom: 2em;
}
.news-search-form input {
  padding: 0.5em;
  width: 60%;
  max-width: 400px;
  border: 1px solid #000;
  border-radius: 50px;
}
.news-search-form button {
  padding: 0.5em 1em;
  margin-left: 0.5em;
}
.news-list {
  display: grid;
  gap: 1em;
}

#news-container {
  padding: 0 10vw;
}

.news-item {
  display: grid;
  grid-template-columns: 120px 150px 1fr;
  padding: 1em 0;
  gap: 1em;
  align-items: center;
  border-bottom: 1px solid #ddd;
}

.news-more-wrap {
  text-align: center;
  margin-top: 2em;
  padding: 20px 2vw;
}

.news-load-more {
  display: inline-block;
  padding: 0.75em 2.5em;
  border: 2px solid #333;
  background-color: transparent;
  color: #333;
  font-weight: bold;
  font-size: 1rem;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.2em;
}

.news-load-more:hover {
  background-color: #333;
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
  .news-search-form input {
    width: 70%;
    font-size: 1em;
  }

  .news-search-form button {
    font-size: 1em;
  }

  .news-item {
    grid-template-columns: 1fr;
    gap: 0.5em;
    padding: 1em 0;
    text-align: left;
  }

  .news-date,
  .news-cat,
  .news-title {
    font-size: 1em;
  }

  .news-title a {
    font-size: 1em;
    display: inline-block;
    width: 100%;
    word-break: break-word;
  }

  .news-load-more {
    width: 90%;
    font-size: 1em;
    padding: 0.8em;
  }

  #news-container {
    padding: 0 5vw;
  }
}
