/* ========================================
   RIDE SISTERS - 女性ライダーコミュニティ
   共通スタイルシート
   Light Theme Default + Manual Dark Mode Toggle
======================================== */

/* ---------- CSS Variables (Light Theme - Default) ---------- */
:root {
  /* Background Colors */
  --color-bg-primary: #ffffff;
  --color-bg-secondary: #f8f9fa;
  --color-bg-card: #ffffff;
  --color-bg-elevated: #f1f3f5;
  
  /* Accent Colors - しっかりした色 */
  --color-accent: #dc3545;
  --color-accent-light: #e85d6a;
  --color-accent-dark: #b02a37;
  --color-accent-bg: rgba(220, 53, 69, 0.08);
  
  /* Secondary Colors */
  --color-primary: #0d6efd;
  --color-primary-light: #3d8bfd;
  --color-success: #198754;
  --color-warning: #ffc107;
  --color-info: #0dcaf0;
  
  /* Text Colors */
  --color-text-primary: #212529;
  --color-text-secondary: #495057;
  --color-text-muted: #6c757d;
  
  /* Border & Divider */
  --color-border: #dee2e6;
  --color-border-hover: #adb5bd;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  /* Typography */
  --font-family: 'Zen Kaku Gothic New', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-family-en: 'DM Sans', 'Zen Kaku Gothic New', sans-serif;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  
  /* Z-index */
  --z-header: 100;
  --z-modal: 200;
}

/* ---------- Dark Mode (Manual Toggle) ---------- */
[data-theme="dark"] {
  --color-bg-primary: #1a1a2e;
  --color-bg-secondary: #16213e;
  --color-bg-card: #1e1e32;
  --color-bg-elevated: #252538;
  
  --color-accent: #ff6b6b;
  --color-accent-light: #ff8787;
  --color-accent-dark: #e85555;
  --color-accent-bg: rgba(255, 107, 107, 0.15);
  
  --color-primary: #4dabf7;
  --color-primary-light: #74c0fc;
  --color-success: #51cf66;
  
  --color-text-primary: #f1f3f5;
  --color-text-secondary: #ced4da;
  --color-text-muted: #868e96;
  
  --color-border: #343a40;
  --color-border-hover: #495057;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-base), color var(--transition-base);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-light);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea {
  font-family: inherit;
  font-size: inherit;
}

ul, ol {
  list-style: none;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: var(--color-text-primary);
}

h1 { font-size: clamp(1.75rem, 5vw, 2.25rem); }
h2 { font-size: clamp(1.5rem, 4vw, 1.875rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }
h4 { font-size: 1.125rem; }

.text-accent {
  color: var(--color-accent);
}

.text-muted {
  color: var(--color-text-muted);
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-xl);
  }
}

.section {
  padding: var(--space-2xl) 0;
}

@media (min-width: 768px) {
  .section {
    padding: var(--space-3xl) 0;
  }
}

/* ---------- Header ---------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  background: linear-gradient(180deg, var(--color-accent) 3px, var(--color-bg-secondary) 3px);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow var(--transition-base), background-color var(--transition-base);
}

[data-theme="dark"] .header {
  background: linear-gradient(180deg, var(--color-accent) 3px, var(--color-bg-card) 3px);
}

.header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 var(--space-md);
}

@media (min-width: 768px) {
  .header-inner {
    height: 72px;
    padding: 0 var(--space-xl);
  }
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-family-en);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.02em;
  color: var(--color-text-primary);
}

.logo:hover {
  color: var(--color-text-primary);
}

.logo-icon {
  font-size: 1.5rem;
}

/* Desktop Navigation */
.nav-desktop {
  display: none;
}

@media (min-width: 1024px) {
  .nav-desktop {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
  }
}

/* WordPress Menu Structure */
.nav-desktop ul,
.nav-desktop .menu {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-desktop li,
.nav-desktop .menu-item {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-desktop li a,
.nav-desktop .menu-item a {
  position: relative;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  padding: var(--space-sm) 0;
  transition: color var(--transition-fast);
  text-decoration: none;
}

.nav-desktop li a:hover,
.nav-desktop .menu-item a:hover {
  color: var(--color-text-primary);
}

.nav-desktop li a::after,
.nav-desktop .menu-item a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--transition-base);
}

.nav-desktop li a:hover::after,
.nav-desktop .menu-item a:hover::after {
  width: 100%;
}

.nav-link {
  position: relative;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  padding: var(--space-sm) 0;
  transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-text-primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--transition-base);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link.emergency {
  color: var(--color-accent);
  font-weight: 600;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.btn-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: 1.25rem;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
}

/* Theme Toggle Button */
.btn-theme {
  font-size: 1.1rem;
  position: relative;
}

.btn-theme-text {
  width: auto;
  height: auto;
  padding: var(--space-xs) var(--space-sm);
  gap: var(--space-xs);
  font-size: 0.85rem;
  background: var(--color-primary);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-full);
  color: white;
}

.btn-theme-text:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary-light);
  color: white;
}

[data-theme="dark"] .btn-theme-text {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

[data-theme="dark"] .btn-theme-text:hover {
  background: var(--color-accent-light);
  border-color: var(--color-accent-light);
}

.btn-theme .icon-sun,
.btn-theme .icon-moon {
  line-height: 1;
}

/* Theme labels */
.theme-label-dark,
.theme-label-light {
  font-size: 0.8rem;
  font-weight: 500;
  color: white;
}

/* Light mode (default): show moon + "ダーク", hide sun + "ライト" */
.btn-theme .icon-sun {
  display: none !important;
}

.btn-theme .icon-moon {
  display: block !important;
}

.theme-label-light {
  display: none !important;
}

.theme-label-dark {
  display: block !important;
}

/* Dark mode: show sun + "ライト", hide moon + "ダーク" */
[data-theme="dark"] .btn-theme .icon-sun {
  display: block !important;
}

[data-theme="dark"] .btn-theme .icon-moon {
  display: none !important;
}

[data-theme="dark"] .theme-label-light {
  display: block !important;
}

[data-theme="dark"] .theme-label-dark {
  display: none !important;
}

.btn-menu {
  display: flex;
}

@media (min-width: 1024px) {
  .btn-menu {
    display: none;
  }
}

/* ---------- Hero Section ---------- */
.hero {
  padding-top: 80px;
  padding-bottom: var(--space-xl);
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  transition: background-color var(--transition-base);
}

@media (min-width: 768px) {
  .hero {
    padding-top: 100px;
    padding-bottom: var(--space-2xl);
  }
}

.hero-text {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.hero-title {
  margin-bottom: var(--space-md);
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.8;
}

/* Search Box */
.search-box {
  display: flex;
  gap: var(--space-sm);
  max-width: 500px;
  margin: 0 auto var(--space-lg);
}

.search-input {
  flex: 1;
  height: 48px;
  padding: 0 var(--space-md);
  background: var(--color-bg-primary);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.search-input::placeholder {
  color: var(--color-text-muted);
}

.search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

[data-theme="dark"] .search-input:focus {
  box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.2);
}

.search-btn {
  width: 48px;
  height: 48px;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: white;
  transition: background var(--transition-fast);
}

.search-btn:hover {
  background: var(--color-primary-light);
}

/* ---------- Emergency Section Box ---------- */
.emergency-section-box {
  background: var(--color-bg-primary);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-top: var(--space-xl);
}

.emergency-section-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: var(--color-accent);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  color: white;
  margin-bottom: var(--space-md);
}

.emergency-section-box .emergency-cards {
  margin-top: 0;
}

/* ---------- Emergency Button ---------- */
.btn-emergency {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  background: var(--color-accent);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  color: white;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.btn-emergency:hover {
  background: var(--color-accent-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Emergency Cards */
.emergency-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

@media (min-width: 768px) {
  .emergency-cards {
    grid-template-columns: repeat(4, 1fr);
  }
}

.emergency-card {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  transition: all var(--transition-base);
}

.emergency-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.emergency-card-icon {
  font-size: 1.75rem;
  margin-bottom: var(--space-sm);
}

.emergency-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--space-xs);
}

.emergency-card-desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ---------- AI Bot Inline (Top Page) ---------- */
.ai-bot-inline {
  background: var(--color-bg-primary);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-top: var(--space-xl);
  transition: background-color var(--transition-base), border-color var(--transition-base);
}

@media (min-width: 768px) {
  .ai-bot-inline {
    padding: var(--space-xl);
  }
}

.ai-bot-inline-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.ai-bot-inline-icon {
  font-size: 1.5rem;
}

.ai-bot-inline-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.ai-bot-inline-notice {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-elevated);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-base);
}

.bot-step-inline {
  margin-bottom: var(--space-md);
}

.bot-step-inline:last-of-type {
  margin-bottom: 0;
}

.bot-step-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--color-text-secondary);
}

.bot-step-num {
  width: 24px;
  height: 24px;
  background: var(--color-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
}

.bot-options-inline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.bot-option {
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-elevated);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.bot-option:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.bot-option.selected {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

.bot-input {
  width: 100%;
  padding: var(--space-md);
  background: var(--color-bg-primary);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.bot-input::placeholder {
  color: var(--color-text-muted);
}

.bot-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

[data-theme="dark"] .bot-input:focus {
  box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.2);
}

.bot-submit {
  width: 100%;
  padding: var(--space-md);
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: all var(--transition-base);
  margin-top: var(--space-md);
}

.bot-submit:hover:not(:disabled) {
  background: var(--color-accent-dark);
}

.bot-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* AI Bot Results (Inline) */
.bot-loading {
  text-align: center;
  padding: var(--space-lg);
  color: var(--color-text-muted);
}

.bot-results-header {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.bot-result-card {
  display: block;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.bot-result-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}

.bot-result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.bot-result-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.4;
}

.bot-result-match {
  flex-shrink: 0;
  padding: 2px 8px;
  background: var(--color-success);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
}

.bot-result-excerpt {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-sm);
}

.bot-result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.bot-result-tag {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.bot-no-results {
  text-align: center;
  padding: var(--space-lg);
  background: var(--color-bg-elevated);
  border-radius: var(--radius-md);
}

.bot-no-results p {
  font-size: 1rem;
  color: var(--color-text-primary);
  margin-bottom: var(--space-xs);
}

.bot-no-results-hint {
  font-size: 0.85rem !important;
  color: var(--color-text-muted) !important;
}

/* ---------- Section Header ---------- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.section-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.25rem;
}

.section-title-icon {
  font-size: 1.5rem;
}

.section-link {
  font-size: 0.875rem;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* ---------- Article Cards ---------- */
.article-grid {
  display: grid;
  gap: var(--space-md);
}

@media (min-width: 768px) {
  .article-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }
}

@media (min-width: 1024px) {
  .article-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.article-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
}

.article-card:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.article-thumb {
  height: 140px;
  background: var(--color-bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: background-color var(--transition-base);
}

.article-thumb-icon {
  font-size: 2.5rem;
  opacity: 0.4;
}

.article-content {
  padding: var(--space-md);
}

.article-tag {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-accent);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  color: white;
  margin-bottom: var(--space-sm);
}

.article-tag.maintenance {
  background: var(--color-success);
}

.article-tag.law {
  background: var(--color-primary);
}

.article-tag.gear {
  background: #f59f00;
}

.article-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--space-sm);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ---------- Category Cards ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

@media (min-width: 768px) {
  .category-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .category-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.category-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  transition: all var(--transition-base);
}

.category-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.category-icon {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.category-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.category-count {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

/* ---------- Two Column Layout ---------- */
.two-column {
  display: grid;
  gap: var(--space-xl);
}

@media (min-width: 1024px) {
  .two-column {
    grid-template-columns: 1fr 300px;
    gap: var(--space-2xl);
  }
}

/* ---------- Sidebar ---------- */
.sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .sidebar {
    display: block;
  }
}

.sidebar-section {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  transition: background-color var(--transition-base), border-color var(--transition-base);
}

.sidebar-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.sidebar-link {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  padding: var(--space-sm) 0;
  border-bottom: 1px dotted var(--color-border);
  transition: color var(--transition-fast);
}

.sidebar-link:last-child {
  border-bottom: none;
}

.sidebar-link:hover {
  color: var(--color-accent);
}

.sidebar-sns {
  display: flex;
  gap: var(--space-sm);
}

.sns-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: white;
  transition: transform var(--transition-fast);
}

.sns-icon:hover {
  transform: translateY(-2px);
}

.sns-icon.twitter { background: #1da1f2; }
.sns-icon.instagram { background: linear-gradient(45deg, #f09433, #dc2743, #bc1888); }
.sns-icon.line { background: #00b900; }

/* ---------- Footer ---------- */
.footer {
  background: #343a40;
  border-top: none;
  padding: var(--space-2xl) 0;
  margin-top: var(--space-3xl);
  transition: background-color var(--transition-base);
}

[data-theme="dark"] .footer {
  background: #0d1117;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  text-align: center;
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md) var(--space-lg);
}

/* WordPress Footer Menu Structure */
.footer-links ul,
.footer-links .menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md) var(--space-lg);
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li,
.footer-links .menu-item {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li a,
.footer-links .menu-item a {
  font-size: 0.875rem;
  color: #adb5bd;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-links li a:hover,
.footer-links .menu-item a:hover {
  color: #ffffff;
}

.footer-link {
  font-size: 0.875rem;
  color: #adb5bd;
}

.footer-link:hover {
  color: #ffffff;
}

.footer-copy {
  font-size: 0.8rem;
  color: #868e96;
}

/* ---------- Bottom Navigation (Mobile) ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  background: var(--color-bg-primary);
  border-top: 1px solid var(--color-border);
  padding: var(--space-sm) 0;
  padding-bottom: calc(var(--space-sm) + env(safe-area-inset-bottom));
  transition: background-color var(--transition-base);
}

@media (min-width: 1024px) {
  .bottom-nav {
    display: none;
  }
}

.bottom-nav-inner {
  display: flex;
  justify-content: space-around;
  max-width: 500px;
  margin: 0 auto;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-xs);
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.bottom-nav-item.active {
  color: var(--color-accent);
}

.bottom-nav-icon {
  font-size: 1.25rem;
}

.bottom-nav-label {
  font-size: 0.65rem;
  font-weight: 500;
}

body {
  padding-bottom: 70px;
}

@media (min-width: 1024px) {
  body {
    padding-bottom: 0;
  }
}

/* ---------- Result Cards (AI Bot) ---------- */
.result-card {
  display: block;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  transition: all var(--transition-base);
}

.result-card:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-md);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.result-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.4;
}

.result-match {
  flex-shrink: 0;
  padding: var(--space-xs) var(--space-sm);
  background: rgba(25, 135, 84, 0.1);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-success);
  white-space: nowrap;
}

[data-theme="dark"] .result-match {
  background: rgba(81, 207, 102, 0.15);
}

.result-summary {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-md);
}

.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.result-tag {
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-bg-elevated);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* ---------- Mobile Menu ---------- */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 320px;
  height: 100vh;
  background: var(--color-bg-primary);
  z-index: 201;
  transition: right 0.3s ease, background-color var(--transition-base);
  padding: var(--space-lg);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.mobile-menu.is-open {
  right: 0;
}

.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  z-index: 200;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-link {
  display: block;
  padding: var(--space-md) 0;
  font-size: 1rem;
  color: var(--color-text-primary);
  border-bottom: 1px solid var(--color-border);
}

.mobile-menu-link.emergency {
  color: var(--color-accent);
  font-weight: 600;
}

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Animation */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   bbPress Forum Styles
======================================== */

/* Forum Container */
#bbpress-forums {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  color: var(--color-text-primary);
  font-size: 14px;
}

/* All text in bbPress */
#bbpress-forums,
#bbpress-forums p,
#bbpress-forums span,
#bbpress-forums div,
#bbpress-forums li,
#bbpress-forums td,
#bbpress-forums th {
  color: var(--color-text-primary);
  font-size: 14px;
}

/* Hide allowed tags notice */
#bbpress-forums p.bbp-allowed-tags-message,
#bbpress-forums code.bbp-allowed-tags,
#bbpress-forums .bbp-allowed-tags,
#bbpress-forums p:has(code.bbp-allowed-tags) {
  display: none !important;
}

/* ========================================
   Forum/Topic List - デザイン改善
======================================== */

/* Forum/Topic リスト全体のコンテナ */
#bbpress-forums ul.bbp-forums,
#bbpress-forums ul.bbp-topics {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--color-border);
  position: relative;
  margin-bottom: var(--space-xl);
}

/* 右端のデザインライン */
#bbpress-forums ul.bbp-forums::after,
#bbpress-forums ul.bbp-topics::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--color-primary), var(--color-accent));
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

/* ヘッダー行（フォーラム・トピック見出し） */
#bbpress-forums li.bbp-header {
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  border-radius: 0;
  padding: var(--space-md) var(--space-lg);
  color: white !important;
  font-weight: 700;
  font-size: 14px;
  border-bottom: none;
}

#bbpress-forums li.bbp-header li {
  color: white !important;
}

/* フッター行 */
#bbpress-forums li.bbp-footer {
  background: var(--color-bg-elevated);
  border-radius: 0;
  padding: var(--space-md) var(--space-lg);
  color: var(--color-text-secondary) !important;
  font-weight: 500;
  font-size: 13px;
  border-top: 1px solid var(--color-border);
}

/* Dark mode header */
[data-theme="dark"] #bbpress-forums li.bbp-header {
  background: linear-gradient(90deg, var(--color-primary), rgba(77, 171, 247, 0.7));
}

[data-theme="dark"] #bbpress-forums li.bbp-footer {
  background: var(--color-bg-elevated);
}

/* ボディ行 */
#bbpress-forums li.bbp-body ul.forum,
#bbpress-forums li.bbp-body ul.topic {
  background: var(--color-bg-primary);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-lg) var(--space-md);
  margin: 0;
}

#bbpress-forums li.bbp-body ul.forum:hover,
#bbpress-forums li.bbp-body ul.topic:hover {
  background: var(--color-bg-elevated);
}

/* ========================================
   Search Form - 検索フォームのスタイル
======================================== */

/* 検索フォームと下の要素の間隔 */
#bbpress-forums .bbp-search-form {
  margin-bottom: var(--space-2xl);
}

/* フォーラム一覧の後、トピック一覧の前にある検索を非表示 */
#bbpress-forums ul.bbp-forums + .bbp-search-form,
#bbpress-forums .bbp-pagination + .bbp-search-form,
#bbpress-forums .bbp-search-form ~ .bbp-search-form {
  display: none !important;
}

/* パンくず直後の検索のみ表示 */
#bbpress-forums .bbp-breadcrumb + .bbp-search-form {
  display: flex !important;
}

/* Forum/Topic Titles */
#bbpress-forums .bbp-forum-title,
#bbpress-forums .bbp-topic-title,
#bbpress-forums a.bbp-forum-title,
#bbpress-forums a.bbp-topic-permalink {
  color: var(--color-primary) !important;
  font-weight: 600;
  font-size: 15px;
}

#bbpress-forums .bbp-forum-title:hover,
#bbpress-forums .bbp-topic-title:hover,
#bbpress-forums a.bbp-forum-title:hover,
#bbpress-forums a.bbp-topic-permalink:hover {
  color: var(--color-primary-light) !important;
}

/* Forum/Topic Info Text */
#bbpress-forums .bbp-forum-info .bbp-forum-content,
#bbpress-forums .bbp-topic-meta,
#bbpress-forums .bbp-forum-freshness,
#bbpress-forums .bbp-topic-freshness,
#bbpress-forums p.bbp-topic-meta,
#bbpress-forums .bbp-author-role {
  color: var(--color-text-secondary) !important;
  font-size: 14px;
}

/* Topic/Reply Count */
#bbpress-forums .bbp-forum-topic-count,
#bbpress-forums .bbp-forum-reply-count,
#bbpress-forums .bbp-topic-voice-count,
#bbpress-forums .bbp-topic-reply-count {
  color: var(--color-text-muted);
  font-size: 14px;
}

/* Author Info */
#bbpress-forums .bbp-topic-author,
#bbpress-forums .bbp-reply-author {
  color: var(--color-text-secondary);
}

#bbpress-forums .bbp-author-name,
#bbpress-forums a.bbp-author-name {
  color: var(--color-primary) !important;
  font-weight: 600;
  font-size: 14px;
}

#bbpress-forums .bbp-author-role {
  color: var(--color-text-muted) !important;
  font-size: 13px;
}

/* Author IP (for admins) */
#bbpress-forums .bbp-author-ip {
  color: var(--color-text-muted) !important;
  font-size: 12px;
}

/* Topic/Reply Header - 各投稿のボタン行・メタ情報 */
#bbpress-forums .bbp-reply-header,
#bbpress-forums .bbp-topic-header,
#bbpress-forums .bbp-meta,
#bbpress-forums td.bbp-topic-header,
#bbpress-forums td.bbp-reply-header {
  background: var(--color-bg-elevated) !important;
  color: var(--color-text-secondary) !important;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
}

/* テーブルセル全体の背景 */
#bbpress-forums td,
#bbpress-forums tbody td {
  background: var(--color-bg-card) !important;
}

/* ダークモードでの背景色 */
[data-theme="dark"] #bbpress-forums .bbp-reply-header,
[data-theme="dark"] #bbpress-forums .bbp-topic-header,
[data-theme="dark"] #bbpress-forums .bbp-meta,
[data-theme="dark"] #bbpress-forums td.bbp-topic-header,
[data-theme="dark"] #bbpress-forums td.bbp-reply-header {
  background: #2a3441 !important;
  color: var(--color-text-secondary) !important;
}

[data-theme="dark"] #bbpress-forums td,
[data-theme="dark"] #bbpress-forums tbody td {
  background: var(--color-bg-card) !important;
}

#bbpress-forums .bbp-reply-header a,
#bbpress-forums .bbp-topic-header a {
  color: var(--color-primary);
}

/* トピック詳細ページのテーブルヘッダー（投稿者・投稿） */
#bbpress-forums thead,
#bbpress-forums .bbp-header,
#bbpress-forums thead tr,
#bbpress-forums thead th {
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light)) !important;
  color: white !important;
}

#bbpress-forums thead th {
  padding: var(--space-md) var(--space-lg);
  font-weight: 700;
  font-size: 14px;
  border: none;
}

/* ダークモードでも同様 */
[data-theme="dark"] #bbpress-forums thead,
[data-theme="dark"] #bbpress-forums thead tr,
[data-theme="dark"] #bbpress-forums thead th {
  background: linear-gradient(90deg, var(--color-primary), rgba(77, 171, 247, 0.7)) !important;
  color: white !important;
}

/* Notices - Hide unnecessary messages */
#bbpress-forums div.bbp-template-notice,
#bbpress-forums div.bbp-template-notice.info,
#bbpress-forums div.bbp-template-notice.warning {
  display: none !important;
}

/* Show only important error notices */
#bbpress-forums div.bbp-template-notice.error {
  display: block !important;
  background: rgba(220, 53, 69, 0.1);
  border-left: 4px solid var(--color-accent);
  color: var(--color-text-primary) !important;
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
}

/* ========================================
   Form Styles - トピック作成・返信フォーム
======================================== */

/* 共通フォームスタイル */
#bbpress-forums fieldset.bbp-form {
  background: var(--color-bg-card);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-top: var(--space-md);
  position: relative;
}

/* デフォルトのlegendを非表示 */
#bbpress-forums fieldset.bbp-form legend {
  display: none !important;
}

/* トピック作成フォーム */
#bbpress-forums div.bbp-topic-form fieldset.bbp-form,
#bbpress-forums #new-topic fieldset.bbp-form {
  border-color: var(--color-primary);
  border-width: 2px;
  padding-top: calc(var(--space-lg) + 50px);
}

#bbpress-forums div.bbp-topic-form fieldset.bbp-form::before,
#bbpress-forums #new-topic fieldset.bbp-form::before {
  content: "📝 新規トピック作成";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  color: white;
  padding: var(--space-md) var(--space-lg);
  font-weight: 700;
  font-size: 15px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* 返信フォーム */
#bbpress-forums div.bbp-reply-form fieldset.bbp-form,
#bbpress-forums #new-reply fieldset.bbp-form {
  border-color: var(--color-accent);
  border-width: 2px;
  padding-top: calc(var(--space-lg) + 50px);
}

#bbpress-forums div.bbp-reply-form fieldset.bbp-form::before,
#bbpress-forums #new-reply fieldset.bbp-form::before {
  content: "💬 返信を投稿";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(90deg, var(--color-accent), #ff7b93);
  color: white;
  padding: var(--space-md) var(--space-lg);
  font-weight: 700;
  font-size: 15px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* ========================================
   Nested Fieldset - カスタムフィールド
======================================== */

/* bbPressデフォルトのゲストフィールドを非表示（カスタムフィールドを使用） */
#bbpress-forums fieldset.bbp-form #bbp-anonymous-form {
  display: none !important;
}

/* カスタムフィールドのスタイル */
#bbpress-forums fieldset.lamoto-author-fields,
#bbpress-forums fieldset.lamoto-custom-fields {
  border: none !important;
  padding: var(--space-md) 0 0 0 !important;
  margin: var(--space-md) 0 0 0 !important;
  background: transparent !important;
}

#bbpress-forums fieldset.lamoto-author-fields legend,
#bbpress-forums fieldset.lamoto-custom-fields legend {
  display: none !important;
}

#bbpress-forums fieldset.lamoto-author-fields::before,
#bbpress-forums fieldset.lamoto-custom-fields::before {
  display: none !important;
  content: none !important;
}

/* ネストされたfieldset - 見出しのみ非表示、中身は表示 */
#bbpress-forums fieldset.bbp-form fieldset:not(.lamoto-author-fields):not(.lamoto-custom-fields) {
  border: none;
  padding: var(--space-md) 0 0 0;
  margin: var(--space-md) 0 0 0;
  background: transparent;
  display: block !important;
}

/* ネストされたfieldsetのlegendを非表示 */
#bbpress-forums fieldset.bbp-form fieldset:not(.lamoto-author-fields):not(.lamoto-custom-fields) legend {
  display: none !important;
}

/* ::before擬似要素も非表示（親フォームの見出し以外） */
#bbpress-forums fieldset.bbp-form fieldset:not(.lamoto-author-fields):not(.lamoto-custom-fields)::before {
  display: none !important;
  content: none !important;
}

/* フォーム内の各フィールドは表示 */
#bbpress-forums fieldset.bbp-form fieldset p,
#bbpress-forums fieldset.bbp-form fieldset div,
#bbpress-forums fieldset.bbp-form fieldset label,
#bbpress-forums fieldset.bbp-form fieldset input,
#bbpress-forums fieldset.bbp-form fieldset select,
#bbpress-forums fieldset.bbp-form fieldset textarea {
  display: block !important;
  visibility: visible !important;
}

#bbpress-forums label {
  color: var(--color-text-primary) !important;
  font-weight: 500;
  font-size: 14px;
  margin-bottom: var(--space-xs);
  display: block;
}

#bbpress-forums input[type="text"],
#bbpress-forums input[type="email"],
#bbpress-forums input[type="url"],
#bbpress-forums textarea {
  width: 100%;
  padding: var(--space-md);
  background: var(--color-bg-primary);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary) !important;
  font-size: 14px;
  transition: border-color var(--transition-fast);
}

/* Select box - 高さと余白を十分に */
#bbpress-forums select {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  background: var(--color-bg-primary);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary) !important;
  font-size: 14px;
  line-height: 1.5;
  min-height: 44px;
  transition: border-color var(--transition-fast);
  cursor: pointer;
}

#bbpress-forums select option {
  padding: var(--space-md);
  font-size: 14px;
  line-height: 1.8;
  min-height: 40px;
}

#bbpress-forums input[type="text"]:focus,
#bbpress-forums input[type="email"]:focus,
#bbpress-forums input[type="url"]:focus,
#bbpress-forums textarea:focus,
#bbpress-forums select:focus {
  outline: none;
  border-color: var(--color-primary);
}

#bbpress-forums textarea {
  min-height: 200px;
  resize: vertical;
}

/* Submit Button - Force visibility */
#bbpress-forums button,
#bbpress-forums button.submit,
#bbpress-forums input[type="submit"],
#bbpress-forums .bbp-submit-wrapper button,
#bbpress-forums .bbp-submit-wrapper input[type="submit"] {
  background: var(--color-accent) !important;
  color: white !important;
  border: 3px solid var(--color-accent) !important;
  padding: var(--space-md) var(--space-2xl) !important;
  border-radius: var(--radius-md) !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-lg);
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-width: 120px;
  text-align: center;
}

#bbpress-forums button:hover,
#bbpress-forums button.submit:hover,
#bbpress-forums input[type="submit"]:hover,
#bbpress-forums .bbp-submit-wrapper button:hover,
#bbpress-forums .bbp-submit-wrapper input[type="submit"]:hover {
  background: var(--color-accent-dark) !important;
  border-color: var(--color-accent-dark) !important;
  box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
  transform: translateY(-2px);
}

/* Submit wrapper positioning */
#bbpress-forums .bbp-submit-wrapper {
  margin-top: var(--space-lg);
  text-align: right;
}

/* Topic/Reply Content */
#bbpress-forums div.bbp-topic-content,
#bbpress-forums div.bbp-reply-content {
  color: var(--color-text-primary) !important;
  line-height: 1.7;
}

#bbpress-forums div.bbp-topic-content p,
#bbpress-forums div.bbp-reply-content p {
  color: var(--color-text-primary) !important;
}

/* Topic List Items */
#bbpress-forums .bbp-topics .bbp-body .bbp-topic-title,
#bbpress-forums .bbp-topics .bbp-body a {
  color: var(--color-primary);
}

#bbpress-forums .bbp-topics .bbp-body .bbp-topic-permalink {
  color: var(--color-primary) !important;
  font-weight: 600;
  font-size: 15px;
}

#bbpress-forums .bbp-topic-started-by,
#bbpress-forums .bbp-topic-started-in,
#bbpress-forums p.bbp-topic-meta {
  color: var(--color-text-secondary) !important;
  font-size: 13px;
}

#bbpress-forums p.bbp-topic-meta a {
  color: var(--color-primary) !important;
}

#bbpress-forums .bbp-topics .bbp-body li,
#bbpress-forums ul.bbp-topics li.bbp-body li {
  background: var(--color-bg-primary);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-lg) var(--space-md);
}

#bbpress-forums .bbp-topics .bbp-body li:hover,
#bbpress-forums ul.bbp-topics li.bbp-body li:hover {
  background: var(--color-bg-elevated);
}

/* Topic counts and freshness */
#bbpress-forums .bbp-topic-voice-count,
#bbpress-forums .bbp-topic-reply-count,
#bbpress-forums .bbp-topic-freshness {
  color: var(--color-text-secondary) !important;
}

#bbpress-forums .bbp-topic-freshness a,
#bbpress-forums .bbp-forum-freshness a {
  color: var(--color-primary) !important;
}

/* Single Topic/Reply Display - 共通 */
#bbpress-forums div.bbp-topic-author,
#bbpress-forums div.bbp-reply-author {
  background: var(--color-bg-elevated);
  padding: var(--space-md);
  border-radius: var(--radius-md);
}

/* Avatar size - smaller */
#bbpress-forums .bbp-topic-author img.avatar,
#bbpress-forums .bbp-reply-author img.avatar {
  width: 50px !important;
  height: 50px !important;
  border-radius: var(--radius-md);
}

/* Topic Content - 元の投稿を強調（青いライン） */
#bbpress-forums div.bbp-topic-content {
  background: var(--color-bg-card) !important;
  padding: var(--space-xl);
  border-radius: var(--radius-md);
  line-height: 1.8;
  font-size: 14px;
  border-left: 4px solid var(--color-primary) !important;
}

/* Reply Content - 返信は控えめに（グレーのライン） */
#bbpress-forums div.bbp-reply-content {
  background: var(--color-bg-elevated) !important;
  padding: var(--space-xl);
  border-radius: var(--radius-md);
  line-height: 1.8;
  font-size: 14px;
  border-left: 4px solid var(--color-text-muted) !important;
}

/* ========================================
   Single Topic/Reply Page Layout
======================================== */

/* トピック詳細ページのコンテナ */
#bbpress-forums .bbp-body {
  display: block;
}

/* トピック（元の投稿）のラッパー */
#bbpress-forums #post-0,
#bbpress-forums .bbp-lead-topic,
#bbpress-forums div.topic {
  background: rgba(13, 110, 253, 0.05);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  border: 2px solid rgba(13, 110, 253, 0.2);
}

/* 返信（リプライ）のラッパー */
#bbpress-forums div.reply,
#bbpress-forums .bbp-replies div.reply {
  background: var(--color-bg-primary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  padding: var(--space-lg);
  margin-left: var(--space-xl);
  border: 1px solid var(--color-border);
}

/* 管理リンクのスタイル */
#bbpress-forums .bbp-admin-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

#bbpress-forums .bbp-admin-links a {
  background: var(--color-bg-elevated);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--color-text-secondary) !important;
  text-decoration: none;
}

#bbpress-forums .bbp-admin-links a:hover {
  background: var(--color-primary);
  color: white !important;
}

/* Revision log - 完全に非表示 */
#bbpress-forums .bbp-topic-revision-log,
#bbpress-forums .bbp-reply-revision-log,
#bbpress-forums ul.bbp-topic-revision-log,
#bbpress-forums ul.bbp-reply-revision-log,
#bbpress-forums p.bbp-topic-revision-log,
#bbpress-forums p.bbp-reply-revision-log {
  display: none !important;
}

/* Reply Form */
#bbpress-forums div.bbp-reply-form {
  margin-top: var(--space-xl);
}

/* Subscription Link */
#bbpress-forums .bbp-topic-subscription a,
#bbpress-forums .bbp-forum-subscription a {
  color: var(--color-primary) !important;
}

/* Reply to link */
#bbpress-forums a.bbp-reply-to-link {
  color: var(--color-primary) !important;
  font-size: 13px;
}

/* Post metadata */
#bbpress-forums .bbp-meta {
  color: var(--color-text-secondary) !important;
}

#bbpress-forums .bbp-meta a {
  color: var(--color-primary) !important;
}

/* Author Info */
#bbpress-forums .bbp-topic-author,
#bbpress-forums .bbp-reply-author {
  color: var(--color-text-secondary);
}

#bbpress-forums .bbp-author-name {
  color: var(--color-primary);
  font-weight: 600;
}

/* Breadcrumb */
#bbpress-forums .bbp-breadcrumb {
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
}

#bbpress-forums .bbp-breadcrumb a {
  color: var(--color-primary);
}

/* Pagination */
#bbpress-forums .bbp-pagination-links a,
#bbpress-forums .bbp-pagination-links span {
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
}

#bbpress-forums .bbp-pagination-links a:hover {
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
}

#bbpress-forums .bbp-pagination-links span.current {
  background: var(--color-accent);
  color: white;
}

/* Topic Tags */
#bbpress-forums .bbp-topic-tags a {
  background: var(--color-bg-elevated);
  color: var(--color-text-secondary);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
}

/* Search Form */
#bbpress-forums #bbp-search-form {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  justify-content: flex-end;
}

#bbpress-forums #bbp-search-form input[type="text"],
#bbpress-forums .bbp-search-form input[type="text"] {
  min-width: 250px;
  max-width: 400px;
  padding: var(--space-md) var(--space-lg);
  font-size: 1.05rem;
  background: var(--color-bg-primary);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
}

#bbpress-forums #bbp-search-form input[type="text"]:focus,
#bbpress-forums .bbp-search-form input[type="text"]:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

#bbpress-forums #bbp-search-form input[type="submit"],
#bbpress-forums .bbp-search-form input[type="submit"] {
  padding: var(--space-md) var(--space-xl) !important;
  font-size: 1.05rem !important;
  min-width: 80px;
}

[data-theme="dark"] #bbpress-forums #bbp-search-form input[type="text"],
[data-theme="dark"] #bbpress-forums .bbp-search-form input[type="text"] {
  background: var(--color-bg-elevated);
  border-color: var(--color-border-hover);
  color: #ffffff;
}

[data-theme="dark"] #bbpress-forums #bbp-search-form input[type="text"]::placeholder {
  color: var(--color-text-muted);
}

/* Subscriptions */
#bbpress-forums .bbp-subscribe-link a {
  color: var(--color-primary);
}

/* Dark Mode Specific Adjustments */
[data-theme="dark"] #bbpress-forums {
  background: var(--color-bg-card);
}

[data-theme="dark"] #bbpress-forums,
[data-theme="dark"] #bbpress-forums p,
[data-theme="dark"] #bbpress-forums span,
[data-theme="dark"] #bbpress-forums div,
[data-theme="dark"] #bbpress-forums li,
[data-theme="dark"] #bbpress-forums label {
  color: var(--color-text-primary);
}

[data-theme="dark"] #bbpress-forums li.bbp-body ul.forum,
[data-theme="dark"] #bbpress-forums li.bbp-body ul.topic,
[data-theme="dark"] #bbpress-forums .bbp-topics .bbp-body li,
[data-theme="dark"] #bbpress-forums ul.bbp-topics li.bbp-body li {
  background: var(--color-bg-primary);
}

[data-theme="dark"] #bbpress-forums input[type="text"],
[data-theme="dark"] #bbpress-forums input[type="email"],
[data-theme="dark"] #bbpress-forums textarea,
[data-theme="dark"] #bbpress-forums select {
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
}

[data-theme="dark"] #bbpress-forums .bbp-author-role,
[data-theme="dark"] #bbpress-forums .bbp-author-ip {
  color: var(--color-text-muted) !important;
}

[data-theme="dark"] #bbpress-forums div.bbp-topic-author,
[data-theme="dark"] #bbpress-forums div.bbp-reply-author {
  background: var(--color-bg-elevated);
}

/* Dark mode - Topic content (元の投稿・青ライン) */
[data-theme="dark"] #bbpress-forums div.bbp-topic-content {
  background: var(--color-bg-card) !important;
  border-left-color: var(--color-primary) !important;
}

/* Dark mode - Reply content (返信・グレーライン) */
[data-theme="dark"] #bbpress-forums div.bbp-reply-content {
  background: var(--color-bg-elevated) !important;
  border-left-color: var(--color-text-muted) !important;
}

/* Dark mode - Topic wrapper */
[data-theme="dark"] #bbpress-forums div.topic,
[data-theme="dark"] #bbpress-forums #post-0,
[data-theme="dark"] #bbpress-forums .bbp-lead-topic {
  background: rgba(77, 171, 247, 0.1);
  border-color: rgba(77, 171, 247, 0.25);
}

/* Dark mode - Reply wrapper */
[data-theme="dark"] #bbpress-forums div.reply,
[data-theme="dark"] #bbpress-forums .bbp-replies div.reply {
  background: var(--color-bg-primary);
  border-color: var(--color-border);
}

/* Dark mode additional visibility fixes */
[data-theme="dark"] #bbpress-forums .bbp-pagination-count,
[data-theme="dark"] #bbpress-forums .bbp-topic-count,
[data-theme="dark"] #bbpress-forums .bbp-forum-topic-count,
[data-theme="dark"] #bbpress-forums .bbp-forum-reply-count {
  color: #d0d0d0 !important;
}

[data-theme="dark"] #bbpress-forums .bbp-topic-permalink,
[data-theme="dark"] #bbpress-forums .bbp-forum-title {
  color: var(--color-primary-light) !important;
}

[data-theme="dark"] #bbpress-forums .bbp-topic-started-by,
[data-theme="dark"] #bbpress-forums .bbp-topic-started-in,
[data-theme="dark"] #bbpress-forums p.bbp-topic-meta {
  color: #b0b0b0 !important;
}

[data-theme="dark"] #bbpress-forums fieldset.bbp-form legend {
  color: #ffffff !important;
}

/* Checkbox and notification labels */
#bbpress-forums input[type="checkbox"] {
  width: auto;
  margin-right: var(--space-xs);
}

#bbpress-forums .bbp-form label[for*="notify"],
#bbpress-forums .bbp-form label[for*="subscribe"] {
  display: inline-flex;
  align-items: center;
  font-weight: normal;
  color: var(--color-text-secondary) !important;
}

/* Custom User Info Badges (愛車のみ表示) */
.lamoto-user-info {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

.lamoto-bike-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.3);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: 0.9rem;
  color: var(--color-accent);
}

[data-theme="dark"] .lamoto-bike-badge {
  background: rgba(255, 107, 107, 0.15);
  border-color: rgba(255, 107, 107, 0.3);
  color: var(--color-accent);
}

/* Custom Fields Form (年代・愛車) */
#bbpress-forums .lamoto-custom-fields {
  background: var(--color-bg-elevated);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
}

#bbpress-forums .lamoto-custom-fields legend {
  color: var(--color-text-primary) !important;
  font-weight: 600;
  font-size: 1rem;
  padding: 0 var(--space-sm);
}

#bbpress-forums .lamoto-custom-fields label {
  color: var(--color-text-primary) !important;
  font-weight: 500;
  font-size: 0.9rem;
}

#bbpress-forums .lamoto-custom-fields select,
#bbpress-forums .lamoto-custom-fields input[type="text"] {
  background: var(--color-bg-primary);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  padding: var(--space-sm) var(--space-md);
  font-size: 1rem;
}

#bbpress-forums .lamoto-custom-fields select:focus,
#bbpress-forums .lamoto-custom-fields input[type="text"]:focus {
  border-color: var(--color-primary);
  outline: none;
}

[data-theme="dark"] #bbpress-forums .lamoto-custom-fields {
  background: var(--color-bg-card);
}

[data-theme="dark"] #bbpress-forums .lamoto-custom-fields select,
[data-theme="dark"] #bbpress-forums .lamoto-custom-fields input[type="text"] {
  background: var(--color-bg-elevated);
}

/* ========================================
   強制スタイル - 白背景の完全除去
======================================== */

/* すべての白背景を強制的に除去 */
#bbpress-forums .bbp-topic-header,
#bbpress-forums .bbp-reply-header,
#bbpress-forums div.bbp-topic-header,
#bbpress-forums div.bbp-reply-header,
#bbpress-forums .topic .bbp-topic-header,
#bbpress-forums .reply .bbp-reply-header,
#bbpress-forums div.topic > div.bbp-topic-header,
#bbpress-forums div.reply > div.bbp-reply-header,
#bbpress-forums .bbp-meta,
#bbpress-forums td,
#bbpress-forums tbody td,
#bbpress-forums tr td {
  background: var(--color-bg-elevated) !important;
  background-color: var(--color-bg-elevated) !important;
}

/* ダークモード強制 */
[data-theme="dark"] #bbpress-forums .bbp-topic-header,
[data-theme="dark"] #bbpress-forums .bbp-reply-header,
[data-theme="dark"] #bbpress-forums div.bbp-topic-header,
[data-theme="dark"] #bbpress-forums div.bbp-reply-header,
[data-theme="dark"] #bbpress-forums .topic .bbp-topic-header,
[data-theme="dark"] #bbpress-forums .reply .bbp-reply-header,
[data-theme="dark"] #bbpress-forums div.topic > div.bbp-topic-header,
[data-theme="dark"] #bbpress-forums div.reply > div.bbp-reply-header,
[data-theme="dark"] #bbpress-forums .bbp-meta,
[data-theme="dark"] #bbpress-forums td,
[data-theme="dark"] #bbpress-forums tbody td,
[data-theme="dark"] #bbpress-forums tr td {
  background: #2a3441 !important;
  background-color: #2a3441 !important;
}

/* インラインスタイルの上書き */
#bbpress-forums [style*="background"],
#bbpress-forums .bbp-topic-header[style],
#bbpress-forums .bbp-reply-header[style] {
  background: var(--color-bg-elevated) !important;
}

[data-theme="dark"] #bbpress-forums [style*="background: white"],
[data-theme="dark"] #bbpress-forums [style*="background:#fff"],
[data-theme="dark"] #bbpress-forums [style*="background: #fff"],
[data-theme="dark"] #bbpress-forums [style*="background-color: white"],
[data-theme="dark"] #bbpress-forums [style*="background-color:#fff"],
[data-theme="dark"] #bbpress-forums [style*="background-color: #fff"] {
  background: #2a3441 !important;
  background-color: #2a3441 !important;
}

/* 全般的な白背景の除去 */
[data-theme="dark"] #bbpress-forums *:not(input):not(textarea):not(select) {
  background-color: transparent;
}

[data-theme="dark"] #bbpress-forums div.topic,
[data-theme="dark"] #bbpress-forums div.reply,
[data-theme="dark"] #bbpress-forums .bbp-body {
  background: var(--color-bg-card) !important;
}
