@charset "UTF-8";

/* ==========================================================================
   Project: News Archive
   File:    news.css
   対象:    お知らせ一覧ページ・詳細ページ
   依存:    common.css（デザイントークン）
   ========================================================================== */


/* ==========================================================================
   1. 年度選択フィルタ（一覧ページ）
   ========================================================================== */

.p-archive-filter {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--spacing-xl);
}


/* ==========================================================================
   1-A. カスタムセレクト
   --------------------------------------------------------------------------
   開閉・選択処理は news-select.js で管理
   ========================================================================== */

.c-custom-select {
  position: relative;
  width: 260px;
  user-select: none;
}

/* トリガーボタン */
.c-custom-select__trigger {
  display: flex;
  align-items: stretch;
  background-color: #ffffff;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--transition-base);
}

.c-custom-select__trigger:hover,
.c-custom-select.is-open .c-custom-select__trigger {
  border-color: var(--color-main);
}

/* ラベルエリア */
.c-custom-select__label {
  flex: 1;
  padding: 12px 16px;
  font-size: var(--fs-base);
  color: var(--color-text);
  letter-spacing: 0.03em;
  line-height: 1.5;
}

/* 矢印：四角いメインカラーボタン */
.c-custom-select__arrow {
  width: 44px;
  background-color: var(--color-main);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.c-custom-select__arrow::after {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-right: 2.5px solid #ffffff;
  border-bottom: 2.5px solid #ffffff;
  transform: rotate(45deg);
  margin-top: -4px;
  transition: transform var(--transition-base), margin-top var(--transition-base);
}

.c-custom-select.is-open .c-custom-select__arrow::after {
  transform: rotate(-135deg);
  margin-top: 4px;
}

/* ドロップダウン：デフォルトは完全に非表示 */
.c-custom-select__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  z-index: 100;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  pointer-events: none;
  transition:
    max-height 250ms cubic-bezier(0.4, 0, 0.2, 1),
    opacity 180ms ease,
    transform 200ms ease,
    visibility 0ms 250ms;
}

.c-custom-select.is-open .c-custom-select__dropdown {
  max-height: 300px;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition:
    max-height 250ms cubic-bezier(0.4, 0, 0.2, 1),
    opacity 180ms ease,
    transform 200ms ease,
    visibility 0ms 0ms;
}

.c-custom-select__dropdown {
  list-style: none !important;
  margin: 0;
  padding: 0;
}

/* 各オプション */
.c-custom-select__item {
  padding: 14px 16px;
  font-size: var(--fs-base);
  color: var(--color-text);
  cursor: pointer;
  border-bottom: 1px solid var(--color-border-light);
  letter-spacing: 0.03em;
  transition: background-color 120ms ease;
  /* li のデフォルト余白リセット */
  padding-left: 16px;
  margin-bottom: 0;
}

.c-custom-select__item:last-child {
  border-bottom: none;
}

.c-custom-select__item:hover {
  background-color: rgba(18, 193, 158, 0.06);
  color: var(--color-main);
}

/* 選択中 */
.c-custom-select__item.is-selected {
  color: var(--color-main);
  font-weight: var(--fw-bold);
  background-color: rgba(18, 193, 158, 0.04);
}

/* アクセシビリティ用ネイティブ select（非表示） */
.c-custom-select__native {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

@media (max-width: 768px) {
  .c-custom-select {
    width: 100%;
  }
}


/* ==========================================================================
   2. お知らせリスト
   ========================================================================== */

.p-news-list {
  border-top: 2px solid var(--color-main);
}

.news__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.news__item {
  border-bottom: 1px solid var(--color-border-light);
}

.news__link {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-block: 20px;
  padding-inline: 0;
  text-decoration: none;
  color: var(--color-text);
  transition: opacity var(--transition-base);
}

.news__link:hover {
  opacity: 0.75;
}

.news__link:hover .news__title {
  text-decoration: underline;
  text-underline-offset: 4px;
}


/* ==========================================================================
   3. 日付
   ========================================================================== */

.news__date {
  width: 96px;
  flex-shrink: 0;
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  color: var(--color-gray-600);
  letter-spacing: 0.02em;
}


/* ==========================================================================
   4. カテゴリバッジ
   ========================================================================== */

.news__category {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  flex-shrink: 0;
  padding: 3px 8px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  border-radius: 2px;
  white-space: nowrap;
  text-align: center;
  border: 1.5px solid currentColor;
}

.news__category--info,
.news__category--event {
  color: var(--color-main);
  background-color: rgba(18, 193, 158, 0.04);
}

.news__category--exam,
.news__category--important {
  color: var(--color-pdf-badge);
  background-color: rgba(204, 0, 0, 0.06);
}


/* ==========================================================================
   5. タイトル
   ========================================================================== */

.news__title {
  flex: 1;
  font-size: var(--fs-base);
  font-weight: normal;
  line-height: var(--lh-normal);
  margin: 0;
  display: flex;
  align-items: center;
}


/* ==========================================================================
   6. リンクアイコン（タイトル末尾）
   ========================================================================== */

.p-news-list a::after {
  display: none;
}

.news__link[href$=".pdf"] .news__title::after {
  content: "\f1c1";
  font-family: "Font Awesome 6 Free";
  font-weight: 400;
  color: var(--color-pdf-badge);
  margin-left: 8px;
  flex-shrink: 0;
}

.news__link[target="_blank"]:not([href$=".pdf"]) .news__title::after {
  content: "\f35d";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: var(--color-gray-400);
  margin-left: 8px;
  font-size: 0.8em;
  flex-shrink: 0;
}


/* ==========================================================================
   7. 一覧ページ レスポンシブ（768px以下）
   ========================================================================== */

@media (max-width: 768px) {

  .news__link {
    flex-wrap: wrap;
    gap: 6px;
    padding-block: 16px;
  }

  .news__date {
    width: auto;
    order: 1;
  }

  .news__category {
    width: auto;
    order: 2;
  }

  .news__title {
    width: 100%;
    order: 3;
    font-size: var(--fs-sm);
  }
}


/* ==========================================================================
   8. 詳細ページ：記事メタ情報
   ========================================================================== */

.p-news-detail__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: var(--spacing-2xl);
  padding-bottom: var(--spacing-lg);
  border-bottom: 1px solid var(--color-border-light);
}

.p-news-detail__date {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--color-gray-600);
  letter-spacing: 0.02em;
}

.p-news-detail__meta .news__category {
  width: auto;
}


/* ==========================================================================
   9. 詳細ページ：記事本文エリア
   ========================================================================== */

.p-news-detail__body {
  /* content.css を継承。固有調整が必要な場合はここに追記 */
}


/* ==========================================================================
   10. 詳細ページ：フッター（一覧に戻るボタン）
   ========================================================================== */

.p-news-detail__foot {
  display: flex;
  justify-content: center;
  margin-top: var(--spacing-2xl);
  padding-top: var(--spacing-xl);
  border-top: 1px solid var(--color-border-light);
}

.p-news-detail__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 40px;
  border: 2px solid var(--color-main);
  border-radius: var(--radius-pill);
  color: var(--color-main);
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  text-decoration: none;
  transition: background-color var(--transition-base), color var(--transition-base);
}

.p-news-detail__back::before {
  content: "\f053";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.75em;
}

.p-news-detail__back:hover {
  background-color: var(--color-main);
  color: #ffffff;
}

@media (max-width: 768px) {
  .p-news-detail__back {
    width: 100%;
    justify-content: center;
    padding: 14px 24px;
  }
}

