@import url(common.css);

.archive {
  padding: 3vw 15vw;
  min-width: 700px;
}

.news-filter {
  text-align: right;
  position: relative;
}

.news-filter label {
  vertical-align: middle;
}

#year-select {
  border: 1px solid #000;
  padding: 0.5vw 3vw 0.5vw 1vw;
  margin-left: 10px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='black' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.7vw center;
  background-size: 1.2vw;
  cursor: pointer;
  text-align: left;
}

#year-select option {
  text-align: center;
}

.news-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-bottom: 1px solid #ddd;
  padding: 10px 30px;
  gap: 2vw;
  flex-wrap: wrap;
  font-weight: 500;
  font-size: 1vw;
  transition: all 0.5s ease;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.news-item::before {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 2px;
  background-color: var(--secondary-c);
  transition: width 0.5s ease;
}

.news-item:hover {
  opacity: 0.7;
}

.news-item:hover::before {
  width: 100%;
  right: auto;
  left: 0;
}

.news-date,
.news-cat,
.news-title {
  margin: 0;
}

.news-date {
  width: 10%;
  letter-spacing: 0.1vw;
}

.news-cat {
  color: #fff;
  width: 20%;
  text-align: center;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 0.9rem;
  font-weight: bold;
}

.news-title {
  letter-spacing: 0.2vw;
  flex-grow: 1;
}

.press-release { background-color: rgb(164, 139, 120); }
.media-info     { background-color: #1c2f99; }
.specialist     { background-color: #7ac943; }
.okinawa-plan   { background-color: #009ddc; }
.cousa-lab      { background-color: #e60050; }
.sonota         { background-color: #999; }

.load-more-wrapper {
  text-align: center;
  margin-top: 30px;
}

#load-more-btn {
  padding: 10px 40px;
  width: 15vw;
  border: 2px solid rgb(230, 230, 230);
  border-radius: 100px;
  background: white;
  display: block;
  margin: 0 auto;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

#load-more-btn:hover {
  background: var(--secondary-c);
  color: white;
  border: 2px solid var(--secondary-c);
}

#load-more-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .archive {
    padding: 3vw 5vw;
    min-width: auto;
  }

  .news-filter {
    text-align: left;
    margin-bottom: 1.5em;
  }

  #year-select {
    padding: 0.5vw 3vw 0.5vw 1vw;
    padding-right: 4vw;
    background-position: right 1vw center;
    background-size: 1em;
    font-size: clamp(14px, 1.2vw, 16px);
    width: auto; /* 選択肢幅を内容に合わせる */
    max-width: 100%;
  }

  .news-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 15px 0;
    font-size: clamp(14px, 4vw, 16px);
  }

  .news-date,
  .news-title {
    width: 100%;
    font-size: clamp(12px, 3.5vw, 16px);
    margin-bottom: 0.5em;
  }

  .news-cat {
    display: inline-block;
    font-size: clamp(12px, 3.5vw, 16px);
    margin-bottom: 0.5em;
    width: auto;
  }

  .news-title {
    letter-spacing: 0.5px;
  }

  .load-more-wrapper {
    text-align: center; /* さらに中央寄せ */
  }

  #load-more-btn {
    display: inline-block;
    margin: 0 auto;
    width: auto;
    padding: 10px 20px;
    font-size: clamp(14px, 4vw, 16px);
  }
}
