/* ======================================================================
   02-layout.css | Site Layout（左/中央/右 と モバイルヘッダー/フッター）
====================================================================== */

/* ---- 共通トークン（高さ/セーフエリア） ---- */
:root {
  --mobile-header-h: 56px;
  --mobile-footer-h: 56px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* フッター分のスクロール余白（.main 等に適用） */
  --mobile-footer-space: calc(var(--mobile-footer-h) + var(--safe-bottom));
}

/* 左サイドバー */
.sidebar {
  width: var(--width-sidebar);
  padding: 20px 0 0 20px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: hidden;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);

  /* 左サイドバーとメイン欄の間に少し余白 */
  padding-right: 10px;
  box-sizing: border-box;
}

.sidebar .logo {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 30px;
}

.sidebar .logo a {
  color: inherit;
  text-decoration: none;
}

/* ===== 左サイドバーのナビボタン ===== */
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px 14px 16px;
  font-size: 18px;
  border-radius: var(--radius-pill);
  transition: all 0.25s ease;
  margin-bottom: 6px;
}

/* hover時：少し明るいグレーで浮かせる */
.sidebar nav a:hover {
  background: var(--color-surface-2);
  transform: none;
  /* ←会社っぽくするなら動かさない */
}

/* active時：hoverより少し暗めで固定感を出す */
.sidebar nav a.active {
  background: var(--color-surface);
  font-weight: 600;
  transform: none;
}

/* ============================= */
/* 投稿ボタン（会社っぽく控えめ） */
/* ============================= */
.sidebar nav a.post-link {
  background: rgba(29, 155, 240, 0.10);
  /* 薄いブランド色 */
  color: #eaf6ff;
  /* ほぼ白 */
  font-weight: 700;
  border-radius: var(--radius-pill);
  margin-top: 14px;
  margin-bottom: 0;

  border: 1px solid rgba(29, 155, 240, 0.35);
  /* うるさくない枠 */
  box-shadow: none;
  /* 影は消して上品に */
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.sidebar nav a.post-link i {
  color: inherit;
  /* 文字と同じ色 */
}

.sidebar nav a.post-link:hover {
  background: rgba(29, 155, 240, 0.16);
  border-color: rgba(29, 155, 240, 0.55);
  transform: translateY(-1px);
  /* “ちょい”だけ */
}

.sidebar nav a.post-link:active {
  transform: translateY(0);
  background: rgba(29, 155, 240, 0.20);
}

.sidebar nav a.post-link.active {
  background: rgba(29, 155, 240, 0.18);
  border-color: rgba(29, 155, 240, 0.60);
  font-weight: 800;
  transform: none;
}

/* 中央カラム（スクロール担当） */
.main {
  width: var(--width-main);
  border-inline: 1px solid var(--color-border);
  overflow-y: auto;
  position: relative;
}

/* 右サイドバー（PC） */
.sidebar-right {
  width: var(--width-right);
  padding: 20px;
  gap: 20px;
  height: 100vh;
  overflow-y: auto;
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.sidebar-right section,
.sidebar-right h2,
.sidebar-right .search-filter {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

/* ===================== モバイル上部バー（header_mobile.php） ===================== */
/* PCでは非表示（モバイルで display を切り替える） */
.header-mobile {
  display: none;
  position: fixed;
  inset: 0 0 auto 0;
  background: var(--color-surface);
  border-bottom: 1px solid #222;
  height: var(--mobile-header-h);
  padding: 0 12px;
  z-index: var(--z-mobile-header);
  align-items: center;
  justify-content: space-between;

  /* スクロールで隠すとき用 */
  transition: transform .25s ease, opacity .25s ease;
  will-change: transform, opacity;
}

/* スクロールで上に隠す */
.header-mobile.is-hidden {
  transform: translateY(calc(-1 * (var(--mobile-header-h) + var(--safe-top))));
  opacity: 0;
}

/* ロゴ（Nursenavi の文字） */
.logo-mobile {
  font-size: 1.3rem;
  white-space: nowrap;
  margin: 0 10px;
}

.logo-mobile a {
  text-decoration: none;
  color: inherit;
}

/* 検索ボックス（中央寄せ・余白少なめ） */
.header-search {
  width: min(60vw, 220px);
  height: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  padding: 0 8px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
}

.header-search i {
  font-size: 14px;
  color: var(--color-muted-2);
  line-height: 1;
}

.header-search input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-text);
  font-size: 14px;
  width: 100%;
  padding: 0;
  height: 100%;
}

/* 右側のアイコン群（通知など） */
.right-group {
  display: flex;
  gap: 10px;
  margin-right: 10px;
}

/* ===================== モバイル下部バー（footer_mobile.php） ===================== */
.footer-mobile {
  display: none;
  position: fixed;
  inset: auto 0 0 0;
  background: #111;
  border-top: 1px solid #222;
  height: var(--mobile-footer-h);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: var(--z-mobile-header);
  justify-content: space-around;
  align-items: center;
  backdrop-filter: blur(6px);
}

/* 各リンク（アイコン＋文字） */
.footer-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ccc;
  text-decoration: none;
  font-size: 12px;
  transition: all 0.25s ease;
  gap: 3px;
  position: relative;
}

/* hover時：ふんわり明るく＆少し上に浮く */
.footer-link:hover {
  color: #fff;
  transform: translateY(-3px);
}

/* active時：アイコン下にラインを出して「選択中感」 */
.footer-link.active {
  color: #fff;
  font-weight: 600;
}

/* footer-link.active::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    border-radius: 3px;
    background: #fff;
} */

/* アイコンの大きさとアニメーション */
.footer-link i {
  font-size: 20px;
  line-height: 1;
  transition: transform 0.25s ease, color 0.25s ease;
}

.footer-link:hover i {
  transform: translateY(-2px) scale(1.1);
}

.footer-link.active i {
  transform: scale(1.2);
}

/* ===================== モバイルブレークポイント ===================== */
@media (max-width:950px) {

  /* PC用サイドバーは非表示、中央は全幅 */
  .sidebar,
  .sidebar-right {
    display: none;
  }

  .main {
    width: 100%;
  }

  /* モバイルヘッダーを表示（ロゴ | 検索 | 右側） */
  .header-mobile {
    display: grid;
    grid-template-columns: auto 1fr auto;
    column-gap: 12px;
    align-items: center;
    padding-left: max(12px, calc(12px + var(--safe-top)));
  }

  .header-search {
    grid-column: 2;
    justify-self: center;
  }

  .right-group {
    grid-column: 3;
    justify-self: end;
  }

  /* モバイルフッターを表示 */
  .footer-mobile {
    display: flex;
  }

  body {
    padding-top: 0;
    padding-bottom: 0;
  }

  /* ✅ 基本：ヘッダー高さぶんだけ下げる */
  .main {
    padding-top: var(--mobile-header-h);
    padding-bottom: var(--mobile-footer-space);
    box-sizing: border-box;
    margin-top: 0;
    transition: padding-top .25s ease;
  }

  /* ✅ ヘッダーが隠れているとき（スクロールで隠したとき） */
  body.header-hidden .main {
    padding-top: 0;
  }

  /* ✅ そもそも Nursenavi ヘッダーが無いページ用
            → 最初から余白ゼロで上まで詰める */
  body.no-mobile-header .main {
    padding-top: 0;
  }
}

/* 共通：ヘッダーの小アイコン（検索・通知など）の行間詰め */
.icon-button i {
  line-height: 1;
  display: inline-block;
}

/* ===== PCでは＋ボタン非表示 ===== */
#feed-post-btn {
  display: none;
}

/* ===== スマホ用（950px以下） ===== */
@media (max-width: 950px) {
  #feed-post-btn {
    display: flex;
    position: fixed;
    bottom: 70px;
    right: 16px;
    width: 58px;
    height: 58px;

    /* ★ 視認性アップ用 */
    background: rgba(29, 155, 240, 0.85);
    /* ほぼベタに近い青 */
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.65);
    /* 白縁で白背景でも沈まない */
    border-radius: 50%;

    font-size: 30px;
    font-weight: 600;
    justify-content: center;
    align-items: center;
    text-decoration: none;

    /* 影は「薄く・広く」 */
    box-shadow:
      0 6px 18px rgba(0, 0, 0, 0.35),
      0 2px 6px rgba(0, 0, 0, 0.25);

    transition:
      background .2s ease,
      box-shadow .2s ease,
      transform .2s ease,
      opacity .2s ease;

    z-index: 999;
  }

  #feed-post-btn:hover {
    background: rgba(29, 155, 240, 0.95);
    transform: translateY(-2px);
    box-shadow:
      0 8px 22px rgba(0, 0, 0, 0.45),
      0 3px 8px rgba(0, 0, 0, 0.3);
  }

  /* スクロール中は「邪魔しない」 */
  body.scrolling #feed-post-btn {
    opacity: 0.65;
    transform: none;
    background: rgba(29, 155, 240, 0.70);
    box-shadow:
      0 3px 10px rgba(0, 0, 0, 0.25);
  }
}

/* support.php専用スタイル */
.support-section {
  text-align: center;
  padding: 40px 16px;
}

.support-section h1 {
  font-size: 28px;
  margin-bottom: 30px;
  color: #f5f5f5;
  letter-spacing: 0.05em;
}

.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
  max-width: 500px;
  margin: 0 auto;
}

.support-grid a {
  display: flex;
  justify-content: center;
  align-items: center;
  aspect-ratio: 1 / 1;
  /* 正方形 */
  background: linear-gradient(145deg, #2c2c2c, #1a1a1a);
  color: #f2f2f2;
  font-weight: 600;
  font-size: 16px;
  border-radius: 14px;
  text-decoration: none;
  box-shadow:
    4px 4px 10px rgba(0, 0, 0, 0.6),
    -4px -4px 10px rgba(255, 255, 255, 0.05);
  transition: all 0.25s ease;
}

.support-grid a:hover {
  transform: translateY(-4px);
  background: linear-gradient(145deg, #3a3a3a, #1f1f1f);
  box-shadow:
    6px 6px 12px rgba(0, 0, 0, 0.7),
    -6px -6px 12px rgba(255, 255, 255, 0.08);
  color: #fff;
}


/* 戻るバーは必ず最前面 */
.back-bar {
  position: sticky;
  /* スクロール追従 */
  top: 0;
  z-index: 99999;
  /* ← 超重要：全UIより前 */
  background: #0f0f0f;
}

/* 戻るボタン自体も念のため前面 */
.back-bar button {
  position: relative;
  z-index: 100000;
}

.post img,
.post-image,
.lb,
.lb-stage,
.post-overlay {
  z-index: 1;
}




/* ==========================================================
   LIGHT THEME OVERRIDES (02-layout.css)
   貼る場所：02-layout.css の末尾
========================================================== */

/* ===== スマホ下バー（footer_mobile.php）をライト対応 ===== */
:root[data-theme="light"] .footer-mobile {
  background: rgba(255, 255, 255, .92) !important;
  border-top: 1px solid rgba(15, 23, 42, .12) !important;
  color: #0f172a !important;
  backdrop-filter: blur(10px) saturate(1.2);
}

/* リンク色（通常/hover/active） */
:root[data-theme="light"] .footer-link {
  color: #475569 !important;
  /* slate */
}

:root[data-theme="light"] .footer-link:hover {
  color: #0f172a !important;
}

:root[data-theme="light"] .footer-link.active {
  color: #0f172a !important;
  font-weight: 700;
}

/* アイコンも currentColor で追従（念のため） */
:root[data-theme="light"] .footer-link i {
  color: currentColor !important;
}

/* ===== PC左の「投稿する」ボタン（.post-link）をライトで見やすく ===== */
:root[data-theme="light"] .sidebar nav a.post-link {
  background: rgba(29, 155, 240, .14) !important;
  color: #0b63ce !important;
  /* 文字を青寄りにしてコントラスト確保 */
  border: 1px solid rgba(29, 155, 240, .35) !important;
}

:root[data-theme="light"] .sidebar nav a.post-link:hover {
  background: rgba(29, 155, 240, .20) !important;
  border-color: rgba(29, 155, 240, .55) !important;
}

:root[data-theme="light"] .sidebar nav a.post-link.active {
  background: rgba(29, 155, 240, .22) !important;
  border-color: rgba(29, 155, 240, .60) !important;
  color: #0a57b5 !important;
}

/* ===== 戻るバー（ついでにライトで白文字問題を潰す） ===== */
:root[data-theme="light"] .back-bar {
  background: rgba(255, 255, 255, .92) !important;
  border-bottom: 1px solid rgba(15, 23, 42, .12) !important;
}

:root[data-theme="light"] .back-bar button,
:root[data-theme="light"] .back-bar h1 {
  color: #0f172a !important;
}











/* ==========================================================
   LIGHT MODE UPGRADE (soft / corporate)
   貼る場所：02-layout.css の末尾
========================================================== */
:root[data-theme="light"] {
  /* “白黒すぎ”回避：少しだけ色味のある明るいグレー */
  --lt-bg: #f6f7fb;
  --lt-surface: #ffffff;
  --lt-surface-2: #f1f5f9;
  --lt-border: rgba(15, 23, 42, .10);
  --lt-border-2: rgba(15, 23, 42, .14);
  --lt-text: #0f172a;
  --lt-muted: #64748b;

  /* 会社っぽい落ち着いた青 */
  --lt-primary: #2563eb;
  --lt-primary-soft: rgba(37, 99, 235, .12);

  /* 影は“薄く・広く” */
  --lt-shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --lt-shadow-md: 0 8px 24px rgba(15, 23, 42, .08);
}

/* ページ全体の空気感（真っ白→やわらかい） */
:root[data-theme="light"] body {
  background: var(--lt-bg) !important;
  color: var(--lt-text) !important;
}

/* カラム背景を“白カード＋薄影”へ（白黒ベタ回避） */
:root[data-theme="light"] .main {
  background: transparent !important;
  /* 背景は body に任せる */
  border-inline: 1px solid var(--lt-border) !important;
}

:root[data-theme="light"] .sidebar,
:root[data-theme="light"] .sidebar-right {
  background: transparent !important;
}

/* 左サイドバー：カード感（でも控えめ） */
:root[data-theme="light"] .sidebar {
  background: var(--lt-surface) !important;
  border-right: 1px solid var(--lt-border) !important;
  box-shadow: var(--lt-shadow-sm);
}

:root[data-theme="light"] .sidebar nav a {
  color: var(--lt-text) !important;
}

:root[data-theme="light"] .sidebar nav a:hover {
  background: rgba(15, 23, 42, .04) !important;
}

:root[data-theme="light"] .sidebar nav a.active {
  background: rgba(37, 99, 235, .10) !important;
  border: 1px solid rgba(37, 99, 235, .18) !important;
}

/* モバイルヘッダー：白黒ベタ→薄いガラス感 */
:root[data-theme="light"] .header-mobile {
  background: rgba(255, 255, 255, .86) !important;
  border-bottom: 1px solid var(--lt-border) !important;
  backdrop-filter: blur(12px) saturate(1.2);
}

:root[data-theme="light"] .logo-mobile,
:root[data-theme="light"] .logo-mobile a {
  color: var(--lt-text) !important;
}

/* 検索：白の上で沈まない */
:root[data-theme="light"] .header-search {
  background: rgba(15, 23, 42, .04) !important;
  border: 1px solid var(--lt-border) !important;
}

:root[data-theme="light"] .header-search input {
  color: var(--lt-text) !important;
}

:root[data-theme="light"] .header-search i {
  color: var(--lt-muted) !important;
}

/* モバイルフッター：アイコンが白黒すぎ→少し“ブランド青”を混ぜる */
:root[data-theme="light"] .footer-mobile {
  background: rgba(255, 255, 255, .90) !important;
  border-top: 1px solid var(--lt-border) !important;
  backdrop-filter: blur(12px) saturate(1.2);
  box-shadow: 0 -10px 30px rgba(15, 23, 42, .06);
}

:root[data-theme="light"] .footer-link {
  color: var(--lt-muted) !important;
}

:root[data-theme="light"] .footer-link.active {
  color: var(--lt-primary) !important;
}

:root[data-theme="light"] .footer-link:hover {
  color: var(--lt-text) !important;
}