/* 学習記事（scripts/build-content.mjs で生成するページ）の共通スタイル */
:root {
  --bg: #0a0e1a;
  --bg2: #0f1629;
  --bg3: #1a2236;
  --text: #f3f4f6;
  --text2: #9ca3af;
  --border: #1f2937;
  --accent: #FF9900;
  --accent2: #FF6600;
  --danger: #f87171;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Hiragino Sans', 'Noto Sans JP', system-ui, sans-serif;
  line-height: 1.85;
  -webkit-text-size-adjust: 100%;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(10, 14, 26, 0.95);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 900;
  font-size: 18px;
  text-decoration: none;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-header nav { display: flex; align-items: center; gap: 14px; }
.site-header nav a { color: var(--text2); text-decoration: none; font-size: 13px; white-space: nowrap; }
.site-header nav a:hover { color: var(--text); }
.site-header .nav-cta {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 700;
}

.main { max-width: 780px; margin: 0 auto; padding: 24px 20px 48px; }

.breadcrumb { font-size: 12px; color: var(--text2); margin-bottom: 20px; }
.breadcrumb a { color: var(--text2); }

.meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text2); margin-bottom: 10px; }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(255, 153, 0, 0.12);
  border-radius: 6px;
  padding: 2px 8px;
}

h1 { font-size: 26px; line-height: 1.45; margin-bottom: 20px; }

h2 {
  font-size: 20px;
  line-height: 1.5;
  margin: 40px 0 14px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}

.article p, .main > p { margin: 0 0 16px; font-size: 16px; }
.lead { color: #d1d5db; }
strong { color: #ffc266; font-weight: 700; }

.article ul, .article ol { margin: 0 0 18px; padding-left: 1.4em; }
.article li { margin: 6px 0; font-size: 15.5px; }
.article li::marker { color: var(--accent); }
ol.steps li { padding-left: 4px; }

code {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.86em;
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  color: #86efac;
  overflow-wrap: anywhere;
}

.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { background: var(--bg3); color: var(--accent); text-align: left; padding: 10px 12px; white-space: nowrap; }
td { padding: 10px 12px; border-top: 1px solid var(--border); vertical-align: top; }

.point, .trap {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 15px;
}
.point { background: rgba(255, 153, 0, 0.08); border: 1px solid rgba(255, 153, 0, 0.35); }
.trap { background: rgba(248, 113, 113, 0.08); border: 1px solid rgba(248, 113, 113, 0.4); }
.trap strong:first-child { color: var(--danger); }

.diagram { margin: 24px 0 28px; }
.diagram img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.diagram figcaption { font-size: 12px; color: var(--text2); margin-top: 8px; text-align: center; }

.sandbox-button {
  display: block;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}
.sandbox-button span { display: block; font-size: 12px; font-weight: 400; opacity: 0.85; }

details.quiz {
  margin: 28px 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--bg2);
  border: 1px solid rgba(96, 165, 250, 0.4);
}
details.quiz summary { cursor: pointer; font-weight: 700; color: #93c5fd; }
details.quiz p { margin: 12px 0 0; font-size: 15px; }

.cta-box {
  margin-top: 48px;
  padding: 22px 20px;
  border-radius: 14px;
  background: linear-gradient(145deg, #1a1f35, #111827);
  border: 1px solid rgba(255, 153, 0, 0.4);
}
.cta-title { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.cta-box p { font-size: 15px; margin-bottom: 14px; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cta-button {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}
.cta-button.secondary { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.15); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid rgba(255, 153, 0, 0.18);
  transition: border-color 0.15s, background 0.15s;
}
.card-link:hover { border-color: rgba(255, 153, 0, 0.5); background: rgba(255, 153, 0, 0.05); }
.card-link .badge { align-self: flex-start; }
.card-link strong { color: var(--text); font-size: 15px; }
.card-link span:last-child { color: var(--text2); font-size: 12.5px; line-height: 1.6; }

.related { margin-top: 40px; }

.site-footer { border-top: 1px solid var(--border); padding: 24px 20px; text-align: center; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-bottom: 8px; }
.site-footer a { color: var(--text2); font-size: 12px; text-decoration: none; }
.site-footer p { color: #4b5563; font-size: 11px; }

@media (max-width: 600px) {
  h1 { font-size: 22px; }
  h2 { font-size: 18px; }
  .site-header { padding: 10px 14px; }
  .site-header nav { gap: 10px; }
  .site-header nav a:not(.nav-cta):nth-child(2) { display: none; }
  .main { padding: 18px 16px 40px; }
}
