/* ============================================================
 * sidebar.css — サイドバー / widget 共通コンポーネント（全ページ共通）
 *
 *   もとは top.css（TOP / tag のみ読込）と single.css（.single2 スコープ）に
 *   重複していた widget 系スタイルを一本化したもの。
 *   footer(SPメニュー)・記事ページ・その他どこに widget マークアップを置いても
 *   同じ見た目になるよう、functions.php で全ページ enqueue する。
 *
 *   ※ ここのセレクタはページ横断で効くため、値は top.css の該当箇所を正とする。
 *     TOP/tag の SP アコーディオン専用スタイル（.tb-cat__btn 等）は
 *     tag ページ固有のため top.css の @media(≤768px) 側に残す。
 * ============================================================ */

/* ─── プレースホルダ（サムネイル未設定時。カード/ランキング共通）─── */
.card-img-placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-size: 11px;
  color: rgba(255,255,255,.8);
  font-family: arial, sans-serif;
  letter-spacing: .1em;
}
.card-img-placeholder[data-ph="trip"]    { background: repeating-linear-gradient(135deg, rgba(255,255,255,.08) 0 2px, transparent 2px 12px), linear-gradient(135deg,#7a9a6e,#4e6a48);}
.card-img-placeholder[data-ph="recipe"]  { background: repeating-linear-gradient(135deg, rgba(255,255,255,.08) 0 2px, transparent 2px 12px), linear-gradient(135deg,#e84e7f,#c93c6b);}
.card-img-placeholder[data-ph="gourmet"] { background: repeating-linear-gradient(135deg, rgba(255,255,255,.08) 0 2px, transparent 2px 12px), linear-gradient(135deg,#c25a4f,#8b3a31);}
.card-img-placeholder[data-ph="kurashi"] { background: repeating-linear-gradient(135deg, rgba(255,255,255,.08) 0 2px, transparent 2px 12px), linear-gradient(135deg,#6b8aa8,#3f5770);}
.card-img-placeholder[data-ph="ticket"]  { background: repeating-linear-gradient(135deg, rgba(255,255,255,.08) 0 2px, transparent 2px 12px), linear-gradient(135deg,#b85c8e,#7e3c60);}
.card-img-placeholder[data-ph="entame"]  { background: repeating-linear-gradient(135deg, rgba(255,255,255,.08) 0 2px, transparent 2px 12px), linear-gradient(135deg,#d9944b,#9c6527);}

/* ─── SIDEBAR ─── */
/* タイポグラフィ基準を widget 側で固定する。top.css は body に
   arial / 15px / 1.75 を敷くが、top.css を読まないページ（記事等）では
   common.css の body（Noto Sans JP / line-height:1）を継承してしまい、
   font-family / line-height 未指定の要素（.cat-link, .tb-chip 等）の
   見た目がページによって変わるため、ここで同値を明示する。 */
.sidebar {
  display: flex; flex-direction: column; gap: 28px;
  font-family: arial, sans-serif;
  font-size: 15px;
  line-height: 1.75;
}

/* ウィジェットのカード枠。クラス名 .widget は WordPress コア（dynamic_sidebar の
   デフォルト before_widget = <li class="widget">）と衝突し、/ranking/ 等の WP
   ウィジェットに漏れるため、テーマ専用に名前空間化した .yf-widget を使う。
   種類別に出し分けたいときは .yf-widget.is-xxx のように修飾子を足す。 */
.yf-widget {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}

.widget-header {
  padding: 14px 18px;
  font-family: arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-dark);
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--line);
  letter-spacing: .06em;
}
.widget-header::before {
  content: '';
  width: 3px; height: 16px;
  background: var(--brand-pink);
  border-radius: 2px;
}
.widget-header .tag-link {
  /* flex の余白を左マージンで食わせて右端へ寄せる（padding で押し出すより堅牢）。
     親 .widget-header は align-items:center なので縦位置は自動で中央。 */
  margin-left: auto;
  font-size: 12px;
  font-weight: 400;
}
.widget-header a:hover {
  color: var(--brand-pink);
}

.widget-body { padding: 16px 18px; }

/* Category links */
.cat-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cat-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  color: #fff !important;
  transition: transform .2s, filter .2s;
  cursor: pointer;
  letter-spacing: .04em;
}
.cat-link:hover { transform: translateX(2px); filter: brightness(1.08); }

/* Popular articles */
.popular-list { list-style: none; display: flex; flex-direction: column; }

.popular-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: opacity .2s;
}
.popular-item:last-child { border-bottom: none; }
.popular-item:first-child { padding-top: 4px; }
.popular-item:hover .popular-title { color: var(--brand-pink); }

.popular-rank {
  font-family: arial, sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--cream-300);
  min-width: 24px;
  line-height: 1;
  padding-top: 2px;
  font-style: italic;
}

.popular-rank.gold   { color: var(--brand-pink); }
.popular-rank.silver { color: var(--brand-mid); }
/* bronze は「銅色」の装飾。旧 --cat-entame(#d9944b アンバー) を借用していたが、
   entame の色替え(プラム)に追従すると銅メダル感が崩れるため旧アンバーを固定。 */
.popular-rank.bronze { color: #d9944b; }

.popular-img {
  width: 96px;            /* 親 flex 内での明示幅 */
  aspect-ratio: 16/9;     /* → 高さは 54px に自動算出 */
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  overflow: hidden;
}
.popular-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  object-position: center;
}
.popular-img .card-img-placeholder { font-size: 0; }

.popular-title {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .2s;
}
/* a:link/a:hover (common.css, 0,0,1,1) を上回るため a.popular-item__more:link/:visited (0,0,2,1) で明示 */
.popular-item__more,
a.popular-item__more:link,
a.popular-item__more:visited {
  border-radius: 999px;
  padding: 9px 22px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .25s;
  letter-spacing: .1em;
  display: block;
  width: fit-content;
  margin: 10px auto 0;
  background: #3b2e2b;
  color: #fff;
  text-align: center;
}
.popular-item__more:hover,
a.popular-item__more:hover {
  background: var(--brand-pink);
  color: #fff;
}

/* Fortune widget */
.fortune-widget {
  background: linear-gradient(155deg, var(--brand-dark) 0%, #3b2e2b 100%);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--cream-100);
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: transform .25s;
  position: relative;
}
.fortune-widget::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg, rgba(232,78,127,.12) 0 1px, transparent 1px 12px);
}
.fortune-widget > * { position: relative; }
.fortune-widget:hover { transform: translateY(-2px); }

.fw-kicker { font-size: 10px; color: var(--brand-pink); letter-spacing: .3em; margin-bottom: 8px; font-weight: 700; }
.fw-title  { font-family: arial, sans-serif; font-size: 18px; font-weight: 700; margin-bottom: 6px; color: #fff; letter-spacing: .04em;}
.fw-sub    { font-size: 11px; color: rgba(236,234,218,.75); margin-bottom: 16px; letter-spacing: .06em; }
.fw-btn {
  background: transparent;
  border: 1px solid var(--cream-100);
  border-radius: 999px;
  padding: 9px 22px;
  font-size: 12px;
  font-weight: 500;
  color: var(--cream-100);
  cursor: pointer;
  transition: all .25s;
  letter-spacing: .1em;
}
.fw-btn:hover { background: var(--brand-pink); border-color: var(--brand-pink); color: #fff; }

/* Newsletter widget */
.newsletter-widget {
  background: var(--brand-cream);
  border-radius: var(--radius);
  padding: 22px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.newsletter-widget::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  background: var(--brand-pink);
  border-radius: 50%;
  opacity: .14;
}
.nw-kicker { font-size: 10px; color: var(--brand-pink); letter-spacing: .3em; margin-bottom: 6px; font-weight: 700; }
.nw-title { font-family: arial, sans-serif; font-weight: 700; font-size: 17px; margin-bottom: 6px; color: var(--brand-dark); letter-spacing: .04em; }
.nw-sub { font-size: 11px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.7; }
.nw-btn {
  background: var(--brand-dark);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 11px 22px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  transition: background .25s;
  letter-spacing: .1em;
}
.nw-btn:hover { background: var(--brand-pink); }

/* Banner widget */
/* a:link (0,0,1,1) を上回るため a.banner-widget:link/:visited (0,0,2,1) で明示 */
.banner-widget,
a.banner-widget:link,
a.banner-widget:visited {
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .25s;
  background: var(--brand-pink);
  color: #fff;
  padding: 22px 20px;
  text-align: center;
  position: relative;
}
.banner-widget::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.07) 0 1px, transparent 1px 10px);
}
.banner-widget > * { position: relative; }
.banner-widget:hover { transform: translateY(-2px); }
.banner-widget .bw-kicker { font-size: 10px; letter-spacing: .3em; margin-bottom: 8px; opacity: .85; font-weight: 700; }
.banner-widget .bw-title { font-family: arial, sans-serif; font-weight: 700; font-size: 16px; margin-bottom: 4px; letter-spacing: .04em; }
.banner-widget .bw-sub { font-size: 11px; opacity: .9; }

/* ─── 背景画像オプション（任意・未設定時は従来背景のまま）─── */
.fortune-widget.has-img,
.banner-widget.has-img,
a.banner-widget.has-img:link,
a.banner-widget.has-img:visited {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.fortune-widget.has-img {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  display: flex;
  flex-direction: column;
}
/* 画像カードでは「占いを見る →」ボタンを下端・中央へ */
.fortune-widget.has-img .fw-btn {
  align-self: center;
  margin-top: auto;
}
.banner-widget.has-img {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
}
/* 画像時は ::before を文字可読用の暗めオーバーレイに差し替え（ストライプ無効）*/
.fortune-widget.has-img::before,
.banner-widget.has-img::before {
  background: linear-gradient(180deg, rgba(40,30,28,.35) 0%, rgba(40,30,28,.72) 100%);
}

/* ─── TAG BROWSER（サイドバー内・PC 構造。SP アコーディオンは top.css 側）─── */
.tag-browser__body { padding: 12px 16px 18px; max-height: 520px; overflow-y: auto; }
.tag-browser__body::-webkit-scrollbar { width: 6px; }
.tag-browser__body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

.tb-cat { padding: 14px 0; border-bottom: 1px dashed var(--line); }
.tb-cat:last-child { border-bottom: none; }
.tb-cat:first-child { padding-top: 6px; }

.tb-cat__title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700;
  color: var(--brand-dark);
  letter-spacing: .04em;
  margin-bottom: 10px;
}
.tb-cat__dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.tb-cat__flag {
  font-size: 10px;
  font-weight: 700;
  background: var(--pink-soft);
  color: var(--brand-pink);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: .04em;
  margin-left: 2px;
}

.tb-group { margin-bottom: 10px; }
.tb-group:last-child { margin-bottom: 0; }
.tb-group__label {
  font-size: 10px;
  color: var(--brand-mid);
  letter-spacing: .06em;
  margin-bottom: 6px;
  font-weight: 500;
}
.tb-chips { display: flex; flex-wrap: wrap; gap: 5px; }
/* a:link (0,0,1,1) を上回るため a.foo:link/:visited (0,0,2,1) で明示。
   span にも同じピル形状を共有させるため span.tb-chip もまとめて指定。 */
a.tb-chip,
a.tb-chip:link,
a.tb-chip:visited,
span.tb-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--brand-dark);
  background: #fff;
  border: 1px solid var(--line);
  transition: transform .15s, filter .15s;
  cursor: pointer;
  letter-spacing: .02em;
  text-decoration: none;
}
a.tb-chip:hover { transform: translateY(-1px); filter: brightness(.97); }
a.tb-chip--trip:link,    a.tb-chip--trip:visited,    span.tb-chip--trip    { background: #eaf3fb; border-color: #c7dbed; color: #3d5f7e; }
a.tb-chip--scene:link,   a.tb-chip--scene:visited,   span.tb-chip--scene   { background: #edf6e9; border-color: #c9e0c0; color: #4a6a3f; }
a.tb-chip--feature:link, a.tb-chip--feature:visited, span.tb-chip--feature { background: #fbf1dc; border-color: #ecd9af; color: #7e5e2a; }
a.tb-chip--food:link,    a.tb-chip--food:visited,    span.tb-chip--food    { background: #fbe6e6; border-color: #edc2c2; color: #8f3f3f; }
a.tb-chip--price:link,   a.tb-chip--price:visited,   span.tb-chip--price   { background: #f2efe5; border-color: #ddd5c1; color: #6b5f4a; }

@media screen and (max-width: 768px) {
  .popular-title {
    font-size: 14px;
  }
  .popular-item__more, a.popular-item__more:link, a.popular-item__more:visited {
    margin: 0 auto 0;
  }
}