/*
Theme Name: Nippon-Bashi Headline
Theme URI: https://nippon-bashi.biz/
Author: Deciliter Factory
Description: NIPPON-BASHI SHOP HEADLINE 専用テーマ
Version: 1.0.0
License: All Rights Reserved
Text Domain: nbh
*/

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* ── Base ── */
:root {
  --color-open:    #2e7d32;
  --color-open-bg: #e8f5e9;
  --color-pre:     #558b2f;
  --color-pre-bg:  #f1f8e9;
  --color-close:   #c0392b;
  --color-close-bg:#fce4e4;
  --color-move:    #1565c0;
  --color-move-bg: #e3f2fd;
  --color-renewal: #4527a0;
  --color-renewal-bg: #ede7f6;
  --color-gray:    #666;
  --color-gray-bg: #f0f0f0;
  --border: 0.5px solid #e0e0e0;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
               "Hiragino Sans", Meiryo, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: #222;
  background: #f5f5f3;
}

/* ── Masthead ── */
.nbh-masthead {
  background: #fff;
  border-bottom: 2.5px solid #222;
  padding: 0 16px;
}
.nbh-masthead__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0 4px;
  border-bottom: var(--border);
  font-size: 11px;
  color: #888;
}
.nbh-masthead__tagline { font-style: italic; }
.nbh-masthead__title {
  text-align: center;
  padding: 10px 0 6px;
  border-bottom: var(--border);
}
.nbh-masthead__title-en {
  font-size: clamp(18px, 4vw, 26px);
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1;
}
.nbh-masthead__title-ja {
  font-size: 11px;
  color: #888;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

/* ── Nav ── */
.nbh-nav {
  display: flex;
  justify-content: center;
  padding: 6px 0 0;
  flex-wrap: wrap;
}
.nbh-nav__item { position: relative; }
.nbh-nav__item > a,
.nbh-nav__item > span {
  display: block;
  font-size: 12px;
  color: #888;
  padding: 4px 12px;
  border-right: var(--border);
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.6;
}
.nbh-nav__item:first-child > a,
.nbh-nav__item:first-child > span { border-left: var(--border); }
.nbh-nav__item > a:hover,
.nbh-nav__item > span:hover,
.nbh-nav__item:hover > span { color: #222; }
.nbh-nav__item--current > a { color: #222; font-weight: 500; }

.nbh-nav__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 0.5px solid #ccc;
  border-radius: var(--radius-md);
  min-width: 200px;
  z-index: 100;
  padding: 4px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.nbh-nav__item:hover .nbh-nav__dropdown { display: block; }
.nbh-nav__dropdown a {
  display: block;
  padding: 8px 16px;
  font-size: 12px;
  color: #666;
}
.nbh-nav__dropdown a:hover { background: #f5f5f5; color: #222; }

/* ── Ticker ── */
.nbh-ticker {
  background: #222;
  display: flex;
  align-items: center;
  height: 28px;
  overflow: hidden;
}
.nbh-ticker__label {
  background: #c0392b;
  color: #fff;
  padding: 0 10px;
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
}
.nbh-ticker__track {
  padding: 0 12px;
  font-size: 12px;
  color: rgba(255,255,255,0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Layout ── */
.nbh-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 16px;
}
.nbh-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 680px) {
  .nbh-layout { grid-template-columns: 1fr; }
}

/* ── Section label ── */
.nbh-section-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: #888;
  border-bottom: 2px solid #222;
  padding-bottom: 4px;
  margin-bottom: 14px;
}

/* ── Category badge ── */
.nbh-cat {
  display: inline-block;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 2px;
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.6;
}
.nbh-cat--open    { background: var(--color-open-bg);    color: var(--color-open); }
.nbh-cat--pre     { background: var(--color-pre-bg);     color: var(--color-pre); }
.nbh-cat--close   { background: var(--color-close-bg);   color: var(--color-close); }
.nbh-cat--move    { background: var(--color-move-bg);    color: var(--color-move); }
.nbh-cat--renewal { background: var(--color-renewal-bg); color: var(--color-renewal); }
.nbh-cat--gray    { background: var(--color-gray-bg);    color: var(--color-gray); }

/* ── Hero article ── */
.nbh-hero {
  background: #fff;
  border: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 14px;
}
.nbh-hero__thumb {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
}
.nbh-hero__body { padding: 16px; }
.nbh-hero__title {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.5;
  margin: 6px 0 8px;
  color: #222;
}
.nbh-hero__title a:hover { text-decoration: underline; }
.nbh-hero__meta { font-size: 11px; color: #999; }

/* ── Article list ── */
.nbh-article-list {
  background: #fff;
  border: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.nbh-article-item {
  display: grid;
  grid-template-columns: 1fr 80px;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: var(--border);
  transition: background 0.1s;
}
.nbh-article-item:last-child { border-bottom: none; }
.nbh-article-item:hover { background: #fafaf8; }
.nbh-article-item__headline {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: #222;
  margin: 4px 0 3px;
}
.nbh-article-item__headline a:hover { text-decoration: underline; }
.nbh-article-item__meta { font-size: 11px; color: #999; }
.nbh-article-item__thumb {
  width: 80px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.nbh-article-item__thumb-placeholder {
  width: 80px;
  height: 56px;
  background: #f0f0f0;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

/* ── Legend ── */
.nbh-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

/* ── Pagination ── */
.nbh-pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 8px 0 24px;
}
.nbh-pagination a,
.nbh-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  background: #fff;
  border: var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #666;
}
.nbh-pagination a:hover { background: #f5f5f5; color: #222; }
.nbh-pagination .current { background: #222; color: #fff; border-color: #222; }

/* ── Sidebar ── */
.nbh-sidebar-widget {
  background: #fff;
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 16px;
}
.nbh-sidebar-widget .nbh-section-label { margin-bottom: 10px; }

/* ウィジェット内の汎用 ul/li（プラグイン出力など）を統一 */
.nbh-sidebar-widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.nbh-sidebar-widget ul li {
  padding: 7px 0;
  border-bottom: var(--border);
  font-size: 13px;
  line-height: 1.5;
  color: #222;
  padding-left: 0;
}
.nbh-sidebar-widget ul li::before {
  content: none !important;
}
.nbh-sidebar-widget ul li:last-child { border-bottom: none; }
.nbh-sidebar-widget ul li a {
  color: #222;
  display: block;
}
.nbh-sidebar-widget ul li a:hover { text-decoration: underline; }

/* WebberZone Top 10 プラグイン専用上書き */
.tptn_list,
.tptn_list_daily {
  list-style: none !important;
  padding-left: 0 !important;
  margin-left: 0 !important;
}
.tptn_list .tptn_list_item,
.tptn_list_daily .tptn_list_item {
  list-style: none !important;
  padding-left: 0 !important;
  margin-left: 0 !important;
}
.tptn_list .tptn_list_item::before,
.tptn_list_daily .tptn_list_item::before,
.tptn_list .tptn_list_item::marker,
.tptn_list_daily .tptn_list_item::marker {
  content: none !important;
  display: none !important;
}

.nbh-category-list { list-style: none; }
.nbh-category-list li {
  padding: 6px 0;
  border-bottom: var(--border);
}
.nbh-category-list li:last-child { border-bottom: none; }
.nbh-category-list a { color: #222; }
.nbh-category-list a:hover { text-decoration: underline; }

/* ── Single post ── */
.nbh-single {
  background: #fff;
  border: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.nbh-single__thumb {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
}
.nbh-single__body { padding: 20px; }
.nbh-single__title {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.5;
  margin: 8px 0 12px;
}
.nbh-single__meta { font-size: 12px; color: #999; margin-bottom: 20px; }
.nbh-single__content { font-size: 15px; line-height: 1.8; color: #333; }
.nbh-single__content p { margin-bottom: 1em; }
.nbh-single__content h2 { font-size: 18px; font-weight: 500; margin: 1.5em 0 0.5em; }
.nbh-single__content h3 { font-size: 16px; font-weight: 500; margin: 1.2em 0 0.4em; }
.nbh-single__content img { border-radius: var(--radius-md); margin: 1em 0; }
.nbh-single__content a { color: #1565c0; text-decoration: underline; }

/* ── Post navigation ── */
.nbh-post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}
.nbh-post-nav__item {
  background: #fff;
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  font-size: 13px;
}
.nbh-post-nav__item:hover { background: #fafaf8; }
.nbh-post-nav__label { font-size: 10px; color: #999; margin-bottom: 4px; }
.nbh-post-nav__title { font-weight: 500; color: #222; line-height: 1.4; }

/* ── Footer ── */
.nbh-footer {
  border-top: 2px solid #222;
  background: #fff;
}
.nbh-footer__inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 16px 20px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
}
@media (max-width: 680px) {
  .nbh-footer__inner { grid-template-columns: 1fr; gap: 20px; }
}
.nbh-footer__heading {
  font-size: 13px;
  font-weight: 500;
  color: #222;
  border-bottom: 1.5px solid #222;
  padding-bottom: 6px;
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}
.nbh-footer__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.nbh-footer__list li {
  padding: 5px 0;
  border-bottom: var(--border);
  font-size: 13px;
}
.nbh-footer__list li:last-child { border-bottom: none; }
.nbh-footer__list a { color: #444; }
.nbh-footer__list a:hover { text-decoration: underline; color: #222; }
.nbh-footer__select {
  width: 100%;
  padding: 6px 8px;
  font-size: 13px;
  border: var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: #222;
  cursor: pointer;
}
.nbh-footer__bottom {
  border-top: var(--border);
  padding: 14px 16px;
  text-align: center;
  font-size: 11px;
  color: #999;
}

/* ── Archive header ── */
.nbh-archive-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.nbh-archive-header__title { font-size: 16px; font-weight: 500; color: #222; }

/* ── 人気記事リスト（自前実装） ── */
.nbh-popular-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
.nbh-popular-list__item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0;
  border-bottom: var(--border);
  font-size: 13px;
  line-height: 1.5;
}
.nbh-popular-list__item:last-child { border-bottom: none; }
.nbh-popular-list__rank {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background: #222;
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  line-height: 1;
}
.nbh-popular-list__item:nth-child(1) .nbh-popular-list__rank { background: #c0392b; }
.nbh-popular-list__item:nth-child(2) .nbh-popular-list__rank { background: #7f8c8d; }
.nbh-popular-list__item:nth-child(3) .nbh-popular-list__rank { background: #a0522d; }
.nbh-popular-list__item a { color: #222; }
.nbh-popular-list__item a:hover { text-decoration: underline; }

/* ── シェアボタン ── */
.nbh-share {
  margin-top: 24px;
  padding-top: 20px;
  border-top: var(--border);
}
.nbh-share__label {
  font-size: 11px;
  color: #999;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.nbh-share__buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.nbh-share__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.nbh-share__btn:hover { opacity: 0.82; }
.nbh-share__btn--x         { background: #000; color: #fff; }
.nbh-share__btn--line      { background: #06c755; color: #fff; }
.nbh-share__btn--bsky      { background: #0085ff; color: #fff; }

/* ── サイドバー SNSリンク ── */
.nbh-sns-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nbh-sns-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  transition: opacity 0.15s;
}
.nbh-sns-link:hover { opacity: 0.82; }
.nbh-sns-link--x         { background: #000; color: #fff; }
.nbh-sns-link--instagram {
  background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: #fff;
}
.nbh-sns-link__icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.nbh-sns-link__body {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nbh-sns-link__name { font-size: 13px; font-weight: 500; }

/* ══════════════════════════════════
   スマホ対応
   ══════════════════════════════════ */

/* ── ハンバーガーボタン（PCでは非表示） ── */
.nbh-nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  line-height: 1;
}
.nbh-nav-toggle__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: #444;
  margin: 5px 0;
  transition: transform 0.2s, opacity 0.2s;
}
/* 開いているときの × 変形 */
.nbh-nav-toggle[aria-expanded="true"] .nbh-nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nbh-nav-toggle[aria-expanded="true"] .nbh-nav-toggle__bar:nth-child(2) {
  opacity: 0;
}
.nbh-nav-toggle[aria-expanded="true"] .nbh-nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── モバイルドロワー（PCでは非表示） ── */
.nbh-nav-drawer {
  display: none; /* JS で open クラスを付けて制御 */
}

@media (max-width: 680px) {

  /* masthead上部：タグラインを隠してスッキリ */
  .nbh-masthead__tagline { display: none; }
  .nbh-masthead { position: relative; }

  /* PCナビを非表示 */
  .nbh-nav { display: none; }

  /* ハンバーガーボタンを表示 */
  .nbh-nav-toggle { display: block; }

  /* ドロワー本体 */
  .nbh-nav-drawer {
    background: #fff;
    border-top: var(--border);
    padding: 8px 0 12px;
  }
  .nbh-nav-drawer.is-open { display: block; }

  .nbh-nav-drawer a {
    display: block;
    font-size: 14px;
    color: #444;
    padding: 11px 20px;
    border-bottom: var(--border);
  }
  .nbh-nav-drawer a:last-child { border-bottom: none; }
  .nbh-nav-drawer a:hover,
  .nbh-nav-drawer a:active { background: #f5f5f3; color: #222; }
  .nbh-nav-drawer .nbh-nav-drawer__current { color: #222; font-weight: 500; }

  .nbh-nav-drawer__separator {
    font-size: 10px;
    color: #bbb;
    letter-spacing: 0.08em;
    padding: 10px 20px 4px;
  }

  /* コンテナ余白を狭く */
  .nbh-container { padding: 12px; }

  /* 2カラム → 1カラム（既存のメディアクエリと統合） */
  .nbh-layout { grid-template-columns: 1fr; }

  /* サイドバーはメインの後ろに（モバイルでは下に流れる） */

  /* ヒーロータイトルを少し小さく */
  .nbh-hero__title { font-size: 16px; }

  /* 記事アイテムのサムネイル小さく */
  .nbh-article-item__thumb,
  .nbh-article-item__thumb-placeholder {
    width: 64px;
    height: 44px;
  }

  /* 記事見出しサイズ調整 */
  .nbh-article-item__headline { font-size: 13px; }

  /* 前後ナビを縦積みに */
  .nbh-post-nav { grid-template-columns: 1fr; }

  /* 記事本文のパディングを狭く */
  .nbh-single__body { padding: 14px; }
  .nbh-single__title { font-size: 18px; }

  /* ページネーションのボタンを少し小さく */
  .nbh-pagination a,
  .nbh-pagination span {
    min-width: 32px;
    height: 32px;
    font-size: 12px;
  }
}
