/*
Theme Name: OneStep School
Description: ワンステップ講座 会員サイト用テーマ
Version: 1.0
Author: onestep-school.com
*/

:root {
  --navy: #1a2744;
  --navy-light: #24345c;
  --accent: #3b82f6;
  --accent-dark: #2563eb;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #2b3445;
  --muted: #7b8494;
  --border: #e3e8f0;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic Medium", YuGothic, Meiryo, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.9;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ===== ヘッダー ===== */
.site-header {
  background: var(--navy);
  color: #fff;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(16, 24, 48, .25);
}
.site-header-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.site-brand {
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.site-brand:hover { text-decoration: none; opacity: .9; }
.site-brand .brand-mark {
  display: inline-flex;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 800;
}
.header-nav a {
  color: #c6d2ea;
  font-size: .88rem;
  margin-left: 20px;
}
.header-nav a:hover { color: #fff; text-decoration: none; }

/* ===== レイアウト ===== */
.site-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 36px 20px 80px;
}

.breadcrumb {
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 14px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent-dark); }

.page-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 44px 44px;
  box-shadow: 0 4px 20px rgba(26, 39, 68, .05);
}

.entry-title {
  font-size: 1.6rem;
  line-height: 1.45;
  margin: 0 0 10px;
  color: var(--navy);
  font-weight: 700;
}

/* 本文先頭のコース/章ラベル(移行データ内のインラインp) */
.entry-content > p[style*="color:#888"] {
  display: inline-block;
  background: #eef4ff;
  color: var(--accent-dark) !important;
  font-size: .78rem !important;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 999px;
  margin: 0 0 22px;
}

/* ===== 本文 ===== */
.entry-content {
  font-size: 1rem;
  overflow-wrap: break-word;
  word-break: break-word;
}
/* 長いURL・リンクがはみ出さないよう折り返す */
.entry-content a {
  overflow-wrap: anywhere;
  word-break: break-all;
}
/* 空段落の余白を詰める */
.entry-content p:empty { display: none; }
.entry-content h2, .entry-content h3 {
  color: var(--navy);
  line-height: 1.5;
  margin: 2.2em 0 .8em;
}
.entry-content h3 {
  font-size: 1.12rem;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}
.entry-content p { margin: 0 0 1.1em; }
.entry-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0 24px;
}

/* 動画プレーヤー(アスペクト比ラッパー内のvideo/iframe) */
.entry-content video,
.entry-content iframe {
  border-radius: 10px;
  overflow: hidden;
}

/* 本文画像はフル幅表示・クリックで拡大 */
.entry-content img {
  display: block;
  width: 100%;
  height: auto;
  margin: 1.4em auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: box-shadow .15s;
}
.entry-content img:hover {
  box-shadow: 0 6px 20px rgba(26, 39, 68, .14);
}

/* ライトボックス */
.osb-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 48, .88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s;
  padding: 24px;
  cursor: zoom-out;
}
.osb-lightbox.open { opacity: 1; visibility: visible; }
.osb-lightbox img {
  max-width: 96vw;
  max-height: 92vh;
  width: auto;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, .5);
  cursor: default;
}
.osb-lightbox .osb-close {
  position: absolute;
  top: 18px;
  right: 24px;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  opacity: .8;
  background: none;
  border: none;
}
.osb-lightbox .osb-close:hover { opacity: 1; }

/* ===== 前後ナビ(hr直後のp) ===== */
.entry-content hr + p {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.entry-content hr + p a {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 20px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 600;
  transition: all .15s;
}
.entry-content hr + p a:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(59, 130, 246, .15);
}

/* ===== コーストップの目次 ===== */
.page-parent .entry-content > h3 {
  margin-top: 2em;
  font-size: 1.05rem;
}
.page-parent .entry-content > ul {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}
.page-parent .entry-content > ul > li {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 8px 0;
  background: #fff;
  transition: all .15s;
}
.page-parent .entry-content > ul > li:hover {
  border-color: var(--accent);
  box-shadow: 0 3px 12px rgba(59, 130, 246, .12);
}
.page-parent .entry-content > ul > li > a {
  display: block;
  padding: 12px 18px 12px 44px;
  color: var(--text);
  font-size: .95rem;
  font-weight: 500;
  position: relative;
}
.page-parent .entry-content > ul > li > a:hover { text-decoration: none; color: var(--accent-dark); }
.page-parent .entry-content > ul > li > a::before {
  content: "▶";
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .6rem;
  color: var(--accent);
}

/* ===== 章アコーディオン(コーストップ) ===== */
details.chapter {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 12px 0;
  background: #fff;
  overflow: hidden;
}
details.chapter summary {
  list-style: none;
  cursor: pointer;
  padding: 15px 20px;
  font-weight: 700;
  color: var(--navy);
  font-size: .98rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background .15s;
}
details.chapter summary::-webkit-details-marker { display: none; }
details.chapter summary:hover { background: #f6f9ff; }
details.chapter summary .chapter-count {
  flex-shrink: 0;
  font-size: .75rem;
  font-weight: 600;
  color: var(--accent-dark);
  background: #eef4ff;
  padding: 2px 10px;
  border-radius: 999px;
}
details.chapter summary::after {
  content: "▾";
  color: var(--muted);
  transition: transform .2s;
}
details.chapter[open] summary::after { transform: rotate(180deg); }
details.chapter[open] summary { border-bottom: 1px solid var(--border); }
details.chapter ul {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}
details.chapter ul li { margin: 0; }
details.chapter ul li a {
  display: block;
  padding: 9px 20px 9px 48px;
  color: var(--text);
  font-size: .92rem;
  position: relative;
}
details.chapter ul li a::before {
  content: "▶";
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .55rem;
  color: var(--accent);
}
details.chapter ul li a:hover {
  background: #f6f9ff;
  color: var(--accent-dark);
  text-decoration: none;
}

/* ===== トップページのコースカード ===== */
.course-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}
.course-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all .15s;
  position: relative;
  overflow: hidden;
}
.course-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
}
.course-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26, 39, 68, .1);
  border-color: var(--accent);
}
.course-card h2 {
  font-size: 1.05rem;
  margin: 0 0 6px;
  line-height: 1.5;
}
.course-card h2 a { color: var(--navy); }
.course-card h2 a::after { content: ""; position: absolute; inset: 0; }
.course-card p { margin: 0; color: var(--muted); font-size: .82rem; }

/* ===== パスワードフォーム ===== */
.pw-form-wrap {
  text-align: center;
  padding: 30px 10px 10px;
}
.pw-form-wrap .pw-icon {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #eef4ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.pw-form-wrap .pw-note {
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 22px;
}
.pw-form-wrap input[type="password"] {
  width: 100%;
  max-width: 320px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border .15s;
}
.pw-form-wrap input[type="password"]:focus { border-color: var(--accent); }
.pw-form-wrap input[type="submit"] {
  display: inline-block;
  margin-top: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 40px;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.pw-form-wrap input[type="submit"]:hover { background: var(--accent-dark); }

/* ===== フッター ===== */
.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: .8rem;
  padding: 30px 20px 50px;
}

/* ===== レスポンシブ ===== */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .site-main { padding: 20px 12px 60px; }
  .page-card { padding: 24px 18px 30px; }
  .entry-title { font-size: 1.3rem; }
  .course-grid { grid-template-columns: 1fr; }
  .site-header { padding: 0 16px; }
  .header-nav a { margin-left: 14px; }
}
