/* =====================================================
    共通項目
===================================================== */
/* --- ページトップ --- */
.news-top {
  width: 75vw;
  margin: 100px auto 2rem;
}

/* --- 見出し(共通) --- */
.news-top h2,
.news-index-top h2 {
  font-size: 45px;
  padding-bottom: .5rem;
  position: relative;
}

.news-top h2::after,
.news-index-top h2::after {
  content: "ニュース";
  font-size: 16px;
  color: rgb(200, 200, 200);
  position: absolute;
  bottom: 0;
  left: 0;
}

/* =====================================================
    News / Index レイアウト
===================================================== */
.news-index {
  width: 85vw;
  margin: 0 auto 3rem;
  display: flex;
  min-height: calc(100vh - 200px);
}

/* ---------- 左:カテゴリ+タグ ---------- */
.news-index .news-category-list {
  width: 25%;
  min-height: 300px;
}

.news-index .news-category-list ul {
  list-style: none;
  padding: 0;
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.news-index .news-category-list ul .news-index-top { margin-bottom: 2rem; }
.news-index .news-category-list ul .breadcrumb-nav { margin: 0 0 1rem .5rem; }

/* ---------- 右:News 一覧 ----------
   margin-top:207.5px は public + admin 両方に effective。admin index は
   `.admins-news-index__toolbar` がこの 207.5px gap 内に push-up される構造。 */
.news-index .news-contents {
  width: 75%;
  margin-top: 207.5px;
}

.news-index .news-contents .news-list {
  margin: 0;
  padding: 0;
}

.news-index .news-contents .news-list li {
  list-style: none;
  margin: 0 0 2rem 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgb(215, 215, 215);
  transition: opacity .2s;
}

.news-index .news-contents .news-list li:hover { opacity: .5; }

/* ---------- カテゴリピル ---------- */
.news-category-link {
  display: block;
  width: 10rem;
  margin-bottom: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 1.5rem;
  background: rgb(248, 248, 248);
  box-shadow: 3px 3px 2px rgb(227, 229, 234), -3px -3px 2px #fff;
  text-align: center;
  font-weight: 400;
  transition: transform .2s;
}

.news-category-link:hover { transform: scale(1.05); }

.news-category-link.is-active {
  background: rgb(50, 50, 50);
  color: rgb(248, 248, 248);
  pointer-events: none;
}

/* ---------- カテゴリセレクター(連盟タブと同じ幅) ---------- */
.news-category-selector-wrapper {
  width: 100%;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
}

.news-category-selector-wrapper .category-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  width: 10rem; /* 連盟タブと同じ幅 */
  padding: .5rem 2.25rem .5rem .85rem;
  border-radius: 1.25rem;
  border: 1.5px solid rgb(210, 210, 210);
  background: #fff;

  font-size: 13px;
  font-weight: 500;
  color: rgb(50, 50, 50);
  cursor: pointer;
  transition: all .2s;

  /* カスタム矢印アイコン */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgb(90,90,90)'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .6rem center;
  background-size: 1.1rem;
}

.news-category-selector-wrapper .category-select:hover {
  border-color: rgb(180, 180, 180);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .08);
}

.news-category-selector-wrapper .category-select:focus {
  outline: none;
  border-color: rgb(50, 50, 50);
  box-shadow: 0 0 0 3px rgba(50, 50, 50, 0.08);
}

/* ---------- タグ一覧 ---------- */
.tag-options {
  width: 10rem;
  margin: -.5rem 0 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .3rem;
}

.news-tag-link {
  width: 8rem;
  padding: .2rem 1rem;
  border-radius: 1rem;
  font-size: 10px;
  background: rgb(245, 245, 245);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .15), -2px -2px 0 rgba(255, 255, 255, .9);
  font-weight: 700;
  color: rgb(90, 90, 90);
  text-align: left;
  transition: transform .2s;
}

.news-tag-link:hover { transform: scale(1.05); }

.news-tag-link.is-active {
  background: rgb(50, 50, 50);
  color: rgb(248, 248, 248);
  box-shadow: none;
  pointer-events: none;
}

/* =====================================================
    レスポンシブ
===================================================== */

/* ---------- タブレット以下 ---------- */
@media (max-width: 959px) {
  .news-index { width: 90vw; }

  .news-show {
    width: 90vw;
    margin: 150px auto 3rem;
    padding: 0;
  }
}

/* ---------- モバイル以下 ---------- */
@media (max-width: 519px) {
  .news-top { width: 90vw; }

  .news-top h2,
  .news-index-top h2 {
    font-size: 36px;
  }
  .news-top h2::after,
  .news-index-top h2::after { font-size: 14px; }

  .news-index {
    flex-direction: column;
    padding-top: 100px;
  }

  .news-index .news-category-list {
    width: 100%;
    position: relative;
    min-height: auto;
  }

  .news-index .news-category-list ul {
    width: 100%;
    position: static;
    flex-direction: column;
    align-items: flex-start;
  }

  .news-index .news-category-list ul .news-index-top {
    margin-bottom: 1rem;
    width: 100%;
  }

  /* モバイルでもカテゴリセレクターはシンプルに */
  .news-index .news-category-list ul .news-category-selector-wrapper {
    margin-bottom: 1rem;
  }

  .news-index .news-category-list ul .news-category-selector-wrapper .category-select {
    width: 100%;
    max-width: 100%;
    font-size: 12px;
    padding: .45rem 2rem .45rem .75rem;
  }

  .news-index .news-category-list .tag-scroll {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    padding: 1rem 0 .75rem;
    scrollbar-width: thin;
  }
  .news-index .news-category-list .tag-scroll::-webkit-scrollbar { height: 4px; }
  .news-index .news-category-list .tag-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, .25);
    border-radius: 2px;
  }

  .news-index .news-category-list .tag-scroll .news-tag-link {
    width: auto;
    min-width: 5.5rem;
    font-size: 8px;
    padding: .1rem .25rem;
    text-align: center;
  }

  .news-index .news-contents {
    width: 100%;
    margin-top: 2rem;
  }

  /* ===== モバイル:カテゴリ&タグ UI ===== */
  .news-category-s {
    display: block;
    font-size: 14px;
  }

  .news-category-s summary {
    width: 10rem;
    padding: .5rem 1.5rem;
    border-radius: 1.5rem;
    background: rgb(50, 50, 50);
    color: #f8f8f8;
    box-shadow: 3px 3px 2px rgb(227, 229, 234), -3px -3px 2px #fff;
    text-align: left;
    list-style: none;
    position: relative;
    cursor: pointer;
  }

  .news-category-s summary::-webkit-details-marker { display: none; }
  /* Heroicons solid chevron-down を SVG data-URI で背景画像化、
     pseudo-element として描画する。data-URI では parent `color` を継承
     できないため濃灰 (#374151) を直接指定。 */
  .news-category-s summary::after {
    content: "";
    display: block;
    width: 1rem;
    height: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23374151'%3E%3Cpath fill-rule='evenodd' d='M12.53 16.28a.75.75 0 0 1-1.06 0l-7.5-7.5a.75.75 0 0 1 1.06-1.06L12 14.69l6.97-6.97a.75.75 0 1 1 1.06 1.06l-7.5 7.5Z' clip-rule='evenodd' /%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    position: absolute;
    top: 50%; right: 1rem;
    transform: translateY(-50%);
  }

  .news-category-s .details-content {
    margin-top: .75rem;
    border-radius: .25rem;
    background: rgb(248, 248, 248);
    box-shadow: 3px 3px 1px rgb(227, 229, 234), -3px -3px 1px #fff;
  }

  .news-category-s .details-content li {
    padding: .5rem 1rem .5rem 1.5rem;
    position: relative;
    font-size: 14px;
  }

  .news-category-s .details-content li::after {
    content: '';
    position: absolute;
    bottom: 0; left: 1rem;
    width: 8rem;
    border-bottom: 1px solid rgb(215, 215, 215);
  }

  /* 最後の li は下線を消す */
  .news-category-s .details-content .news-category-s-bottom::after { border-bottom: none; }

  .news-category-s .details-content .selected-category {
    color: inherit;
  }

  .news-category-s .details-content .selected-category::before {
    content: '･';
    font-size: 24px;
    position: absolute;
    top: 50%; left: .5rem;
    transform: translateY(-50%);
  }

  /* ▼ 左サイドバーを非表示 ---------- */
  .news-category-list .news-category-l,
  .news-category-list .tag-options,
  .news-category-list ul .breadcrumb-wrapper { display: none; }

  .mobile-only       { display: block; }
  .news-breadcrumb-sp .breadcrumb-nav { margin: 0 0 0 0.25rem; }
}

/* ----- PC 専用(モバイル幅超)----- */
@media (min-width: 520px) {
  .news-category-s { display: none; }
  .mobile-only { display: none; }
  .news-breadcrumb-sp { display: none; }
}
