/* =========================================================================
   tb-page-unify.css — Phase 5 / サブページ・記事ページのみ統一CSS
   トップページ（body.tb-root）には影響させない。
   ロード順は最終（既存 style.css / article-v2.css の overlay も超える）。
   ========================================================================= */

/* Scope tokens (re-declare to be self-contained) */
:root {
  --tb-ink:         #0f0e0c;
  --tb-ink-dark:    #14110d;
  --tb-ink-2:       #1c1a17;
  --tb-charcoal:    #2a2520;
  --tb-body-text:   #3a342d;
  --tb-mute:        #7a716a;
  --tb-line:        #e3dccf;
  --tb-line-soft:   #eee8da;
  --tb-paper:       #f7f3ea;
  --tb-paper-2:     #efe9da;
  --tb-yellow:      #f1b81d;
  --tb-yellow-2:    #ffd24a;
  --tb-yellow-ink:  #1a1408;
  --tb-turf:        #2f5d3a;
}

/* =====================================================================
   Body / background — テーマ別
   ===================================================================== */
html body:not(.tb-root) {
  background: var(--tb-paper) !important;
  color: var(--tb-body-text) !important;
}
html[data-theme="dark"] body:not(.tb-root) {
  background: var(--tb-ink-dark) !important;
  color: #d8dfef !important;
}

/* =====================================================================
   Post card / article card — ダーク時に白で浮かないように
   ===================================================================== */
html body:not(.tb-root) .post-card,
html body:not(.tb-root) .article-card,
html body:not(.tb-root) .article-list-item {
  background: #fff !important;
  border: 1px solid var(--tb-line-soft) !important;
  border-radius: 0 !important;
  box-shadow: 0 1px 0 rgba(15,14,12,0.04) !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
  color: var(--tb-body-text) !important;
}
html body:not(.tb-root) .post-card:hover,
html body:not(.tb-root) .article-card:hover,
html body:not(.tb-root) .article-list-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px -16px rgba(15,14,12,0.25) !important;
  border-color: var(--tb-ink) !important;
}
html body:not(.tb-root) .post-card .post-title,
html body:not(.tb-root) .article-card .article-title,
html body:not(.tb-root) .article-list-title {
  color: var(--tb-ink) !important;
  font-family: "Zen Kaku Gothic New", "Noto Sans JP", sans-serif !important;
  font-weight: 800 !important;
}
html body:not(.tb-root) .post-card .post-excerpt,
html body:not(.tb-root) .article-card .article-excerpt,
html body:not(.tb-root) .article-list-excerpt {
  color: var(--tb-body-text) !important;
}
html body:not(.tb-root) .post-card .post-date,
html body:not(.tb-root) .post-card .article-date,
html body:not(.tb-root) .article-date {
  color: var(--tb-body-text) !important;
  opacity: 0.7;
  font-family: "JetBrains Mono", monospace !important;
  font-size: 11px !important;
}

/* DARK MODE: post-card → dark card */
html[data-theme="dark"] body:not(.tb-root) .post-card,
html[data-theme="dark"] body:not(.tb-root) .article-card,
html[data-theme="dark"] body:not(.tb-root) .article-list-item {
  background: var(--tb-ink-2) !important;
  border: 1px solid rgba(244,238,224,0.08) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] body:not(.tb-root) .post-card:hover,
html[data-theme="dark"] body:not(.tb-root) .article-card:hover,
html[data-theme="dark"] body:not(.tb-root) .article-list-item:hover {
  border-color: rgba(241,184,29,0.3) !important;
  box-shadow: 0 8px 28px -16px rgba(0,0,0,0.5) !important;
}
html[data-theme="dark"] body:not(.tb-root) .post-card .post-title,
html[data-theme="dark"] body:not(.tb-root) .article-card .article-title,
html[data-theme="dark"] body:not(.tb-root) .article-list-title {
  color: #fdfbf3 !important;
}
html[data-theme="dark"] body:not(.tb-root) .post-card .post-excerpt,
html[data-theme="dark"] body:not(.tb-root) .article-card .article-excerpt,
html[data-theme="dark"] body:not(.tb-root) .article-list-excerpt {
  color: #c8d0e0 !important;
}
html[data-theme="dark"] body:not(.tb-root) .post-card .post-date {
  color: #b5bdcc !important;
}
html[data-theme="dark"] body:not(.tb-root) .post-thumb {
  background: var(--tb-ink-dark) !important;
}

/* Post thumbnail: enforce 16:9 across category pages */
html body:not(.tb-root) .post-thumb {
  width: 220px !important;
  height: auto !important;
  aspect-ratio: 16 / 9 !important;
  flex-shrink: 0 !important;
  align-self: flex-start !important;  /* prevent flex-stretch overriding aspect-ratio */
}
@media (max-width: 768px) {
  html body:not(.tb-root) .post-thumb {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    align-self: stretch !important;
  }
}

/* Post category badges */
html body:not(.tb-root) .post-card .post-cat,
html body:not(.tb-root) .article-card .article-category {
  background: var(--tb-yellow) !important;
  color: var(--tb-yellow-ink) !important;
  border-radius: 0 !important;
  font-family: "Zen Kaku Gothic New", "Noto Sans JP", sans-serif !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em !important;
}
html body:not(.tb-root) .post-card .post-cat.cat-keiba {
  background: var(--tb-turf) !important;
  color: #f4eee0 !important;
}
html body:not(.tb-root) .post-card .post-cat.cat-economy {
  background: var(--tb-ink) !important;
  color: var(--tb-yellow) !important;
}

/* =====================================================================
   Sidebar (.widget)
   ===================================================================== */
html body:not(.tb-root) .blog-sidebar { background: transparent !important; }
html body:not(.tb-root) .widget,
html body:not(.tb-root) .sidebar-card,
html body:not(.tb-root) .sidebar-section {
  background: #fff !important;
  border: 1px solid var(--tb-line-soft) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 20px 22px !important;
  margin-bottom: 18px !important;
}
html body:not(.tb-root) .widget .widget-title,
html body:not(.tb-root) .sidebar-card h3,
html body:not(.tb-root) .sidebar-section h3 {
  background: transparent !important;
  font-family: "Zen Kaku Gothic New", "Noto Sans JP", sans-serif !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  letter-spacing: 0.12em !important;
  color: var(--tb-ink) !important;
  margin: 0 0 14px !important;
  padding: 0 0 8px !important;
  border-bottom: 2px solid var(--tb-yellow) !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-top: 0 !important;
  position: relative;
  display: inline-block;
  width: auto !important;
}
html body:not(.tb-root) .widget .widget-title::before {
  content: "■";
  color: var(--tb-yellow);
  margin-right: 6px;
  font-size: 0.85em;
}
html body:not(.tb-root) .widget-body { color: var(--tb-body-text) !important; }
html body:not(.tb-root) .widget ul,
html body:not(.tb-root) .cat-list,
html body:not(.tb-root) .archive-list,
html body:not(.tb-root) .recent-posts {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
html body:not(.tb-root) .widget li,
html body:not(.tb-root) .cat-list li,
html body:not(.tb-root) .archive-list li {
  padding: 7px 0 !important;
  border-bottom: 1px solid var(--tb-line-soft) !important;
  font-size: 13px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center;
  gap: 8px;
}
html body:not(.tb-root) .widget li:last-child,
html body:not(.tb-root) .cat-list li:last-child,
html body:not(.tb-root) .archive-list li:last-child {
  border-bottom: 0 !important;
}
html body:not(.tb-root) .widget li a,
html body:not(.tb-root) .cat-list li a,
html body:not(.tb-root) .archive-list li a {
  color: var(--tb-body-text) !important;
  font-family: "Noto Sans JP", sans-serif !important;
  transition: color 0.15s !important;
  text-decoration: none !important;
}
html body:not(.tb-root) .widget li a:hover,
html body:not(.tb-root) .cat-list li a:hover,
html body:not(.tb-root) .archive-list li a:hover {
  color: var(--tb-yellow-ink) !important;
}
html body:not(.tb-root) .widget li span,
html body:not(.tb-root) .cat-list li span,
html body:not(.tb-root) .archive-list li span {
  font-family: "JetBrains Mono", monospace !important;
  font-size: 11px !important;
  color: var(--tb-mute) !important;
  flex-shrink: 0;
}

/* Side channel buttons */
html body:not(.tb-root) .side-channel {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 10px 12px !important;
  background: var(--tb-paper-2) !important;
  border: 1px solid var(--tb-line-soft) !important;
  border-radius: 0 !important;
  color: var(--tb-ink) !important;
  font-family: "Zen Kaku Gothic New", "Noto Sans JP", sans-serif !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  margin-bottom: 8px !important;
  text-decoration: none !important;
  transition: all 0.15s !important;
}
html body:not(.tb-root) .side-channel:hover {
  background: var(--tb-ink) !important;
  color: var(--tb-yellow) !important;
}
html body:not(.tb-root) .side-channel:last-child { margin-bottom: 0 !important; }
html body:not(.tb-root) .side-ch-icon {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  font-weight: 900;
  font-size: 13px;
  background: var(--tb-ink);
  color: var(--tb-yellow);
  flex-shrink: 0;
}
html body:not(.tb-root) .side-channel:hover .side-ch-icon {
  background: var(--tb-yellow);
  color: var(--tb-yellow-ink);
}

/* DARK MODE: sidebar widgets */
html[data-theme="dark"] body:not(.tb-root) .widget,
html[data-theme="dark"] body:not(.tb-root) .sidebar-card,
html[data-theme="dark"] body:not(.tb-root) .sidebar-section {
  background: var(--tb-ink-2) !important;
  border-color: rgba(244,238,224,0.08) !important;
}
html[data-theme="dark"] body:not(.tb-root) .widget .widget-title,
html[data-theme="dark"] body:not(.tb-root) .sidebar-card h3 {
  color: #fdfbf3 !important;
}
html[data-theme="dark"] body:not(.tb-root) .widget li,
html[data-theme="dark"] body:not(.tb-root) .cat-list li,
html[data-theme="dark"] body:not(.tb-root) .archive-list li {
  border-bottom-color: rgba(244,238,224,0.08) !important;
}
html[data-theme="dark"] body:not(.tb-root) .widget li a,
html[data-theme="dark"] body:not(.tb-root) .cat-list li a,
html[data-theme="dark"] body:not(.tb-root) .archive-list li a {
  color: #d8dfef !important;
}
html[data-theme="dark"] body:not(.tb-root) .widget li a:hover {
  color: var(--tb-yellow) !important;
}
html[data-theme="dark"] body:not(.tb-root) .widget li span,
html[data-theme="dark"] body:not(.tb-root) .cat-list li span,
html[data-theme="dark"] body:not(.tb-root) .archive-list li span {
  color: rgba(216,223,239,0.65) !important;
}
html[data-theme="dark"] body:not(.tb-root) .side-channel {
  background: rgba(244,238,224,0.04) !important;
  border-color: rgba(244,238,224,0.08) !important;
  color: #d8dfef !important;
}
html[data-theme="dark"] body:not(.tb-root) .side-channel:hover {
  background: var(--tb-yellow) !important;
  color: var(--tb-yellow-ink) !important;
}
html[data-theme="dark"] body:not(.tb-root) .widget-body p,
html[data-theme="dark"] body:not(.tb-root) .widget-body {
  color: #c8d0e0 !important;
}

/* =====================================================================
   Tab / Filter bar — reference design style (paper bg, yellow underline)
   ===================================================================== */
html body:not(.tb-root) .cat-filter-bar {
  background: var(--tb-paper-2) !important;
  border-bottom: 1px solid var(--tb-line-soft) !important;
  padding: 0 !important;
}
html body:not(.tb-root) .cat-filter-bar .cat-filter-inner {
  display: flex !important;
  align-items: center;
  gap: 0 !important;
  padding: 0 24px;
  max-width: 1280px;
  margin: 0 auto;
  overflow-x: auto;
}
html body:not(.tb-root) .cat-filter-bar .cat-btn {
  background: transparent !important;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  padding: 16px 22px !important;
  font-family: "Zen Kaku Gothic New", "Noto Sans JP", sans-serif !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  letter-spacing: 0.04em !important;
  color: var(--tb-mute) !important;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s !important;
}
html body:not(.tb-root) .cat-filter-bar .cat-btn:hover {
  background: transparent !important;
  color: var(--tb-charcoal) !important;
}
html body:not(.tb-root) .cat-filter-bar .cat-btn.active {
  background: transparent !important;
  color: var(--tb-charcoal) !important;
  border-bottom-color: var(--tb-yellow) !important;
}

/* DARK MODE: tab bar */
html[data-theme="dark"] body:not(.tb-root) .cat-filter-bar {
  background: var(--tb-ink-2) !important;
  border-bottom-color: rgba(244,238,224,0.08) !important;
}
html[data-theme="dark"] body:not(.tb-root) .cat-filter-bar .cat-btn {
  color: rgba(216,223,239,0.65) !important;
}
html[data-theme="dark"] body:not(.tb-root) .cat-filter-bar .cat-btn:hover,
html[data-theme="dark"] body:not(.tb-root) .cat-filter-bar .cat-btn.active {
  color: #fdfbf3 !important;
}

/* =====================================================================
   Pagination
   ===================================================================== */
html body:not(.tb-root) .pagination,
html body:not(.tb-root) #pagination {
  display: flex !important;
  gap: 6px !important;
  justify-content: center !important;
  margin: 40px 0 0 !important;
}
html body:not(.tb-root) .pagination .page-link,
html body:not(.tb-root) .pagination .page-current,
html body:not(.tb-root) #pagination button,
html body:not(.tb-root) #pagination span {
  display: inline-grid !important;
  place-items: center !important;
  min-width: 38px !important;
  height: 38px !important;
  padding: 0 10px !important;
  background: #fff !important;
  color: var(--tb-charcoal) !important;
  border: 1px solid var(--tb-line) !important;
  border-radius: 0 !important;
  font-family: "JetBrains Mono", monospace !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  cursor: pointer !important;
}
html body:not(.tb-root) .pagination .page-current,
html body:not(.tb-root) #pagination .page-current {
  background: var(--tb-ink) !important;
  color: var(--tb-yellow) !important;
  border-color: var(--tb-ink) !important;
}
html body:not(.tb-root) .pagination .page-link:hover,
html body:not(.tb-root) #pagination button:hover {
  background: var(--tb-yellow) !important;
  color: var(--tb-yellow-ink) !important;
  border-color: var(--tb-yellow) !important;
}
html[data-theme="dark"] body:not(.tb-root) .pagination .page-link,
html[data-theme="dark"] body:not(.tb-root) #pagination button {
  background: var(--tb-ink-2) !important;
  color: #d8dfef !important;
  border-color: rgba(244,238,224,0.1) !important;
}
html[data-theme="dark"] body:not(.tb-root) .pagination .page-current,
html[data-theme="dark"] body:not(.tb-root) #pagination .page-current {
  background: var(--tb-yellow) !important;
  color: var(--tb-yellow-ink) !important;
  border-color: var(--tb-yellow) !important;
}

/* =====================================================================
   Page hero — keep current black, but ensure no red/navy bleed-through
   ===================================================================== */
html body:not(.tb-root) .page-hero {
  background:
    radial-gradient(ellipse 60% 50% at 15% 30%, rgba(241,184,29,0.14), transparent 60%),
    repeating-linear-gradient(90deg, transparent 0 36px, rgba(241,184,29,0.05) 36px 37px),
    var(--tb-ink) !important;
  color: #f4eee0 !important;
  border-bottom: 4px solid var(--tb-yellow) !important;
  padding: 60px 28px 56px !important;
}

/* Old .page-hero-sports etc. — neutralize navy/red accents */
html body:not(.tb-root) .page-hero.page-hero-sports,
html body:not(.tb-root) .page-hero.page-hero-economy,
html body:not(.tb-root) .page-hero.page-hero-keiba {
  background:
    radial-gradient(ellipse 60% 50% at 15% 30%, rgba(241,184,29,0.14), transparent 60%),
    repeating-linear-gradient(90deg, transparent 0 36px, rgba(241,184,29,0.05) 36px 37px),
    var(--tb-ink) !important;
}
html body:not(.tb-root) .page-hero .category-badge {
  filter: drop-shadow(0 4px 18px rgba(241,184,29,0.3));
}
html body:not(.tb-root) .page-hero > img { display: none !important; }

/* Hide circular hero badge / category emblem on sub-pages */
html body:not(.tb-root) .page-hero .category-badge,
html body:not(.tb-root) .page-hero .category-badge--sports,
html body:not(.tb-root) .page-hero .category-badge--economy,
html body:not(.tb-root) .page-hero .category-badge--keiba,
html body:not(.tb-root) .page-hero .hero-logo,
html body:not(.tb-root) .page-hero .hero-badge,
html body:not(.tb-root) .page-hero .page-hero-icon,
html body:not(.tb-root) .page-hero .brand-emblem,
html body:not(.tb-root) .page-hero img[src*="icon-"],
html body:not(.tb-root) .page-hero img[src*="logo"],
html body:not(.tb-root) .page-hero img[src*="baseball"] {
  display: none !important;
}

/* =====================================================================
   Blog wrap layout — ensure no body bg bleeding
   ===================================================================== */
html body:not(.tb-root) .blog-wrap {
  background: transparent !important;
}

/* Mobile */
@media (max-width: 768px) {
  html body:not(.tb-root) .blog-sidebar { margin-top: 28px; }
  html body:not(.tb-root) .cat-filter-bar .cat-filter-inner { padding: 0 14px; }
  html body:not(.tb-root) .cat-filter-bar .cat-btn { padding: 12px 14px !important; font-size: 13px !important; }
  html body:not(.tb-root) .widget { padding: 16px 18px !important; }
  html body:not(.tb-root) .page-hero { padding: 36px 18px 32px !important; }
}

/* =====================================================================
   Sub-page logo: HIDE entirely (Phase 3: C案)
   トップページ（body.tb-root）には影響させない
   ナビとお問い合わせ等はそのまま残し、ロゴだけ完全非表示。
   ===================================================================== */
html body:not(.tb-root) .site-header .site-logo,
html body:not(.tb-root) .site-header .site-logo .logo-img,
html body:not(.tb-root) .site-header .site-logo .logo-main,
html body:not(.tb-root) .site-header .site-logo .logo-sub,
html body:not(.tb-root) .site-header .site-logo > div,
html body:not(.tb-root) .site-header .site-logo::before,
html body:not(.tb-root) .site-header .site-logo::after {
  display: none !important;
}

/* Header padding: tighten and let nav fill */
html body:not(.tb-root) .site-header .header-inner {
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  gap: 16px !important;
}
/* On PC, nav was 'margin-left:auto'; with no logo, nav slides flush-left.
   Add a small left padding so it doesn't stick to the edge. */
html body:not(.tb-root) .site-header .site-nav {
  margin-left: 0 !important;
}

@media (max-width: 768px) {
  html body:not(.tb-root) .site-header .header-inner {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    gap: 10px !important;
  }

  /* MOBILE NAV: hide by default, show only when burger is toggled */
  html body:not(.tb-root) .site-header .site-nav {
    display: none !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    flex-direction: column !important;
    gap: 0 !important;
    background: var(--tb-ink) !important;
    border-top: 1px solid rgba(244,238,224,0.1) !important;
    z-index: 99 !important;
    margin: 0 !important;
    padding: 8px 0 18px !important;
  }
  html body:not(.tb-root) .site-header .site-nav a {
    display: block !important;
    padding: 14px 22px !important;
    border-bottom: 1px solid rgba(244,238,224,0.06) !important;
    font-size: 15px !important;
    color: rgba(244,238,224,0.85) !important;
  }

  /* Show nav when any of the common toggle classes are applied to body */
  html body:not(.tb-root).site-menu-open .site-header .site-nav,
  html body:not(.tb-root).menu-open .site-header .site-nav,
  html body:not(.tb-root).tb-menu-open .site-header .site-nav,
  html body:not(.tb-root) .site-header .site-nav.open,
  html body:not(.tb-root) .site-header .site-nav.is-open {
    display: flex !important;
  }

  /* Burger toggle button: visible on mobile, styled to match TB design */
  html body:not(.tb-root) .site-header .nav-toggle {
    display: inline-flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    background: transparent !important;
    border: 1px solid rgba(244,238,224,0.35) !important;
    border-radius: 0 !important;
    cursor: pointer;
    margin-left: auto;
    padding: 0;
  }
  html body:not(.tb-root) .site-header .nav-toggle span {
    display: block !important;
    width: 18px;
    height: 2px;
    background: var(--tb-yellow) !important;
    border-radius: 0;
  }
  html body:not(.tb-root) .site-header .nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }
  html body:not(.tb-root) .site-header .nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }
  html body:not(.tb-root) .site-header .nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }
  html body:not(.tb-root) .site-header .nav-toggle span {
    transition: transform 0.18s ease, opacity 0.18s ease;
  }

  /* CATEGORY FILTER BAR: 2x2 grid on mobile (no horizontal scroll) */
  html body:not(.tb-root) .cat-filter-bar,
  html body:not(.tb-root) .category-tabs,
  html body:not(.tb-root) .filter-tabs {
    overflow-x: visible !important;
  }
  html body:not(.tb-root) .cat-filter-bar .cat-filter-inner {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0 !important;
    overflow-x: visible !important;
    padding: 0 !important;
  }
  html body:not(.tb-root) .cat-filter-bar .cat-btn {
    width: 100% !important;
    text-align: center !important;
    white-space: normal !important;
    font-size: 12.5px !important;
    line-height: 1.35 !important;
    padding: 12px 10px !important;
    border-right: 1px solid rgba(244,238,224,0.08) !important;
    border-bottom: 2px solid transparent !important;
  }
  html body:not(.tb-root) .cat-filter-bar .cat-btn:nth-child(2n) {
    border-right: 0 !important;
  }
  html body:not(.tb-root) .cat-filter-bar .cat-btn:nth-child(1),
  html body:not(.tb-root) .cat-filter-bar .cat-btn:nth-child(2) {
    border-bottom: 1px solid rgba(244,238,224,0.08) !important;
  }
  html body:not(.tb-root) .cat-filter-bar .cat-btn.active {
    border-bottom-color: var(--tb-yellow) !important;
  }
}

/* ============================================================
   JS-free fallback: prevent nav blocking content if JS-toggle fails
   When user taps the burger but no JS class is set, allow :target
   ============================================================ */

/* =====================================================================
   Thumbnail position: center center on sub-pages too
   強い指定（インラインstyle="object-fit:..." を超える specificity）
   ===================================================================== */
html body:not(.tb-root) .post-thumb,
html body:not(.tb-root) .article-thumb {
  display: block !important;
  overflow: hidden !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}
html body:not(.tb-root) .post-thumb img,
html body:not(.tb-root) .post-card img,
html body:not(.tb-root) .article-card img,
html body:not(.tb-root) .article-list-item img,
html body:not(.tb-root) .article-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
  object-position: 50% 50% !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
}

/* === END tb-page-unify.css === */


/* =========================================================================
   TB-ARTICLE-TABLE-DARK (final dark coverage)
   - Covers both html[data-theme="dark"] AND @media (prefers-color-scheme: dark)
   - Targets generic article tables AND .data-table
   - Handles 5/26 article and any future articles with tables
   ========================================================================= */

/* html[data-theme="dark"] variant — manual toggle */
html[data-theme="dark"] body[data-page-type="article"] .art-body table,
html[data-theme="dark"] body[data-page-type="article"] .data-table,
html[data-theme="dark"] body[data-page-type="article"] .article-body table {
  background: #1c1a17 !important;
  color: #f7f3ea !important;
  border-color: rgba(241,184,29,0.18) !important;
}
html[data-theme="dark"] body[data-page-type="article"] .art-body table th,
html[data-theme="dark"] body[data-page-type="article"] .data-table th {
  background: #2a2520 !important;
  color: #fcd34d !important;
  border-color: rgba(241,184,29,0.22) !important;
}
html[data-theme="dark"] body[data-page-type="article"] .art-body table td,
html[data-theme="dark"] body[data-page-type="article"] .data-table td {
  background: #15130f !important;
  color: #f7f3ea !important;
  border-color: rgba(255,255,255,0.08) !important;
}
html[data-theme="dark"] body[data-page-type="article"] .art-body table tr:nth-child(even) td,
html[data-theme="dark"] body[data-page-type="article"] .data-table tr:nth-child(even) td {
  background: #1f1c18 !important;
}
html[data-theme="dark"] body[data-page-type="article"] .art-body table strong,
html[data-theme="dark"] body[data-page-type="article"] .data-table strong {
  color: #fcd34d !important;
  background: none !important;
}
/* Wrappers */
html[data-theme="dark"] body[data-page-type="article"] .table-wrap,
html[data-theme="dark"] body[data-page-type="article"] .table-scroll,
html[data-theme="dark"] body[data-page-type="article"] .article-table-wrap {
  background: #15130f !important;
}
/* Info boxes / cards that often have white backgrounds */
html[data-theme="dark"] body[data-page-type="article"] .note-box,
html[data-theme="dark"] body[data-page-type="article"] .info-box,
html[data-theme="dark"] body[data-page-type="article"] .analysis-box,
html[data-theme="dark"] body[data-page-type="article"] .q-box,
html[data-theme="dark"] body[data-page-type="article"] .body-card {
  background: #1c1a17 !important;
  color: #f7f3ea !important;
  border-color: rgba(241,184,29,0.18) !important;
}

/* @media variant for OS preference (without manual toggle) */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) body[data-page-type="article"] .art-body table,
  html:not([data-theme="light"]) body[data-page-type="article"] .data-table,
  html:not([data-theme="light"]) body[data-page-type="article"] .article-body table {
    background: #1c1a17 !important;
    color: #f7f3ea !important;
    border-color: rgba(241,184,29,0.18) !important;
  }
  html:not([data-theme="light"]) body[data-page-type="article"] .art-body table th,
  html:not([data-theme="light"]) body[data-page-type="article"] .data-table th {
    background: #2a2520 !important;
    color: #fcd34d !important;
    border-color: rgba(241,184,29,0.22) !important;
  }
  html:not([data-theme="light"]) body[data-page-type="article"] .art-body table td,
  html:not([data-theme="light"]) body[data-page-type="article"] .data-table td {
    background: #15130f !important;
    color: #f7f3ea !important;
    border-color: rgba(255,255,255,0.08) !important;
  }
  html:not([data-theme="light"]) body[data-page-type="article"] .art-body table tr:nth-child(even) td,
  html:not([data-theme="light"]) body[data-page-type="article"] .data-table tr:nth-child(even) td {
    background: #1f1c18 !important;
  }
  html:not([data-theme="light"]) body[data-page-type="article"] .art-body table strong,
  html:not([data-theme="light"]) body[data-page-type="article"] .data-table strong {
    color: #fcd34d !important;
    background: none !important;
  }
  html:not([data-theme="light"]) body[data-page-type="article"] .table-wrap,
  html:not([data-theme="light"]) body[data-page-type="article"] .table-scroll {
    background: #15130f !important;
  }
}

/* === END TB-ARTICLE-TABLE-DARK === */


/* =========================================================================
   TB-LEGACY-PAGES — profile / contact / privacy-policy 系の暗背景化
   旧ページのフォーム/カード/プロフィール白浮きを解消
   ========================================================================= */

/* Legacy page content cards (light mode) */
html body:not(.tb-root) .profile-card,
html body:not(.tb-root) .policy-section,
html body:not(.tb-root) .gate-card,
html body:not(.tb-root) .form-wrap,
html body:not(.tb-root) .contact-form,
html body:not(.tb-root) .form-card,
html body:not(.tb-root) .page-content,
html body:not(.tb-root) .about-section {
  background: #fff !important;
  border: 1px solid var(--tb-line-soft) !important;
  border-radius: 0 !important;
  color: var(--tb-body-text) !important;
}

/* DARK MODE: Legacy page cards */
html[data-theme="dark"] body:not(.tb-root) .profile-card,
html[data-theme="dark"] body:not(.tb-root) .policy-section,
html[data-theme="dark"] body:not(.tb-root) .gate-card,
html[data-theme="dark"] body:not(.tb-root) .form-wrap,
html[data-theme="dark"] body:not(.tb-root) .contact-form,
html[data-theme="dark"] body:not(.tb-root) .form-card,
html[data-theme="dark"] body:not(.tb-root) .page-content,
html[data-theme="dark"] body:not(.tb-root) .about-section {
  background: var(--tb-ink-2) !important;
  border-color: rgba(244,238,224,0.1) !important;
  color: #d8dfef !important;
}
html[data-theme="dark"] body:not(.tb-root) .profile-card h2,
html[data-theme="dark"] body:not(.tb-root) .profile-card h3,
html[data-theme="dark"] body:not(.tb-root) .policy-section h2,
html[data-theme="dark"] body:not(.tb-root) .policy-section h3,
html[data-theme="dark"] body:not(.tb-root) .about-section h2,
html[data-theme="dark"] body:not(.tb-root) .about-section h3,
html[data-theme="dark"] body:not(.tb-root) .page-content h1,
html[data-theme="dark"] body:not(.tb-root) .page-content h2 {
  color: #fdfbf3 !important;
}
html[data-theme="dark"] body:not(.tb-root) .profile-card p,
html[data-theme="dark"] body:not(.tb-root) .policy-section p,
html[data-theme="dark"] body:not(.tb-root) .about-section p,
html[data-theme="dark"] body:not(.tb-root) .page-content p,
html[data-theme="dark"] body:not(.tb-root) .form-card p,
html[data-theme="dark"] body:not(.tb-root) .contact-form p {
  color: rgba(216,223,239,0.85) !important;
}
html[data-theme="dark"] body:not(.tb-root) .profile-card a,
html[data-theme="dark"] body:not(.tb-root) .policy-section a,
html[data-theme="dark"] body:not(.tb-root) .about-section a,
html[data-theme="dark"] body:not(.tb-root) .page-content a {
  color: var(--tb-yellow) !important;
}

/* Form inputs (light) */
html body:not(.tb-root) input[type="text"],
html body:not(.tb-root) input[type="email"],
html body:not(.tb-root) input[type="tel"],
html body:not(.tb-root) input[type="url"],
html body:not(.tb-root) textarea,
html body:not(.tb-root) select {
  background: #fff !important;
  color: var(--tb-ink) !important;
  border: 1px solid var(--tb-line-soft) !important;
  border-radius: 0 !important;
}
html body:not(.tb-root) input[type="text"]:focus,
html body:not(.tb-root) input[type="email"]:focus,
html body:not(.tb-root) textarea:focus,
html body:not(.tb-root) select:focus {
  border-color: var(--tb-yellow) !important;
  outline: 2px solid rgba(241,184,29,0.25) !important;
  outline-offset: 0 !important;
}

/* DARK MODE: form inputs */
html[data-theme="dark"] body:not(.tb-root) input[type="text"],
html[data-theme="dark"] body:not(.tb-root) input[type="email"],
html[data-theme="dark"] body:not(.tb-root) input[type="tel"],
html[data-theme="dark"] body:not(.tb-root) input[type="url"],
html[data-theme="dark"] body:not(.tb-root) textarea,
html[data-theme="dark"] body:not(.tb-root) select {
  background: var(--tb-ink-dark) !important;
  color: #f7f3ea !important;
  border: 1px solid rgba(241,184,29,0.25) !important;
}
html[data-theme="dark"] body:not(.tb-root) input::placeholder,
html[data-theme="dark"] body:not(.tb-root) textarea::placeholder {
  color: rgba(247,243,234,0.45) !important;
}
html[data-theme="dark"] body:not(.tb-root) label {
  color: #d8dfef !important;
}

/* Submit / button */
html body:not(.tb-root) button[type="submit"],
html body:not(.tb-root) .btn-submit,
html body:not(.tb-root) .form-submit {
  background: var(--tb-yellow) !important;
  color: var(--tb-yellow-ink) !important;
  border: 1px solid var(--tb-yellow) !important;
  border-radius: 0 !important;
  font-weight: 800 !important;
}
html body:not(.tb-root) button[type="submit"]:hover {
  background: var(--tb-yellow-2) !important;
}

/* === END TB-LEGACY-PAGES === */
