/* =========================================
   style.css (ハンバーガーメニュー対応版)
   ========================================= */
:root {
  --bg-body: #050505;
  --bg-card: #111111;
  --bg-search: #1a1a1a;
  --text-main: #e0e0e0;
  --text-muted: #aaaaaa;
  --accent-color: #00d1ff;
  --border-color: #333333;
  --font-base: "Helvetica Neue", Arial, sans-serif;
}

/* 1. 基本設定 */
body, main {
  background-color: var(--bg-body) !important;
  color: var(--text-main) !important;
  font-family: var(--font-base);
  margin: 0;
}
a { color: var(--text-main); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--accent-color) !important; }

/* 2. ヘッダー設定 */
header {
  background-color: rgba(0, 0, 0, 0.95) !important;
  border-bottom: 1px solid var(--border-color);
  padding: 10px 0;
  position: sticky; top: 0; z-index: 1000;
}
.header-container {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1100px; margin: 0 auto; padding: 0 20px;
  position: relative;
}
.logo strong { color: #fff !important; font-size: 1.4rem; z-index: 1001; position: relative; }

/* 3. ナビゲーション & メニュー (PC用) */
.nav-wrapper {
  display: flex; align-items: center; gap: 20px;
}
.menu {
  display: flex; gap: 20px; list-style: none; margin: 0; padding: 0;
}
.menu li a { color: #fff !important; font-weight: bold; font-size: 0.95rem; }

/* 4. 検索ボックス */
.search-container { position: relative; width: 250px; }
#search-query {
  width: 100%; padding: 8px 15px; border-radius: 50px;
  background: var(--bg-search); color: #fff; border: 1px solid #444;
  outline: none;
}
#search-results {
  position: absolute; top: 110%; right: 0; left: auto; width: 300px;
  background: var(--bg-card); border: 1px solid #333;
  z-index: 999; max-height: 400px; overflow-y: auto;
}
.search-link { display: block; padding: 10px; color: #fff; border-bottom: 1px solid #222; }
.search-link:hover { background: #222; }

/* 5. ハンバーガーボタン (PCでは非表示) */
.hamburger-btn {
  display: none; /* デフォルト非表示 */
  cursor: pointer; z-index: 1001; width: 30px; height: 24px; position: relative;
}
.hamburger-btn .bar {
  display: block; width: 100%; height: 2px;
  background-color: #fff; position: absolute; left: 0; transition: 0.3s;
}
.hamburger-btn .bar:nth-child(1) { top: 0; }
.hamburger-btn .bar:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger-btn .bar:nth-child(3) { bottom: 0; }

/* ▼▼▼ スマホ対応 (画面幅 768px以下) ▼▼▼ */
@media (max-width: 768px) {
  /* ハンバーガーボタンを表示 */
  .hamburger-btn { display: block; }

  /* メニュー本体を隠す */
  .nav-wrapper {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    flex-direction: column; justify-content: center;
    transform: translateY(-100%); /* 上に隠しておく */
    transition: transform 0.3s ease;
    opacity: 0;
  }
  
  /* activeクラスがついたら表示 */
  .nav-wrapper.active {
    transform: translateY(0);
    opacity: 1;
  }

  .menu { flex-direction: column; text-align: center; gap: 30px; margin-bottom: 30px; }
  .menu li a { font-size: 1.2rem; }
  .search-container { width: 80%; }
  
  /* ボタンのアニメーション (×印になる) */
  .hamburger-btn.active .bar:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
  .hamburger-btn.active .bar:nth-child(2) { opacity: 0; }
  .hamburger-btn.active .bar:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }
}

/* 6. カード型記事リスト */
.article-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px; max-width: 1100px; margin: 0 auto;
}
/* 「.article-list」の中にある article だけにスタイルを適用するように限定します */
.article-list article {
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s;
  display: flex;
  flex-direction: column;
}

.article-list article:hover {
  transform: translateY(-5px);
  border-color: var(--accent-color);
}

.article-list article h3 {
  color: #ffffff !important;
  margin: 0 0 10px 0;
  font-size: 1.1rem;
  line-height: 1.4;
}

.article-list article .summary {
  color: #cccccc !important;
  font-size: 0.9rem;
  margin-bottom: 15px;
  flex-grow: 1;
}

/* リンク集などの通常ページ用の調整 */
main {
    padding: 20px; /* 画面端にくっつかないように余白追加 */
}
main h2, main h3 {
    color: var(--accent-color) !important; /* 見出しをアクセントカラーに */
    margin-top: 30px;
}
main ul {
    margin-bottom: 20px;
}
main li {
    margin-bottom: 10px;
    color: var(--text-main);
}
main li a {
    text-decoration: underline; /* リンクだとわかるように下線を引く */
    color: var(--accent-color);
}
.read-more { font-size: 0.8rem; color: var(--accent-color) !important; margin-top: auto; }

/* 7. アコーディオンメニュー */
.tax-acc { max-width: 1100px; margin: 0 auto 30px; }
.tax-block {
  background: var(--bg-card); border: 1px solid #333;
  border-radius: 8px; padding: 10px; margin-bottom: 15px;
}
.tax-block summary {
  color: #fff !important; cursor: pointer; font-weight: bold;
  display: flex; justify-content: space-between; outline: none;
}
.tax-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; padding: 0; list-style: none; }
.tax-list li a {
  display: block; padding: 6px 12px; border-radius: 20px;
  background: rgba(255,255,255,0.1); color: #fff !important;
  border: 1px solid #444; font-size: 0.85rem;
}
.tax-list li a:hover { background: var(--accent-color); color: #000 !important; }

/* 8. Anankeリセット */
.bg-white, .bg-near-white, .bg-light-gray { background: transparent !important; }
.black, .near-black, .dark-gray, .gray { color: #fff !important; }

/* 9. YouTubeレスポンシブ対応 */
.iframe-wrapper { position: relative; width: 100%; margin-bottom: 20px; }
.iframe-wrapper iframe { width: 100% !important; height: auto !important; aspect-ratio: 16 / 9; border: none; }
article img, .iframe-wrapper img { max-width: 100%; height: auto; display: block; margin: 10px auto; }
.kiji_mokuji { max-width: 100%; box-sizing: border-box; overflow-wrap: break-word; }

.related {
  margin-top: 2rem;
  padding: 1rem;
  border: 1px solid #eee;
  border-radius: 10px;
}
.related ul { margin: 0; padding-left: 1.2rem; }
.related li { margin: .4rem 0; }
.related-date { margin-left: .5rem; opacity: .6; }

/* ===== Breadcrumb fix (force) ===== */
.breadcrumb ol,
.breadcrumb ul {
  list-style: none !important;
  padding-left: 0 !important;
  margin: 0 !important;
}

.breadcrumb-list {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0 !important;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
}

.breadcrumb-item::marker {
  content: none !important; /* ← ananke対策 */
}

.breadcrumb-sep {
  margin: 0 0.4rem;
  opacity: 0.6;
  user-select: none;
}

.breadcrumb-current {
  font-weight: 600;
}

.post-meta {
  margin: 0.5rem 0 1rem;
  font-size: 0.95rem;
  opacity: 0.85;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.post-meta-item time {
  font-variant-numeric: tabular-nums;
}

.post-meta-sep {
  opacity: 0.6;
}

/* =========================================================
   Ranking card block (scoped + stronger specificity)
   対象: article内の .main-wrapper > .ranking-card-container 以下だけ
   ========================================================= */

/* main-wrapper がテーマで特殊なdisplay/幅になってても、このブロック内は素直に戻す */
article .nested-copy-line-height .main-wrapper{
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 20px 0 !important;
}

/* コンテナを必ずグリッドに */
article .nested-copy-line-height .main-wrapper .ranking-card-container{
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
  gap: 20px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  align-items: stretch !important;
}

/* カード */
article .nested-copy-line-height .main-wrapper .ranking-card{
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;

  border: 1px solid #ddd !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  background: #fff !important;
  min-width: 0 !important;
}

/* 順位バッジ */
article .nested-copy-line-height .main-wrapper .ranking-card-rank{
  position: absolute !important;
  top: 10px !important;
  left: 10px !important;
  z-index: 3 !important;

  background: #ff9900 !important;
  color: #fff !important;
  padding: 3px 10px !important;
  border-radius: 6px !important;
  font-weight: 700 !important;
}

/* 画像 */
article .nested-copy-line-height .main-wrapper .ranking-card-image{
  height: 200px !important;
  padding: 14px !important;
  background: #f9f9f9 !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

article .nested-copy-line-height .main-wrapper .ranking-card-image a{
  display: flex !important;
  width: 100% !important;
  height: 100% !important;
  align-items: center !important;
  justify-content: center !important;
}

article .nested-copy-line-height .main-wrapper .ranking-card-image img{
  display: block !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

/* 本文 */
article .nested-copy-line-height .main-wrapper .ranking-card-content{
  padding: 15px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

/* タイトル（2行クランプ：webkit + 標準 line-clamp 併記） */
article .nested-copy-line-height .main-wrapper .ranking-card-title{
  margin: 0 !important;
  font-size: 0.95rem !important;
  line-height: 1.4 !important;

  overflow: hidden !important;
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important; /* WebKit */
  line-clamp: 2 !important;         /* Standard property for compatibility */

  min-height: 2.8em !important;
  word-break: break-word !important;
}

article .nested-copy-line-height .main-wrapper .ranking-card-title a{
  color: #333 !important;
  text-decoration: none !important;
}

/* 価格 */
article .nested-copy-line-height .main-wrapper .ranking-card-price{
  margin: 0 !important;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  color: #b12704 !important;
}

/* ボタン（必ずボタンっぽく表示＋下に張り付け） */
article .nested-copy-line-height .main-wrapper a.ranking-card-button{
  display: block !important;
  margin-top: auto !important;

  width: 100% !important;
  padding: 10px 8px !important;
  border-radius: 6px !important;
  background: #ff9900 !important;
  color: #fff !important;
  text-align: center !important;
  text-decoration: none !important;
  font-weight: 700 !important;

  visibility: visible !important;
  opacity: 1 !important;
}

article .nested-copy-line-height .main-wrapper a.ranking-card-button:visited{
  color: #fff !important;
}

/* hoverできる端末のみ */
@media (hover: hover) and (pointer: fine) {
  article .nested-copy-line-height .main-wrapper .ranking-card:hover{
    transform: translateY(-5px) !important;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12) !important;
  }
}
