@charset "UTF-8";

/* ==========================================================================
   pages/news.css — お知らせ記事詳細 専用CSS
   --------------------------------------------------------------------------
   役割：記事詳細ページ（/dental/news/... 配下）だけで使う定義。
   読み込み順は common → components → nav → theme → pages/news → print。
   下層共通5本の後ろに置くため、ここでの上書きは記述順で勝つ。

   方針（260909_お知らせ移行_変換対応表案.md 確定版に対応）
   - トップページ一覧の .news__* 系（top.css）は移設も複製もしない。
     一覧と記事詳細は別物として、ここでは p-newsDetail__* を新規に定義する。
   - 色・余白・文字サイズはすべて既存の変数を使う。hex の直書きはしない。
   - .c-heading--border は components.css で .p-roundtable 限定に定義されている。
     components.css は変更せず、記事の中でだけ効く形をここで書く。
   - SP用（max-width: 768px）はベース定義の後ろ（本ファイル末尾）にまとめる。
   ========================================================================== */


/* ==========================================================================
   1. 記事本文の親
   ========================================================================== */

.p-newsDetail {
  margin-bottom: var(--spacing-2xl);
}


/* ==========================================================================
   2. 日付とカテゴリの帯（KV の中・タイトルの上）
   --------------------------------------------------------------------------
   短大踏襲（2026-09-09）。本文コンテナ内に置いていたときの下罫線と
   下マージン（--spacing-lg）・padding-bottom は外した。
   KV は .c-mv--plain がメインカラーのベタ塗り（components.css:2563）なので、
   この帯は紺の上に乗る。
   ========================================================================== */

.p-newsDetail__meta {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
}


/* ==========================================================================
   3. カテゴリのラベル（バッジ）
   --------------------------------------------------------------------------
   短大踏襲（2026-09-09 再調整）：KV の紺を透かす白フチのバッジ。
   背景は透明・枠線と文字色は #fff・角丸なし・枠線 1px。
   左右のパディングは --spacing-lg（24px）で文字の左右に余裕を持たせる。
   **修飾子3種（--info / --exam / --important）は背景・枠線・文字色をすべて同じ（白）にする。**
   KV の上では色で区別せず、文字（お知らせ／入試情報／重要なお知らせ）で読み分ける。
   一覧（top.css .news__category 814行〜）は白背景の上に置く前提で色分けしているが、
   記事詳細は紺の上なので方針を分ける。
   ========================================================================== */

.p-newsDetail__category {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 7em;
  margin: 0;
  padding: var(--spacing-xs) var(--spacing-lg);
  border: 1px solid #fff;
  border-radius: 0;
  background-color: transparent;
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  white-space: nowrap;
}

/* 修飾子3種は同じ見た目。分岐を残すのは、あとで色を分ける判断になったときの受け皿。
   値はベース定義と同じ（背景=透明／枠線=白／文字=白）。 */
.p-newsDetail__category--info,
.p-newsDetail__category--exam,
.p-newsDetail__category--important {
  border-color: #fff;
  background-color: transparent;
  color: #fff;
}


/* ==========================================================================
   4. 日付
   --------------------------------------------------------------------------
   紺の KV の上に乗るため白。白のトークンが無いため #fff を直値で使う
   （components.css の .c-mv／.c-mv__title と同じ扱い）。
   バッジ（--fs-xs＝12px）より大きく、太字にする。
   ========================================================================== */

.p-newsDetail__date {
  color: #fff;
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  font-feature-settings: "palt";
  line-height: var(--lh-tight);
}


/* ==========================================================================
   4-2. KV の縦幅（記事詳細だけ広くする）
   --------------------------------------------------------------------------
   既存値（components.css）
     .c-mv     min-height: 400px（2540行）／SP 240px（2616行）
     .c-mv--s  min-height: 180px（2558行）／SP 140px（2619行）
   記事詳細は KV の中にバッジ・日付・タイトルの3段が入るため、
   .c-mv--s より広くする。PC 180 → 260px（+80）／SP 140 → 200px（+60）。

   記事詳細の KV は他の下層ページと同じ class（c-mv c-mv--plain c-mv--s）で、
   HTML は変更しない方針のため、**KV の中にだけ現れる .p-newsDetail__meta を
   :has() で見て**限定する。詳細度は (0,2,0) で .c-mv--s の (0,1,0) に勝つ。
   :has() は components.css でも使用実績がある（634・642・765・820・829・4704行）。
   ========================================================================== */

.c-mv--s:has(.p-newsDetail__meta) {
  min-height: 260px;
}


/* ==========================================================================
   5. 本文
   --------------------------------------------------------------------------
   記事本文は現行から流し込むため、素の p / ul / img / table が直接並ぶ。
   要素ごとの余白リズムをここでまとめて持たせる。
   ========================================================================== */

.p-newsDetail__body {
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
  color: var(--color-text);
}

.p-newsDetail__body > * {
  margin-top: 0;
}

/* 段落 */
.p-newsDetail__body p {
  margin-bottom: var(--spacing-lg);
}

.p-newsDetail__body p:last-child {
  margin-bottom: 0;
}

/* 見出しの前後（本文中の h2〜h5） */
.p-newsDetail__body h2,
.p-newsDetail__body h3,
.p-newsDetail__body h4,
.p-newsDetail__body h5 {
  margin-top: var(--spacing-2xl);
}

.p-newsDetail__body > :first-child {
  margin-top: 0;
}

/* リスト */
.p-newsDetail__body ul,
.p-newsDetail__body ol {
  margin-bottom: var(--spacing-lg);
}

.p-newsDetail__body li {
  margin-bottom: var(--spacing-sm);
}

.p-newsDetail__body li:last-child {
  margin-bottom: 0;
}

/* 画像。記事本文は幅指定を持たない素の img が入る */
.p-newsDetail__body img {
  max-width: 100%;
  height: auto;
}

.p-newsDetail__body p > img {
  display: block;
}

/* 表。列幅はインラインの style で持っているため、ここでは余白と横スクロールのみ */
.p-newsDetail__body table {
  margin-bottom: var(--spacing-lg);
}

/* 区切り線 */
.p-newsDetail__body hr {
  margin: var(--spacing-xl) 0;
  border: 0;
  border-top: 1px solid var(--color-border);
}

/* 動画 */
.p-newsDetail__body video {
  max-width: 100%;
  margin-bottom: var(--spacing-lg);
}


/* ==========================================================================
   6. 記事用の c-heading--border
   --------------------------------------------------------------------------
   components.css:4042 の .p-roundtable .c-heading--border と同じ値。
   components.css は変更せず、記事の中（.p-newsDetail 配下）でだけ効かせる。
   現行 .heading-border（紫1px罫線）の受け皿。
   ========================================================================== */

.p-newsDetail .c-heading--border {
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  padding-top: var(--spacing-md);
  padding-bottom: var(--spacing-md);
  font-size: var(--fs-heading-h4);
  font-weight: var(--fw-bold);
  text-align: center;
  border-top: 2px solid var(--color-main);
  border-bottom: 2px solid var(--color-main);
}


/* ==========================================================================
   7. バナー画像の外部リンクアイコンを消す
   --------------------------------------------------------------------------
   components.css:2492-2501 が
     .c-box-content a[href^="http"][target="_blank"]
       :not([href*=".pdf"]):not([href$=".doc"]):not([href$=".docx"])
       :not([href$=".xls"]):not([href$=".xlsx"])::after
   で Font Awesome の外部リンクアイコン（\f35d）を自動付与している。
   判定は「href が http で始まるか」だけでドメインを見ないため、
   **自サイト宛てでも絶対URLで書かれていればアイコンが出る**。
   記事のバナー（中身が <img> だけのリンク）では画像の右横にアイコンが並ぶ。

   実ファイルの構造（5記事とも同じ）：
     .p-newsDetail__body > p > a[target="_blank"] > img
   img は a の唯一の子。本文内に「画像＋テキスト」のリンクは0件のため、
   :has(> img) で「中身が画像だけ」を一意に判定できる。

   打ち消しは components.css:5503 の .p-link__banner と同じ考え方。
   あちらは content ではなく display を上書きしており、ベース側が display を
   持たないため詳細度に関係なく効く。ここでも display: none を使い、
   加えて content: none も指定して二重に打ち消す。
   content を確実に上書きするため、詳細度はベース側と同じ :not() 5連を並べて
   (0,8,3) とし、ベースの (0,8,2) に勝たせている（記述順でも後ろ）。

   メディアクエリの外に置く。SP専用の上書きは無いので、これだけで PC・SP 共通に効く。
   テキストを含む外部リンク（本文内に55件）のアイコンは残す。
   ========================================================================== */

.p-newsDetail__body a[href^="http"][target="_blank"]:not([href*=".pdf"]):not([href$=".doc"]):not([href$=".docx"]):not([href$=".xls"]):not([href$=".xlsx"]):has(> img)::after {
  display: none;
  content: none;
}


/* ==========================================================================
   8. SP（max-width: 768px）
   --------------------------------------------------------------------------
   ベース定義の後ろに置く。前に置くと記述順で負けて効かない。
   ========================================================================== */

@media (max-width: 768px) {

  .p-newsDetail {
    margin-bottom: var(--spacing-xl);
  }

  /* KV の縦幅（記事詳細だけ）。SP の .c-mv--s は 140px（components.css:2619） */
  .c-mv--s:has(.p-newsDetail__meta) {
    min-height: 200px;
  }

  /* --- パンくずを折り返す（記事詳細だけ・2026-09-09 追加） ---
     components.css:2756-2766 の SP 指定が
       .p-breadcrumb      { overflow-x: auto; }
       .p-breadcrumb__list { flex-wrap: nowrap; white-space: nowrap; word-break: keep-all; }
     で1行固定＋横スクロールにしている。記事詳細は3段目が記事タイトル（長文）のため
     横スクロールが長くなる。ここだけ PC と同じ折り返し（flex-wrap: wrap）に戻す。

     限定の方法：パンくずと本文は同じ <main> の中にあり、.p-newsDetail は記事詳細に
     しか無いので main:has(.p-newsDetail) で絞る。詳細度は (0,2,1) で
     components.css の .p-breadcrumb__list (0,1,0) に勝つ。 */
  main:has(.p-newsDetail) .p-breadcrumb {
    overflow-x: visible;
  }

  main:has(.p-newsDetail) .p-breadcrumb__list {
    flex-wrap: wrap;
    white-space: normal;
    word-break: normal;
    row-gap: var(--spacing-xs);
  }

  /* バッジと日付は横並びのまま。KV が狭いので余白だけ詰める */
  .p-newsDetail__meta {
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
  }

  /* 左右の余裕は保ちつつ、SP では少し詰める（PC は --spacing-lg＝24px） */
  .p-newsDetail__category {
    min-width: 6em;
    padding: 2px var(--spacing-md);
    font-size: var(--fs-xs);
  }

  /* 日付はバッジ（--fs-xs＝12px）より大きく保つ。PC は --fs-md＝18px */
  .p-newsDetail__date {
    font-size: var(--fs-base);
  }

  .p-newsDetail__body {
    font-size: var(--fs-sm);
    line-height: var(--lh-normal);
  }

  .p-newsDetail__body p,
  .p-newsDetail__body ul,
  .p-newsDetail__body ol,
  .p-newsDetail__body table {
    margin-bottom: var(--spacing-md);
  }

  .p-newsDetail__body h2,
  .p-newsDetail__body h3,
  .p-newsDetail__body h4,
  .p-newsDetail__body h5 {
    margin-top: var(--spacing-xl);
  }

  .p-newsDetail__body hr {
    margin: var(--spacing-lg) 0;
  }

  .p-newsDetail .c-heading--border {
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-md);
  }

}

/* ==========================================================================
   8. お知らせ一覧（news__ 系）— 短大の一覧に寄せた版（2026-09-09 改訂）
   --------------------------------------------------------------------------
   対象：/dental/news/index.html・/dental/news/event.html
   マークアップは news.php / event.php が出力する <li>（news__item ／ news__link ／
   news__date ／ news__category ／ news__title）。

   top.css 781-950行にトップページ用の定義があるが、**top.css は www/index.html でしか
   読み込んでいない**ため、この2ページには効かない。ここで別に定義する。
   トップは「2カラムのカードの中の抜粋3件」、一覧は「1カラムの全件」で用途が違うため、
   複製はせず、値（罫線・余白・カテゴリの配色）だけ top.css にそろえる。

   短大に寄せた点（2026-09-09）
   - 一覧の上端をメインカラーの太い罫線（2px）にする。行の下は細い罫線のまま
   - バッジは角丸なし・3種とも同じ幅
   - 行の間隔を広げる（padding-block を --spacing-md → --spacing-lg）
   ========================================================================== */

/* 上端はメインカラーの太罫線、行の下は細罫線（.news__item 側）。
   top.css 781-786行は上端も 1px の --color-border だが、一覧では見出しの区切りとして太くする。 */
.news__list {
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--color-main);
  list-style: none;
}

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

/* PHP は <a class="news__link"> を出力する。設置前の仮表示だけ <span> になる。
   3列グリッド（日付 / カテゴリ / タイトル）。top.css の PC 定義（887-909行）は
   flex の横並びだが、一覧は件数が多く、日付とカテゴリの左端をそろえたいのでグリッドにする。
   カテゴリ列を固定幅にすることで、バッジ3種の幅が自動的にそろう。 */
.news__link {
  display: grid;
  grid-template-columns: 7.5em 9em 1fr;
  align-items: center;
  gap: var(--spacing-lg);
  padding-block: var(--spacing-lg);
  color: var(--color-text);
  font-size: var(--fs-sm);
  text-decoration: none;
}

a.news__link:hover .news__title {
  text-decoration: underline;
}

/* 日付。top.css 807-812行と同じ値 */
.news__date {
  margin: 0;
  color: var(--color-gray-600);
  font-size: var(--fs-base);
  font-feature-settings: "palt";
}

/* カテゴリのバッジ。枠線の太さ（1.5px）と余白は top.css 814-828行を踏襲。
   短大に合わせて **角丸を無くし**、幅は列幅いっぱい（width: 100%）で3種そろえる。
   top.css の width: 40% は一覧では使わない。 */
.news__category {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 100%;
  padding: 3px 10px;
  border: 1.5px solid currentColor;
  border-radius: 0;
  color: var(--color-main);
  background-color: color-mix(in srgb, var(--color-main) 1%, transparent);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  white-space: nowrap;
}

/* 修飾子3種。
   top.css には --exam と --important の定義しかなく、**--info の定義は無い**
   （ベースの紺がそのまま出る前提）。ここでは3種そろえて明示する。
   値は top.css 830-834行に合わせ、--exam と --important は同じ赤。
   ※「重要なお知らせ」と「入試情報」が同色になる。分けるなら --important だけ差し替える。 */
.news__category--info {
  color: var(--color-main);
  background-color: color-mix(in srgb, var(--color-main) 1%, transparent);
}

.news__category--exam,
.news__category--important {
  color: var(--color-exam);
  background-color: color-mix(in srgb, var(--color-exam) 6%, transparent);
}

/* 2026-09-24 お知らせ分類：中区分 メディア・イベント・OC の色 */
.news__category--media {
  color: var(--color-news-media);
  background-color: color-mix(in srgb, var(--color-news-media) 6%, transparent);
}

.news__category--event {
  color: var(--color-news-event);
  background-color: color-mix(in srgb, var(--color-news-event) 6%, transparent);
}

/* タイトル。PHP は <p class="news__title"> を出力する */
.news__title {
  margin: 0;
  font-size: var(--fs-base);
  font-weight: normal;
  line-height: var(--lh-relaxed);
}


/* ==========================================================================
   8-2. KV の縦幅（一覧ページだけ広くする）
   --------------------------------------------------------------------------
   既存値（components.css）
     .c-mv--s  min-height: 180px（2558行）／SP 140px（2619行）
   一覧の KV は .c-mv__cat（小見出し）と .c-mv__title（h1）の2段になるため、
   記事詳細（4-2）と同じ考え方で :has() を使って広げる。

   限定の方法：.c-mv__cat は下層92ページで使われているため目印にできない。
   一覧ページにしか無い .p-archive-filter（年度セレクト）を <main> 越しに見る。
   詳細度は (0,2,0) で .c-mv--s の (0,1,0) に勝つ。
   ========================================================================== */

main:has(.p-archive-filter) .c-mv--s {
  min-height: 260px;
}


/* ==========================================================================
   9. 年度アーカイブのセレクト
   --------------------------------------------------------------------------
   common.js の initYearSelect()（395-436行）が要求するもの。
     - id="yearSelect"        … ラッパ。開閉時に **is-open** が付け外しされる（404・408行）
     - id="yearSelectTrigger" … クリックで開閉（423行）
     - .c-custom-select__label … 選択中のラベル。textContent が差し替わる（418行）
     - .c-custom-select__item  … 選択肢。**is-selected** が付け外しされる（413-416行）
   JS は表示・非表示を style で触らないため、開閉は **.is-open** だけで CSS 側が担当する。
   選択すると location.href = '?year=' + data-value（420行）で同じページに遷移する。
   .c-custom-select__native は aria-hidden の実 select（支援技術用）で、画面には出さない。

   短大に寄せた点（2026-09-09）
   - 右寄せ（.p-archive-filter の justify-content: flex-end）
   - 角丸なし（トリガー・ドロップダウンとも border-radius: 0）
   - 右端の矢印を **メインカラーのベタ塗りのボタン**にする（白い山形を ::before で描く）
   - 幅は 240px を目安にする（短大の実寸は測れないため目安）
   ========================================================================== */

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

.c-custom-select {
  position: relative;
  width: 240px;
  font-size: var(--fs-sm);
}

/* aria-hidden のネイティブ select。common.css の .u-visually-hidden と同じ手法で隠す */
.c-custom-select__native {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* 矢印ボタンを枠いっぱいの高さで置くため、align-items は stretch、
   右側のパディングは持たせない（矢印ボタンが右端に接する）。 */
.c-custom-select__trigger {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  padding: 0 0 0 var(--spacing-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: #fff;
  color: var(--color-text);
  line-height: var(--lh-normal);
  cursor: pointer;
}

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

.c-custom-select__trigger:focus-visible {
  outline: 2px solid var(--color-main);
  outline-offset: 2px;
}

.c-custom-select__label {
  display: flex;
  align-items: center;
  padding-block: 10px;
  font-weight: var(--fw-bold);
}

/* 右端の矢印ボタン：メインカラーのベタ塗り。山形は ::before で白く描く。
   右上・右下の角は **トリガー側の overflow: hidden で切る**。
   ここに border-radius を書くと、外側の角丸（--radius-sm＝5px）から枠線 1px を引いた
   4px を手で合わせることになり、枠線の太さを変えたときにずれる。切り取りに任せる方が確実。 */
.c-custom-select__arrow {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  align-self: stretch;
  background-color: var(--color-main);
}

.c-custom-select__arrow::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  margin: -6px 0 0 -4px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}

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

/* ドロップダウン。JS は is-open を付け外しするだけなので、開閉はここで持つ */
.c-custom-select__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 10;
  max-height: 320px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: #fff;
  box-shadow: var(--shadow-md);
  list-style: none;
}

.c-custom-select.is-open .c-custom-select__dropdown {
  display: block;
}

.c-custom-select__item {
  padding: 10px var(--spacing-md);
  line-height: var(--lh-normal);
  cursor: pointer;
}

.c-custom-select__item:hover {
  background-color: var(--color-gray-25);
}

.c-custom-select__item.is-selected {
  background-color: var(--color-sub);
  color: var(--color-main);
  font-weight: var(--fw-bold);
}


/* ==========================================================================
   10. 一覧のSP（max-width: 768px）
   --------------------------------------------------------------------------
   8・8-2・9 のベース定義の後ろに置く。前に置くと記述順で負けて効かない。
   1行3列は入らないので、top.css の SP（849-884行）と同じ考え方で
   「1段目＝日付＋カテゴリ／2段目＝タイトル」の2段にする。
   バッジは短大にならい、SPでも3種の幅をそろえる（固定幅 8em）。
   ========================================================================== */

@media (max-width: 768px) {

  /* KV。SP の .c-mv--s は 140px（components.css:2619） */
  main:has(.p-archive-filter) .c-mv--s {
    min-height: 200px;
  }

  .news__link {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: var(--spacing-xs) var(--spacing-sm);
    padding-block: var(--spacing-md);
  }

  .news__date {
    grid-column: 1;
    font-size: var(--fs-sm);
  }

  .news__category {
    grid-column: 2;
    justify-self: start;
    width: auto;
    min-width: 8em;
    padding: 2px 8px;
    font-size: var(--fs-xs);
  }

  .news__title {
    grid-column: 1 / -1;
    font-size: var(--fs-sm);
    line-height: var(--lh-normal);
  }

  /* 年度セレクトは幅いっぱいに */
  .p-archive-filter {
    justify-content: stretch;
    margin-bottom: var(--spacing-md);
  }

  .c-custom-select {
    width: 100%;
  }

}

/* 2026-09-24 お知らせ一覧のアイコン：<a> の ::after は grid の子要素になり段が崩れるため消し、タイトルの末尾に付ける（短大と同じ方式） */
/* ① 一覧の <a> の自動アイコン（core の PDF・Word・Excel・外部リンク）を消す。外部リンクは core の指定と同じ条件をお知らせに絞って詳細度を上げる */
.news__list a.news__link::after,
.c-box-content .news__list a.news__link[href^="http"][target="_blank"]:not([href*=".pdf"]):not([href$=".doc"]):not([href$=".docx"]):not([href$=".xls"]):not([href$=".xlsx"])::after {
  content: none;
}

/* ② PDF の行：タイトルの末尾に PDF のアイコン（値は components.css の a[href*=".pdf"]::after と同じ） */
.news__list a.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: 6px;
  font-size: 1.1em;
  vertical-align: middle;
}

/* ③ 外部リンクの行：タイトルの末尾に別ウィンドウのアイコン（値は components.css の外部リンクと同じ。PHP が target を出すようになってから効く） */
.news__list a.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: 6px;
  font-size: 0.8em;
  vertical-align: middle;
}
