/* ========================================
   shared.css - カブまなび 共通スタイル
   CSS変数・リセット・ナビ・フッター
   ======================================== */

:root {
  --bg: #f8f9fc;
  --white: #ffffff;
  --text: #1a1a2e;
  --text2: #4a4a6a;
  --text3: #8888a8;
  --border: #e8e8f0;
  --accent: #4f46e5;
  --accent-light: #eef2ff;
  --green: #10b981;
  --green-bg: #ecfdf5;
  --red: #ef4444;
  --red-bg: #fef2f2;
  --yellow: #f59e0b;
  --yellow-bg: #fffbeb;
  --blue: #3b82f6;
  --blue-bg: #eff6ff;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans JP', 'Inter', sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ====== ナビゲーション ====== */
nav.site-nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.nav-logo span { font-size: 24px; }
/* サイドバーメニュー（PC・モバイル共通） */
.nav-links {
  display: flex !important;
  position: fixed;
  top: 0; right: 0; bottom: 0;
  left: auto;
  width: 300px;
  max-width: 85vw;
  background: var(--white);
  flex-direction: column;
  gap: 0;
  padding: 72px 24px 24px;
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}
.nav-links.open { transform: translateX(0); }
.nav-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--text2);
  text-decoration: none;
  cursor: pointer;
  padding: 12px 0;
  border-bottom: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: all 0.2s;
}
.nav-link:hover, .nav-link.active { color: var(--accent); background: var(--accent-light); border-radius: 8px; padding-left: 12px; }

/* サイドバー内セクション見出し */
.sidebar-section {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 16px 0 6px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.sidebar-section:first-child { border-top: none; margin-top: 0; }

/* ナビドロップダウン（サイドバー内は常に展開） */
.nav-dropdown { width: 100%; }
.nav-dropdown-toggle { display: none; }
.nav-dropdown-menu {
  position: static;
  transform: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  min-width: 0;
  padding: 0;
  background: transparent;
  display: flex !important;
  flex-direction: column;
}
.nav-dropdown-item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  font-size: 14px;
  color: var(--text2);
  text-decoration: none;
  transition: all 0.15s;
  min-height: 40px;
}
.nav-dropdown-item:hover, .nav-dropdown-item.active { color: var(--accent); background: var(--accent-light); border-radius: 8px; padding-left: 12px; }

/* 通知ベル */
.notif-bell-wrap {
  position: relative;
  margin-left: auto;
  margin-right: 12px;
}
.notif-bell {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 22px;
  padding: 4px;
  line-height: 1;
  position: relative;
}
.notif-dot {
  position: absolute;
  top: 2px; right: 0;
  width: 10px; height: 10px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--white);
  display: none;
}
.notif-dot.show { display: block; }
.notif-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: -40px;
  width: 300px;
  max-width: 90vw;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
}
.notif-panel.open { display: block; }
.notif-panel-header {
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}
.notif-item {
  display: block;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--accent-light); }
.notif-item-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
}
.notif-item-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}
.notif-item-date {
  font-size: 11px;
  color: var(--text3);
  margin-top: 4px;
}
.notif-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text3);
}

/* ハンバーガー（常に表示） */
.hamburger {
  display: flex;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
  z-index: 101;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ====== フッター ====== */
.site-footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  margin-top: 40px;
}
.site-footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.site-footer .footer-links a {
  font-size: 13px;
  color: var(--text2);
  text-decoration: none;
}
.site-footer .footer-links a:hover { color: var(--accent); }
.site-footer .footer-copy {
  font-size: 12px;
  color: var(--text3);
}

/* ====== コンテナ ====== */
.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ====== サイドバーオーバーレイ ====== */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 98;
  opacity: 0;
  transition: opacity 0.3s;
}
.sidebar-overlay.open {
  display: block;
  opacity: 1;
}
body.menu-open { overflow: hidden; }

/* ====== モバイル ====== */
@media (max-width: 700px) {
  .nav-links { width: 280px; }
  .site-footer .footer-links { gap: 16px; }
}
