/* =================================================================
 * c-select — カスタムドロップダウン（ネイティブ select の置き換え）
 * 指摘対応(No.347): ニュース一覧の公開年プルダウン（Figma 4349:432337 準拠）の
 * デザインへ、プルダウンの箇所すべてを統一するための共通版。
 *
 * 使い方: <select class="js-custom-select"> に custom-select.js が
 *   .c-select（trigger + panel）を生成して差し替える。
 *   select 本体は視覚的に隠して値・フォーム送信・change ハンドラを維持する。
 * =================================================================*/

.c-select {
  position: relative;
  width: 100%;
}

/* 元の select は不可視化（フォーム値・イベントはこちらが持つ） */
.c-select__native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0;
  pointer-events: none;
}

.c-select__trigger {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10rem;
  padding: 10rem 16rem 10rem 20rem;
  background-color: #ffffff;
  border: 0;
  border-radius: 8rem;
  cursor: pointer;
  box-sizing: border-box;
  text-align: left;
  font-family: var(--font-jp);
}

.c-select__trigger:focus-visible {
  outline: 2rem solid var(--color-key);
  outline-offset: 2rem;
}

.c-select__value {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-weight: 400;                    /* Figma「Selector（PC）」の選択値は Regular */
  font-size: 14rem;
  line-height: 21rem;
  color: var(--color-neutral-01);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.c-select__chevron {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.c-select.is-open .c-select__chevron {
  transform: rotate(180deg);
}

.c-select__chevron img {
  display: block;
  width: 12rem;
  height: auto;
}

/* 開いたリスト（Figma 4349:432337 = 白パネル/角丸8/py8/メニュー用ドロップシャドウ） */
.c-select__panel {
  position: absolute;
  top: calc(100% + 4rem);
  left: 0;
  width: 100%;
  min-width: max-content;
  margin: 0;
  padding: 8rem 0;
  list-style: none;
  background-color: #ffffff;
  border-radius: 8rem;
  box-shadow: 0 8rem 30rem rgba(111, 111, 111, 0.2);
  z-index: 30;
  max-height: 336rem;
  overflow-y: auto;
  box-sizing: border-box;
}

.c-select__option {
  display: flex;
  align-items: center;
  height: 48rem;
  padding: 0 16rem;
  font-family: var(--font-jp);
  font-weight: 400;
  font-size: 14rem;
  line-height: 1.8;
  color: var(--color-neutral-01);
  white-space: nowrap;
  cursor: pointer;
}

.c-select__option:hover,
.c-select__option.is-active,
.c-select__option[aria-selected="true"] {
  background-color: var(--color-bg-02);
}
