/* ===================== 基本 ===================== */
body {
  background: #f5f5f5;
}

/* ===================== ヘッダー ===================== */
.site-header {
  font-size: 14px;
}

/* 上部細いバー */
.header-top {
  background: #f5f5f5;
  border-bottom: 1px solid #ddd;
}

.header-top-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #555;
}

.header-top-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-top-right {
  text-align: right;
}

/* メインヘッダー（旧 .header-main） */
.header-main {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* ロゴまわり */
.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo img {
  height: 40px;
  width: auto;
  display: block;
}

.header-title-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.header-title-main {
  font-size: 16px;
  font-weight: 700;
}

.header-title-sub {
  font-size: 11px;
  color: #666;
}

/* ナビゲーション */
.header-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-nav a {
  text-decoration: none;
  color: #333;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.header-nav a:hover {
  background: #f2f2f2;
}

/* 目立たせたいボタン風 */
.header-nav .nav-cta {
  background: #e53935;
  color: #fff;
  font-weight: 600;
}

.header-nav .nav-cta:hover {
  background: #d32f2f;
}

/* ===================== メインエリア共通 ===================== */
.page-main {
  max-width: 1100px;
  margin: 12px auto 32px;
  padding: 0 16px 24px;
}

/* タブバー */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  border-bottom: 1px solid #ddd;
}

.tab-link {
  border: none;
  background: transparent;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  color: #666;
  border-radius: 8px 8px 0 0;
  position: relative;
}

.tab-link.is-active {
  color: #e53935;
  font-weight: 600;
  background: #fff;
  border: 1px solid #ddd;
  border-bottom-color: #fff;
}

/* タブコンテンツ */
.tab-content {
  display: none;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 0 8px 8px 8px;
  padding: 12px;
}

.tab-content.is-active {
  display: block;
}

/* 通常セクション用 */
.section-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  margin-bottom: 16px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  border-left: 4px solid #d32f2f;
  padding-left: 8px;
  margin-bottom: 8px;
}

/* ===================== 公式Xカード ===================== */

.home-x-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.home-x-card {
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  font-size: 12px;
  line-height: 1.5;
}

.home-x-meta {
  font-size: 11px;
  color: #666;
  margin-top: 6px;
}

.home-x-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #1DA1F2;
  text-decoration: none;
  margin-top: 2px;
}

.home-x-link:hover {
  text-decoration: underline;
}

/* ===================== フッター ===================== */
.site-footer {
  background: #333;
  color: #eee;
  font-size: 12px;
  padding: 16px 0;
  margin-top: 32px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

.footer-links a {
  color: #eee;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* ===================== ヘッダー（PC/SP切り替え後） ===================== */

/* PCヘッダー全体 */
.site-header.pc-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e5e5;
}

.pc-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.pc-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pc-logo-img {
  height: 56px;      /* しっかり大きく */
  width: auto;
  display: block;
}

.pc-logo-subtitle {
  font-size: 12px;
  color: #666;
}

/* 右側ナビ */
.pc-main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.pc-main-nav a {
  text-decoration: none;
  color: #333;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.pc-main-nav a:hover {
  background: #f2f2f2;
}

/* 「投稿する」「新規登録」など目立つボタン */
.nav-signup-btn {
  background: #fff;
  color: #e53935;
  border: 2px solid #e53935;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  display: inline-block;
}

.nav-signup-btn:hover {
  background: #e53935;
  color: #fff;
}

/* 細い赤バー（キャッチコピー） */
.pc-topbar {
  background: #d32f2f;
  color: #fff;
  font-size: 11px;
}

.pc-topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pc-topbar-left {
  white-space: nowrap;
}

.pc-topbar-right {
  text-align: right;
}

/* PCヘッダーはスマホでは非表示（SPヘッダーと切り替え） */
.pc-header {
  display: block;
}
.sp-header {
  display: none;
}

@media (max-width: 768px) {
  .pc-header {
    display: none;
  }
  .sp-header {
    display: block;
  }

  .page-main {
    margin-top: 8px;
    padding: 0 10px 24px;
  }

  .tab-bar {
    margin: 4px 0 8px;
  }

  .tab-link {
    padding: 6px 10px;
    font-size: 12px;
  }

  .tab-content {
    padding: 10px;
  }

  .home-x-list {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

/* ===================== SPヘッダー ===================== */
.sp-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e5e5;
}

.sp-header-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sp-header-center .sp-logo img {
  height: 40px;
  width: auto;
  display: block;
}

/* 右側：マイページボタン */
.sp-mypage-btn {
  display: inline-block;
  padding: 6px 10px;
  background: #1976d2;
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  text-decoration: none;
}

/* ===================== SPヘッダー：ハンバーガー＋ドロワー ===================== */

/* ハンバーガー */
.sp-hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #ccc;
  background: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

/* ドロワーメニュー本体（右からスライド） */
.sp-nav {
  position: fixed;
  top: 0;
  right: 0;
  width: 260px;
  max-width: 80%;
  height: 100vh;
  background: #fff;
  box-shadow: -2px 0 8px rgba(0,0,0,0.25);
  transform: translateX(100%);
  transition: transform .25s ease-out;
  z-index: 1200;
  padding: 16px 14px;
}

.sp-nav.is-open {
  transform: translateX(0);
}

/* ナビ内部 */
.sp-nav a {
  display: block;
  padding: 10px 4px;
  border-bottom: 1px solid #eee;
  color: #333;
  text-decoration: none;
}
.sp-nav a:hover {
  background: #f5f5f5;
}

/* 閉じるボタン（右上の ×） */
.sp-nav-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}

/* 認証エリア（ログイン／新規登録 or ユーザー名＋マイページ） */
.sp-nav-auth {
  margin: 16px 0 10px;
  padding: 8px 10px 12px;
  border-radius: 10px;
  background: #f5f5f5;
}

.sp-auth-user {
  font-size: 12px;
  margin-bottom: 6px;
}

.sp-auth-btn {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  text-decoration: none;
  margin-right: 6px;
}

.sp-auth-login {
  background: #1976d2;
  color: #fff;
}

.sp-auth-register {
  background: #2e7d32;
  color: #fff;
}

.sp-nav-divider {
  margin: 8px 0;
  border-top: 1px solid #eee;
}

/* オーバーレイ */
.sp-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 1190;
}
.sp-nav-overlay.is-show {
  opacity: 1;
  pointer-events: auto;
}

/* PCではSPヘッダー非表示（再確認用） */
@media (min-width: 769px) {
  .sp-header { display: none; }
}

/* SPではPCヘッダーを隠したい場合（念のため） */
@media (max-width: 768px) {
  .pc-header { display: none; }
}

/* =========================================
   SPハンバーガーメニュー 最終上書きCSS
========================================= */
@media (max-width: 768px) {

  /* ドロワーメニュー本体：右に隠しておく */
  .sp-header .sp-nav {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    width: 260px !important;
    max-width: 80% !important;
    height: 100vh !important;
    background: #fff !important;
    box-shadow: -2px 0 8px rgba(0,0,0,0.25) !important;
    transform: translateX(100%) !important;  /* 右の外に待機 */
    transition: transform .25s ease-out !important;
    z-index: 1200 !important;
    padding: 16px 14px !important;
    display: block !important;               /* display:none を無効化 */
  }

  /* 開いたとき：画面内にスライドイン */
  .sp-header .sp-nav.is-open {
    transform: translateX(0) !important;
  }

  /* オーバーレイ（グレー背景） */
  #spNavOverlay.sp-nav-overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0,0,0,0.45) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity .2s ease !important;
    z-index: 1190 !important;
  }

  #spNavOverlay.sp-nav-overlay.is-show {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}

/* =========================================
   SPハンバーガーメニュー 最終制御
   （JSの is-open / is-show と連動させる）
========================================= */
@media (max-width: 768px) {

  /* ▼ ドロワーメニュー本体：通常時は右に隠す */
  .sp-header .sp-nav {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    width: 260px !important;
    max-width: 80% !important;
    height: 100vh !important;
    background: #fff !important;
    box-shadow: -2px 0 8px rgba(0,0,0,0.25) !important;
    transform: translateX(100%) !important;  /* ← ここがポイント：閉じてるときは右の外 */
    transition: transform .25s ease-out !important;
    z-index: 1200 !important;
    padding: 16px 14px !important;
    display: block !important;               /* display:none を潰す */
  }

  /* ▼ is-open が付いたときだけ画面内に出す */
  .sp-header .sp-nav.is-open {
    transform: translateX(0) !important;
  }

  /* ▼ オーバーレイ（グレーの背景） */
  #spNavOverlay.sp-nav-overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0,0,0,0.45) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity .2s ease !important;
    z-index: 1190 !important;
  }

  #spNavOverlay.sp-nav-overlay.is-show {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}
