/* ニュースページ専用 MV（スマホ用画像） */
.mv--news {
  background: url("https://medicine.cosmos-ok.com/wp-content/uploads/2025/09/mv_news_sp.jpg")
              center center / cover no-repeat;
}

/* ニュースページ専用 MV（PC用画像） */
@media (min-width: 700px) {
  .mv--news {
    background: url("https://medicine.cosmos-ok.com/wp-content/uploads/2025/09/mv_news_pc.jpg")
                center center / cover no-repeat;
  }
}



/* ========== お知らせ一覧（/news アーカイブ） ========== */

.archive-news__title{
  text-align: center;
  margin: 0 0 clamp(16px, 3vw, 24px);
  letter-spacing: .06em;
}

/* ページネーションの数字間隔調整 */
.archive-news .wp-block-query-pagination-numbers a,
.archive-news .wp-block-query-pagination-numbers span {
  margin: 0 6px;  /* 左右に6pxの余白を追加 */
}



/* 一覧ラッパー：上に一本線 → 行との間に余白 */
.archive-news__query{
  padding-top: 18px;
  padding-bottom: 22px;
}

/* 一覧（行レイアウト） */
.archive-news__list{
  display: flex;
  flex-direction: column;
}

/* 1行：下線のみ／等間隔 */
.archive-news__item{
  display: flex;
  align-items: center;
  gap: 16px;                  /* 日付 ⇄ カテゴリ ⇄ タイトル */
  padding: 5px 0;
  border-bottom: 1px solid rgba(0,0,0,.12);
}

/* 日付 */
.archive-news__date{
  min-width: 165px;           /* 例：2025/09/27 (土) */
  font-variant-numeric: tabular-nums;
  opacity: .9;
}

/* カテゴリ（pill） */
.archive-news__cat{
  display: flex;
  gap: 8px;
}
.archive-news__cat a{
  display: inline-block;
  background: #005caa;        /* 指定どおり */
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

/* タイトル（本文サイズ／右端▶︎） */
.archive-news__ttl{
  flex: 1;
}
.archive-news__ttl a{
  position: relative;
  display: block;
  color: inherit;
  text-decoration: none;
  padding-right: 18px;         /* ▶︎ぶん */
}
.archive-news__ttl a:hover{ text-decoration: underline; }
.archive-news__ttl a::after{
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  width: 8px; height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
  opacity: .8;
}

/* 見出しスタイルの上書き（Post Titleがh要素でも本文と同じ見た目に） */
.archive-news .wp-block-post-title.archive-news__ttl,
.archive-news .wp-block-post-title.archive-news__ttl a,
.archive-news .wp-block-post-title__link{
  font-family: var(--wp--preset--font-family--noto-sans-jp) !important;
  font-size: clamp(16px, 2vw, 16px) !important;
  font-weight: 400 !important;
  line-height: 1.7 !important;
  letter-spacing: normal !important;
}

/* ページネーション */
.archive-news .wp-block-query-pagination{
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-top: 20px;
}
.archive-news .wp-block-query-pagination .page-numbers{
  display: inline-flex;
  min-width: 36px; height: 36px;
  align-items: center; justify-content: center;
  padding: 0 10px;
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 6px;
  text-decoration: none;
}
.archive-news .wp-block-query-pagination .page-numbers.current{
  background: var(--wp--preset--gradient--blue-gradient, linear-gradient(135deg,#5bc0de 0%,#004aad 100%));
  color: #fff;
  border-color: transparent;
}
.archive-news .wp-block-query-pagination .page-numbers:hover{
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

/* ========== スマホ最適化（〜768px）：タイトルだけ2段目へ ========== */
@media (max-width: 768px){
	.archive-news__query{
  padding-top: 0px;
  padding-bottom: 10px;
}
  .archive-news__item{
    display: flex;
    flex-wrap: wrap;          /* 折り返しON */
    align-items: center;
    gap: 3px 11px;            /* 行間6px／列間12px */
  }
  /* 1行目：日付＋カテゴリ */
  .archive-news__date{
    min-width: auto;
    font-size: 14px;
    order: 1; flex: 0 0 auto;
  }
  .archive-news__cat{
    order: 2; flex: 0 0 auto;
  }
  .archive-news__cat a{
    font-size: 13px;
    padding: 4px 9px;
    border-radius: 4px;
  }
  /* 2行目：タイトル（全幅） */
  .archive-news__ttl{
    order: 3; flex: 0 0 100%;
    width: 100%;
  }
  .archive-news__ttl a{
    display: block;
    font-size: 15px;
    line-height: 1.6;
  }
}

/* ========== タブレット〜PC（≥769px）：列の揃えを安定化 ========== */
@media (min-width: 769px){
  .archive-news__item{
    gap: 20px;
    padding: 5px 0;
  }
  .archive-news__date{
    min-width: 160px;         /* 縦揃え用に固定幅 */
  }
}







/* NEWS 単一記事：本文の先頭要素だけ、上に余白を付ける */
body.single-news main > *:first-child{
  margin-top: clamp(16px, 3vw, 24px);
}

/* 念のため：タイトルブロックが最初に来る一般ケースを確実にケア */
body.single-news main > .wp-block-post-title:first-child{
  margin-top: clamp(16px, 3vw, 24px);
}

/* アンカーで見出しに飛んだ時もヘッダーに潜らないように */
body.single-news :where(h1,h2,h3,h4,h5,h6)[id]{
  scroll-margin-top: calc(var(--header-h-pc, 80px) + 12px);
}
@media (max-width: 767.98px){
  body.single-news :where(h1,h2,h3,h4,h5,h6)[id]{
    scroll-margin-top: calc(var(--header-h-sp, 60px) + 12px);
  }
}





/* ===== NEWS：カテゴリー切替タブ（アーカイブ/カテゴリ共通で強制適用） ===== */
.post-type-archive-news .news-category-tabs,
.tax-news_category .news-category-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: clamp(12px, 2.5vw, 24px) auto;
  padding: 0 5%;
  max-width: 1100px;
}

.post-type-archive-news .news-category-tabs .tab,
.tax-news_category .news-category-tabs .tab {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid #ccc;
  border-radius: 999px;
  text-decoration: none;
  color: #333;
  font-size: 14px;
  line-height: 1;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.post-type-archive-news .news-category-tabs .tab:hover,
.tax-news_category .news-category-tabs .tab:hover {
  background: #f0f0f0;
}

.post-type-archive-news .news-category-tabs .tab.active,
.tax-news_category .news-category-tabs .tab.active {
  background: linear-gradient(135deg, #5bc0de 0%, #004aad 100%);
  color: #fff;
  border-color: #004aad;
}
