/*
Theme Name:   WebExam Child
Theme URI:    https://webexam.jp
Description:  WebExam解説ページ専用 Astra子テーマ
Author:       WebExam
Template:     astra
Version:      1.0.0
Text Domain:  webexam-child
*/

/* 親テーマのスタイルを上書き：解説ページ専用スタイルはsingle-explanation.phpにインライン定義 */

:root {
  --brand: #2563eb;
  --brand-pale: #eff6ff;
  --brand-mid: #dbeafe;
  --brand-deep: #1e3a8a;
  --navy: #0f2044;
  --text: #0f172a;
  --text-2: #334155;
  --text-3: #64748b;
  --g1: #f8fafc;
  --g2: #f1f5f9;
  --g3: #e2e8f0;
  --g4: #94a3b8;
  --green: #059669;
  --green-pale: #ecfdf5;
  --amber: #d97706;
  --amber-pale: #fffbeb;
}

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

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--g1);
  color: var(--text);
  line-height: 1.8;
  font-size: 15px;
}

/* ===== SITE HEADER ===== */
.site-header {
  background: #fff;
  padding: 0 40px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--g3);
  border-bottom: 1px solid var(--g3);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-logo img {
  height: 44px;
  width: auto;
  display: block;
}
.site-nav a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 13px;
  margin-left: 28px;
  transition: color 0.2s;
}
.site-nav a:hover { color: var(--navy); }

/* ===== BREADCRUMB ===== */
.breadcrumb {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 48px 0;
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  gap: 8px;
  align-items: center;
}
.breadcrumb a { color: var(--brand); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--g3); }

/* ===== MAIN LAYOUT ===== */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 48px 80px;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 40px;
  align-items: start;
}

/* ===== ARTICLE ===== */
.article { min-width: 0; }

/* ===== ARTICLE HEADER ===== */
.article-header {
  background: #fff;
  border-radius: 2px;
  padding: 24px 32px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.exam-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
}
.tag-pref { background: var(--g2); color: var(--text-2); border: 1px solid var(--g3); }
.tag-year { background: var(--g2); color: var(--text-2); border: 1px solid var(--g3); }
.tag-section { background: var(--g3); color: var(--text); border: 1px solid var(--g4); }
.tag-skill { background: var(--g2); color: var(--text-2); border: 1px solid var(--g3); }

.article-title {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 12px;
}

.difficulty-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-3);
}
.stars { color: var(--amber); letter-spacing: 2px; }
.diff-label { color: var(--text-2); font-weight: 500; }

/* ===== VIDEO SECTION ===== */
.video-section {
  background: #fff;
  border-radius: 2px;
  padding: 20px 32px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.video-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.video-section-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--brand);
  border-radius: 2px;
}
.video-wrapper {
  background: #000;
  border-radius: 2px;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
}
.video-play-btn {
  position: absolute;
  width: 56px;
  height: 56px;
  background: rgba(37,99,235,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}
.video-play-btn:hover { transform: scale(1.1); }
.video-play-btn svg { margin-left: 4px; }
.video-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0f2044, #1e3a8a);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.avatar-label {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
  letter-spacing: 0.1em;
}
.avatar-icon {
  width: 64px;
  height: 64px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

/* ===== QUESTION BLOCK ===== */
.q-block {
  background: #fff;
  border-radius: 2px;
  padding: 28px 32px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.q-number {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.q-badge {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--g4);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 3px 11px;
  border-radius: 2px;
  letter-spacing: 0.05em;
}
.q-pts {
  font-size: 11px;
  color: var(--g4);
  letter-spacing: 0.03em;
}

/* 問題文ボックス */
.problem-box {
  background: var(--g1);
  border: 1px solid var(--g3);
  border-radius: 2px;
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 14.5px;
  line-height: 2;
}

/* 図形エリア */
.figure-area {
  margin: 16px 0;
  text-align: center;
}
.figure-area svg {
  max-width: 480px;
  height: auto;
  border: 1px solid var(--g3);
  border-radius: 2px;
  background: #fff;
  padding: 12px;
}

/* 答えボックス */
.answer-box {
  background: var(--brand-pale);
  border: 1.5px solid var(--brand);
  border-radius: 2px;
  padding: 14px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.answer-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.answer-value {
  font-family: 'Noto Serif JP', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-deep);
  letter-spacing: 0.02em;
}

/* 解説セクション */
.explanation-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

/* ステップ */
.steps { display: flex; flex-direction: column; gap: 0; }
.step {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0 16px;
  position: relative;
}
.step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: 0;
  width: 1px;
  background: var(--g3);
}
.step-num {
  width: 32px;
  height: 32px;
  background: #fff;
  color: var(--brand);
  border: 2px solid var(--brand);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.step-content {
  padding-bottom: 24px;
}
.step-heading {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  padding-top: 4px;
  line-height: 1.4;
}
.step-body {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.9;
}
.step-latex {
  margin: 10px 0;
  padding: 8px 0;
  font-size: 15px;
  text-align: center;
}

/* ポイントボックス */
.point-box {
  background: var(--amber-pale);
  border: 1px solid #fcd34d;
  border-radius: 2px;
  padding: 16px 20px;
  margin-top: 20px;
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--text);
}
.point-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--amber);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 6px;
}

/* ===== SIDEBAR ===== */
.sidebar { position: sticky; top: 72px; }

.sidebar-card {
  background: #fff;
  border-radius: 2px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.skill-list { display: flex; flex-direction: column; gap: 8px; }
.skill-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--text-2);
  padding: 8px;
  background: var(--g1);
  border-radius: 2px;
  border: 1px solid var(--g3);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-decoration: none;
}
.skill-item:hover {
  border-color: var(--brand);
  background: var(--brand-pale);
  color: var(--brand-deep);
}
.skill-no {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  background: var(--g3);
  color: var(--text-2);
  padding: 1px 6px;
  border-radius: 2px;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-links { display: flex; flex-direction: column; gap: 8px; }
.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--g1);
  border: 1px solid var(--g3);
  border-radius: 2px;
  text-decoration: none;
  font-size: 12px;
  color: var(--text-2);
  transition: all 0.2s;
}
.nav-link:hover { background: var(--brand-pale); border-color: var(--brand); color: var(--brand-deep); }
.nav-link-dir { font-size: 10px; color: var(--text-3); }
.nav-link-title { font-size: 11px; margin-top: 2px; }

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: #fff;
  color: var(--brand);
  border: 1.5px solid var(--brand);
  border-radius: 2px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
  margin-bottom: 8px;
}
.back-btn:hover { background: var(--brand); color: #fff; }

/* ===== DIVIDER ===== */
.divider {
  height: 1px;
  background: var(--g3);
  margin: 4px 0;
}

/* ===== FOOTER NOTE ===== */
.footer-note {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 32px 40px;
  font-size: 11px;
  color: var(--text-3);
  border-top: 1px solid var(--g3);
}

/* ===== WATERMARK ===== */
.watermark-note {
  display: inline-block;
  margin-top: 8px;
  opacity: 0.45;
}
.watermark-note img {
  height: 28px;
  width: auto;
  display: block;
}

@media (max-width: 900px) {
  .container {
    grid-template-columns: 1fr 220px;
    gap: 24px;
    padding: 20px 20px 60px;
  }
}

@media (max-width: 720px) {
  .container {
    grid-template-columns: 1fr;
    padding: 16px 16px 60px;
  }
  .sidebar { position: static; }
  .article-header, .q-block { padding: 20px 16px; }
  .article-title { font-size: 18px; }
  .step { grid-template-columns: 28px 1fr; }
  .step-num { width: 28px; height: 28px; font-size: 11px; }
  .step:not(:last-child)::before { left: 13px; top: 28px; }
  .figure-area svg { max-width: 100%; }
  .site-header { padding: 0 16px; }
  .site-nav a { margin-left: 12px; font-size: 11px; }
}