/* コンテンツプロデューサーコース 共通スタイル */

:root {
  --color-text: #1f2328;
  --color-muted: #5c6672;
  --color-border: #e2e6ea;
  --color-bg: #ffffff;
  --color-surface: #f7f9fb;
  --color-accent: #1f6feb;
  --radius: 10px;
  --max-width: 960px;
  --max-width-wide: 1200px;
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP",
    "Yu Gothic", "Meiryo", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.85;
}

a {
  color: var(--color-accent);
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.container-wide {
  max-width: var(--max-width-wide);
}

/* グローバルナビゲーション */

.site-nav {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.site-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 10px;
  padding-bottom: 10px;
}

.site-nav-logo {
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--color-text);
}

.site-nav-logo:hover {
  color: var(--color-accent);
}

.site-nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-link,
.nav-dropdown-summary {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  cursor: pointer;
}

.nav-link:hover,
.nav-dropdown-summary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-summary {
  list-style: none;
}

.nav-dropdown-summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown[open] > .nav-dropdown-summary {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.nav-dropdown-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  min-width: 220px;
  max-height: 70vh;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 6px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(31, 35, 40, 0.12);
}

.nav-dropdown-link {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.5;
  text-decoration: none;
  color: var(--color-text);
}

.nav-dropdown-link:hover {
  background: var(--color-surface);
  color: var(--color-accent);
}

/* トップページのレイアウト */

.index-layout {
  display: block;
}

.index-main {
  min-width: 0;
}

.sidebar {
  display: none;
}

.sidebar-nav {
  position: sticky;
  top: 24px;
}

.sidebar-title {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-muted);
  letter-spacing: 0.04em;
}

.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--color-border);
}

.sidebar-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 0.85rem;
  line-height: 1.5;
  text-decoration: none;
  color: var(--color-muted);
}

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

.sidebar-link.is-current {
  color: var(--color-accent);
  font-weight: 700;
  border-left-color: var(--color-accent);
}

.sidebar-count {
  font-size: 0.72rem;
  color: var(--color-muted);
}

/* 新着講義 */

.new-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 40px;
}

.new-section[hidden] {
  display: none;
}

.new-heading {
  font-size: 1.1rem;
  margin: 0 0 4px;
  padding-left: 10px;
  border-left: 4px solid var(--color-accent);
}

.new-note {
  margin: 0 0 16px;
  font-size: 0.8rem;
  color: var(--color-muted);
}

.card-new {
  border-color: rgba(31, 111, 235, 0.35);
  box-shadow: 0 1px 4px rgba(31, 35, 40, 0.06);
}

/* 固定ページ */

.static-body h2:first-child {
  margin-top: 0;
}

.static-body ul {
  margin: 0 0 1.4em;
  padding-left: 1.5em;
}

.static-body li {
  margin-bottom: 0.4em;
}

.static-body p {
  margin: 0 0 1.4em;
}

.static-body .callout p:last-child {
  margin-bottom: 0;
}

/* ヘッダー・フッター */

.site-header {
  border-bottom: 1px solid var(--color-border);
  padding: 32px 0 24px;
  margin-bottom: 32px;
}

.site-title {
  font-size: 1.5rem;
  margin: 0 0 8px;
}

.site-lead {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.site-footer {
  margin-top: 56px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.85rem;
}

.footer-org {
  margin: 0 0 10px;
  font-weight: 700;
  color: var(--color-text);
}

.footer-menu {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.footer-note {
  margin: 0;
  font-size: 0.8rem;
}

/* 検索ボックス */

.search-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 32px;
}

.search-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.search-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg);
}

.search-input:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.search-status {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--color-muted);
}

.empty-message {
  padding: 24px;
  text-align: center;
  color: var(--color-muted);
  background: var(--color-surface);
  border-radius: var(--radius);
}

/* カテゴリ・カード */

.category-section {
  margin-bottom: 40px;
  scroll-margin-top: 24px;
}

.category-heading {
  font-size: 1.1rem;
  margin: 0 0 16px;
  padding-left: 10px;
  border-left: 4px solid var(--color-accent);
}

.card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 2px 10px rgba(31, 111, 235, 0.08);
}

.card[hidden],
.category-section[hidden] {
  display: none;
}

/* 講義タイプ（本講義 / ミニ講義） */

.card.card-type-main {
  border-left: 3px solid var(--color-accent);
  background: #eaf2ff;
}

.card.card-type-main:hover {
  border-color: var(--color-accent);
  box-shadow: 0 2px 10px rgba(31, 111, 235, 0.12);
}

.card.card-type-mini {
  border-left: 3px solid #c9d3de;
}

.type-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1.6;
  white-space: nowrap;
  vertical-align: middle;
}

.type-badge-main {
  background: var(--color-accent);
  border: 1px solid var(--color-accent);
  color: #ffffff;
  font-weight: 700;
}

.type-badge-mini {
  background: var(--color-bg);
  border: 1px solid #c9d3de;
  color: var(--color-muted);
}

.lecture-meta .type-badge {
  margin-left: 0;
  font-size: 0.78rem;
}

.card-link {
  display: block;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.card-category {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--color-accent);
  background: rgba(31, 111, 235, 0.08);
  border-radius: 999px;
  padding: 2px 10px;
  margin-bottom: 8px;
}

.card-title {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 8px;
}

.card-instructor {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--color-muted);
}

/* 講師アイコン */

.instructor-avatar {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.instructor-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}

.instructor-avatar-lg {
  width: 40px;
  height: 40px;
  font-size: 1rem;
}

.instructor-name {
  min-width: 0;
}

/* 講義詳細 */

.breadcrumb {
  margin: 0 0 12px;
  font-size: 0.85rem;
}

.lecture-title {
  font-size: 1.6rem;
  line-height: 1.5;
  margin: 0 0 12px;
}

.lecture-meta {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.lecture-instructor {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.tag {
  color: var(--color-accent);
  background: rgba(31, 111, 235, 0.08);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.78rem;
}

.video-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 32px;
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.lecture-body {
  font-size: 1rem;
}

.lecture-body p {
  margin: 0 0 1.4em;
}

.body-heading-1,
.body-heading-2 {
  font-size: 1.25rem;
  margin: 2.2em 0 0.8em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.body-heading-3 {
  font-size: 1.05rem;
  margin: 1.8em 0 0.6em;
}

.lecture-body ul,
.lecture-body ol {
  margin: 0 0 1.4em;
  padding-left: 1.5em;
}

.lecture-body li {
  margin-bottom: 0.4em;
}

.lecture-body blockquote {
  margin: 0 0 1.4em;
  padding: 12px 16px;
  border-left: 4px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-muted);
}

.callout {
  padding: 14px 16px;
  background: var(--color-surface);
  border-radius: var(--radius);
  margin-bottom: 1.4em;
}

.code {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
}

.toggle {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 1.4em;
  background: var(--color-surface);
}

.toggle summary {
  cursor: pointer;
  font-weight: 700;
}

.toggle-body {
  padding-top: 8px;
}

.toggle-body p:last-child {
  margin-bottom: 0;
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 1.4em;
}

.body-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.94em;
}

.body-table th,
.body-table td {
  border: 1px solid var(--color-border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.body-table th {
  background: var(--color-surface);
  font-weight: 700;
}

.notice {
  padding: 16px;
  background: var(--color-surface);
  border-radius: var(--radius);
  color: var(--color-muted);
}

.back-link {
  margin-top: 40px;
  font-size: 0.9rem;
}

/* パソコン（サイドバー表示） */

@media (min-width: 960px) {
  .index-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 40px;
    align-items: start;
  }

  .sidebar {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* スマートフォン */

@media (max-width: 600px) {
  body {
    font-size: 15px;
    line-height: 1.8;
  }

  .site-header {
    padding: 24px 0 20px;
    margin-bottom: 24px;
  }

  .site-title {
    font-size: 1.25rem;
  }

  .lecture-title {
    font-size: 1.3rem;
  }

  .card-list {
    grid-template-columns: 1fr;
  }

  .site-nav-inner {
    align-items: flex-start;
  }

  .new-section {
    padding: 16px;
  }

  .nav-dropdown-list {
    left: auto;
    right: 0;
    min-width: 200px;
  }
}

/* ログインページ */

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--color-surface);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: 0 6px 20px rgba(31, 35, 40, 0.06);
}

.login-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  line-height: 1.5;
}

.login-lead {
  margin: 0 0 22px;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.login-error {
  margin: 0 0 18px;
  padding: 10px 12px;
  border: 1px solid #f5c2bd;
  border-radius: 6px;
  background: #fdecea;
  color: #9b1c14;
  font-size: 0.9rem;
}

.login-form {
  margin: 0;
}

.login-label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.85rem;
  font-weight: 700;
}

.login-input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cbd2d9;
  border-radius: 6px;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 16px;
  font-family: inherit;
}

.login-input:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
  border-color: var(--color-accent);
}

.login-button {
  width: 100%;
  margin-top: 18px;
  padding: 12px 20px;
  border: 0;
  border-radius: 6px;
  background: var(--color-accent);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.login-button:hover {
  background: #1a5ccc;
}

.login-note {
  margin: 22px 0 0;
  font-size: 0.8rem;
  color: var(--color-muted);
}
