/* ============================================
   社内マニュアルサイト - 共通スタイル
   ============================================ */

/* --- リセット・基本設定 --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #1a6bb5;
  --primary-dark: #145a96;
  --primary-light: #e8f1fa;
  --primary-50: #f0f6fc;
  --text-main: #1e293b;
  --text-sub: #64748b;
  --text-hint: #94a3b8;
  --bg-page: #f8fafb;
  --bg-white: #ffffff;
  --bg-surface: #f1f5f9;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --transition: 0.2s ease;
}

body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  line-height: 1.7;
  min-height: 100vh;
}

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

a:hover {
  text-decoration: underline;
}

/* --- ヘッダー --- */
.site-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
}

.site-logo:hover {
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon svg {
  width: 20px;
  height: 20px;
}

.site-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.header-nav {
  display: flex;
  gap: 4px;
}

.header-nav a {
  font-size: 13px;
  color: var(--text-sub);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}

.header-nav a:hover,
.header-nav a.active {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
}

/* --- メインコンテンツ --- */
.main-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* --- トップページ：パスワード画面 --- */
.login-section {
  max-width: 420px;
  margin: 80px auto;
  text-align: center;
}

.login-section .logo-icon-large {
  width: 64px;
  height: 64px;
  background: var(--primary);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.login-section .logo-icon-large svg {
  width: 32px;
  height: 32px;
}

.login-section h1 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}

.login-section .subtitle {
  font-size: 14px;
  color: var(--text-sub);
  margin-bottom: 32px;
}

.login-box {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.login-box label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sub);
  text-align: left;
  margin-bottom: 6px;
}

.login-box input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition);
  font-family: inherit;
}

.login-box input[type="password"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 107, 181, 0.1);
}

.login-box .btn-login {
  width: 100%;
  padding: 11px;
  margin-top: 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
  font-family: inherit;
}

.login-box .btn-login:hover {
  background: var(--primary-dark);
}

.login-error {
  color: #dc2626;
  font-size: 13px;
  margin-top: 12px;
  display: none;
}

/* --- トップページ：メニュー画面 --- */
.menu-section {
  display: none;
}

.page-heading {
  margin-bottom: 32px;
}

.page-heading h1 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
}

.page-heading p {
  font-size: 14px;
  color: var(--text-sub);
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.menu-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  text-decoration: none;
  color: var(--text-main);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.menu-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.menu-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.menu-card-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--primary);
}

.menu-card-icon img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.menu-card-body h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.menu-card-body p {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.5;
}

/* --- マニュアルページ --- */
.breadcrumb {
  font-size: 13px;
  color: var(--text-hint);
  margin-bottom: 24px;
}

.breadcrumb a {
  color: var(--text-sub);
}

.breadcrumb span {
  margin: 0 6px;
}

.manual-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.manual-item {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.manual-item-header {
  padding: 20px 24px 16px;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}

.manual-item-header:hover {
  background: var(--primary-50);
}

.manual-item-header h2 {
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.manual-item-header h2 .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.manual-item-header h2 .accordion-arrow {
  margin-left: auto;
  transition: transform 0.25s ease;
  color: var(--text-hint);
  flex-shrink: 0;
}

.manual-item.open .manual-item-header h2 .accordion-arrow {
  transform: rotate(180deg);
}

.manual-item-header p {
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 4px;
  padding-left: 36px;
}

.manual-item-body {
  display: none;
}

.manual-item.open .manual-item-body {
  display: block;
  border-top: 1px solid var(--border);
}

/* 動画エリア */
.video-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #000;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-hint);
  font-size: 14px;
}

/* スライド画像エリア */
.slides-section {
  padding: 20px 24px 24px;
}

.slides-section h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-sub);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.slides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.slide-thumb {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  aspect-ratio: 16 / 9;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-thumb:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.slide-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-thumb .placeholder {
  font-size: 12px;
  color: var(--text-hint);
}

/* --- よくある質問ページ --- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-question {
  padding: 16px 24px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background var(--transition);
  user-select: none;
}

.faq-question:hover {
  background: var(--primary-50);
}

.faq-question .q-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.faq-question .arrow {
  margin-left: auto;
  transition: transform 0.25s ease;
  color: var(--text-hint);
  flex-shrink: 0;
}

.faq-item.open .faq-question .arrow {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-answer-inner {
  padding: 0 24px 20px;
  padding-left: 64px;
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.8;
}

/* --- モーダル（スライド拡大表示） --- */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  max-width: 900px;
  max-height: 90vh;
  border-radius: var(--radius);
  overflow: hidden;
}

.modal-content img {
  width: 100%;
  height: auto;
  display: block;
}

.modal-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 1010;
}

.modal-close:hover {
  background: rgba(255,255,255,0.3);
}

.modal-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 1010;
}

.modal-nav:hover {
  background: rgba(255,255,255,0.35);
}

.modal-prev {
  left: 20px;
}

.modal-next {
  right: 20px;
}

.modal-counter {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  font-family: 'Noto Sans JP', sans-serif;
  z-index: 1010;
}

/* --- フッター --- */
.site-footer {
  text-align: center;
  padding: 32px 24px;
  font-size: 12px;
  color: var(--text-hint);
  border-top: 1px solid var(--border);
  margin-top: 60px;
}

/* --- レスポンシブ --- */
@media (max-width: 640px) {
  /* ヘッダー：ナビをスクロール可能な横並びに */
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 0 16px;
  }

  .header-nav {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    gap: 2px;
  }

  .header-nav a {
    font-size: 12px;
    padding: 5px 10px;
    flex-shrink: 0;
  }

  .site-title {
    font-size: 15px;
  }

  .menu-grid {
    grid-template-columns: 1fr;
  }

  .slides-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .main-content {
    padding: 24px 16px 60px;
  }

  .login-section {
    margin: 40px auto;
  }

  .faq-answer-inner {
    padding-left: 24px;
  }

  /* モーダル：スマホ用にパディングを縮小 */
  .modal-overlay {
    padding: 16px;
  }

  .modal-nav {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }

  .modal-prev {
    left: 8px;
  }

  .modal-next {
    right: 8px;
  }

  .modal-close {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
  }

  .modal-content {
    max-height: 70vh;
  }
}