/* =========================================================
   AWS学習ナビ - style.css (メインスタイル)
   ダーク系テーマ / モバイルファースト
   ========================================================= */

/* ---------- CSS変数 ---------- */
:root {
  --bg:          #0f1117;
  --bg-elev:     #171a23;
  --bg-card:     #1c2030;
  --bg-card-2:   #232838;
  --border:      #2a3042;
  --text:        #e2e8f0;
  --text-muted:  #94a3b8;
  --text-dim:    #64748b;
  --accent:      #ff9900;
  --accent-2:    #ffb84d;
  --accent-dark: #cc7a00;
  --blue:        #3b82f6;
  --green:       #22c55e;
  --red:         #ef4444;
  --purple:      #a855f7;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 6px 20px rgba(0,0,0,.35);
  --shadow-sm:   0 2px 8px rgba(0,0,0,.25);
  --maxw:        1200px;
  --header-h:    64px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN",
          "Hiragino Sans", Meiryo, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* ---------- リセット ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-2); }
ul, ol { padding-left: 1.25em; }
h1, h2, h3, h4 { line-height: 1.3; font-weight: 700; }

/* ---------- レイアウト ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.site-main { padding: 24px 0 56px; }
.section { margin-bottom: 48px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 20px; gap: 12px; flex-wrap: wrap;
}
.section-title {
  font-size: 1.5rem; margin: 0; position: relative; padding-left: 14px;
}
.section-title::before {
  content: ""; position: absolute; left: 0; top: .1em; bottom: .1em;
  width: 5px; border-radius: 3px; background: var(--accent);
}
.section-link { font-size: .9rem; color: var(--text-muted); }
.section-link:hover { color: var(--accent); }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15,17,23,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h); gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); }
.brand .logo-mark {
  width: 34px; height: 34px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: grid; place-items: center; color: #0f1117; font-weight: 900; font-size: 1rem;
}
.brand:hover { color: var(--accent); }
.main-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.main-nav a {
  display: block; padding: 8px 14px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-weight: 600; font-size: .95rem;
}
.main-nav a:hover, .main-nav a.is-active { color: var(--text); background: var(--bg-card); }
.nav-toggle {
  display: none; width: 44px; height: 44px; border: 1px solid var(--border);
  background: var(--bg-card); border-radius: var(--radius-sm); cursor: pointer;
  padding: 0; position: relative;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: .25s ease;
}
.nav-toggle span { top: 50%; margin-top: -1px; }
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after  { top: 7px; }
.nav-toggle.is-open span { background: transparent; }
.nav-toggle.is-open span::before { transform: translateX(-50%) rotate(45deg); top: 0; }
.nav-toggle.is-open span::after  { transform: translateX(-50%) rotate(-45deg); top: 0; }

/* ---------- ヒーロー ---------- */
.hero {
  position: relative; padding: 56px 0;
  background:
    radial-gradient(900px 400px at 80% -10%, rgba(255,153,0,.16), transparent 60%),
    radial-gradient(700px 350px at 0% 0%, rgba(59,130,246,.12), transparent 55%),
    var(--bg-elev);
  border-bottom: 1px solid var(--border);
}
.hero h1 { font-size: 2.4rem; margin: 0 0 14px; letter-spacing: -.01em; }
.hero h1 .accent { color: var(--accent); }
.hero p.lead { font-size: 1.1rem; color: var(--text-muted); max-width: 640px; margin: 0 0 22px; }
.cert-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.hero-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.hero-stat .num { font-size: 2rem; font-weight: 800; color: var(--accent); line-height: 1; }
.hero-stat .label { font-size: .85rem; color: var(--text-muted); }

/* ---------- バッジ ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
}
.cert-badge { border-color: rgba(255,153,0,.4); }
.cert-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.cert-SAA::before { background: #22c55e; }
.cert-SAP::before { background: #ff9900; }
.cert-ANS::before { background: #3b82f6; }
.cert-SCS::before { background: #ef4444; }
.cert-DOP::before { background: #a855f7; }
.cert-CLF::before { background: #94a3b8; }

.level-badge { font-size: .72rem; padding: 3px 9px; }
.level-beginner { color: #22c55e; border-color: rgba(34,197,94,.4); }
.level-intermediate { color: #ff9900; border-color: rgba(255,153,0,.4); }
.level-advanced { color: #ef4444; border-color: rgba(239,68,68,.4); }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 11px 20px; border-radius: var(--radius-sm); font-weight: 700; font-size: .95rem;
  border: 1px solid transparent; transition: .15s ease; text-align: center;
}
.btn-primary { background: var(--accent); color: #0f1117; }
.btn-primary:hover { background: var(--accent-2); color: #0f1117; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- カードグリッド ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; transition: .18s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); border-color: rgba(255,153,0,.45); box-shadow: var(--shadow); }
.card-thumb { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--bg-card-2), var(--bg-elev)); position: relative; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card-title { font-size: 1.05rem; margin: 0; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); }
.card-excerpt { font-size: .9rem; color: var(--text-muted); margin: 0; }
.card-foot { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--text-dim); margin-top: auto; }
.read-time::before { content: "⏱ "; }

.pickup-card { flex-direction: row; }
.pickup-card .card-thumb { width: 42%; aspect-ratio: auto; }
.pickup-card .card-body { width: 58%; }

/* ---------- クイズ ---------- */
.quiz-box {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.quiz-question { font-size: 1.15rem; font-weight: 700; margin: 0 0 18px; }
.quiz-options { display: grid; gap: 10px; list-style: none; padding: 0; margin: 0 0 16px; }
.quiz-option {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 13px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-card-2); color: var(--text); font-size: .95rem; transition: .15s;
}
.quiz-option:hover { border-color: var(--accent); }
.quiz-option.is-correct { border-color: var(--green); background: rgba(34,197,94,.12); }
.quiz-option.is-wrong   { border-color: var(--red); background: rgba(239,68,68,.12); }
.quiz-option.is-disabled { pointer-events: none; opacity: .85; }
.quiz-explanation {
  display: none; margin-top: 14px; padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--bg-elev); border-left: 4px solid var(--accent); font-size: .9rem; color: var(--text-muted);
}
.quiz-explanation.is-shown { display: block; }
.quiz-progress { height: 8px; background: var(--bg-card-2); border-radius: 999px; overflow: hidden; margin-bottom: 18px; }
.quiz-progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0; transition: width .4s ease; }
.quiz-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }

/* ---------- 資格対策タブ ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; border-bottom: 1px solid var(--border); padding-bottom: 14px; }
.tab-btn {
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-muted); font-weight: 700; cursor: pointer; font-size: .9rem;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.is-active { background: var(--accent); border-color: var(--accent); color: #0f1117; }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 配点バー / ドメイン ---------- */
.domain-list { display: grid; gap: 14px; }
.domain-row .domain-head { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 6px; }
.domain-bar { height: 10px; background: var(--bg-card-2); border-radius: 999px; overflow: hidden; }
.domain-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-dark), var(--accent)); border-radius: 999px; }

/* ---------- 試験情報テーブル ---------- */
.exam-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0; }
.exam-info .item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; text-align: center; }
.exam-info .item .v { font-size: 1.4rem; font-weight: 800; color: var(--accent); }
.exam-info .item .k { font-size: .8rem; color: var(--text-muted); }

/* ---------- ロードマップ ---------- */
.roadmap { position: relative; padding-left: 28px; }
.roadmap::before { content: ""; position: absolute; left: 9px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.roadmap-step { position: relative; margin-bottom: 28px; }
.roadmap-step::before {
  content: ""; position: absolute; left: -27px; top: 4px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--accent); border: 3px solid var(--bg);
}
.roadmap-stage-label { font-size: .78rem; color: var(--accent); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }

/* ---------- ニュース ---------- */
.news-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.news-item:last-child { border-bottom: 0; }
.news-date { font-size: .8rem; color: var(--text-dim); white-space: nowrap; min-width: 92px; }
.news-cat { font-size: .72rem; }
.news-cat.update  { color: var(--blue); }
.news-cat.exam    { color: var(--accent); }
.news-cat.newsvc  { color: var(--green); }
.news-title { font-size: .95rem; color: var(--text); }

/* ---------- フィルター ---------- */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; align-items: center; }
.filter-group { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip {
  padding: 6px 13px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-muted); font-size: .82rem; cursor: pointer; font-weight: 600;
}
.filter-chip:hover { color: var(--text); }
.filter-chip.is-active { background: rgba(255,153,0,.15); border-color: var(--accent); color: var(--accent); }
.search-box {
  flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px;
}
.search-box input { flex: 1; background: transparent; border: 0; color: var(--text); font-size: .9rem; outline: none; }

/* ---------- 2カラム（アーカイブ/記事） ---------- */
.layout-2col { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; }
.sidebar { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 24px; }
.widget { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.widget h3 { font-size: 1rem; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.widget ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.widget ul a { color: var(--text-muted); font-size: .9rem; }
.widget ul a:hover { color: var(--accent); }

/* サイドバーをアコーディオンにできる土台（モバイル用） */
.accordion-toggle { display: none; }

/* ---------- 記事本文 ---------- */
.entry-header { margin-bottom: 24px; }
.entry-header h1 { font-size: 2rem; margin: 12px 0; }
.entry-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; color: var(--text-dim); font-size: .85rem; }
.breadcrumb { font-size: .82rem; color: var(--text-dim); margin-bottom: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb .sep { color: var(--text-dim); }

.entry-body { font-size: 1.02rem; }
.entry-body h2 { font-size: 1.5rem; margin: 38px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.entry-body h3 { font-size: 1.2rem; margin: 28px 0 10px; }
.entry-body p { margin: 0 0 16px; }
.entry-body ul, .entry-body ol { margin: 0 0 16px; }
.entry-body img { border-radius: var(--radius-sm); margin: 16px 0; }
.entry-body a { text-decoration: underline; text-underline-offset: 2px; }

.entry-body pre {
  background: #0b0e14; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px; overflow-x: auto; margin: 0 0 18px; font-family: var(--mono); font-size: .88rem; line-height: 1.6;
}
.entry-body code { font-family: var(--mono); font-size: .9em; background: var(--bg-card-2); padding: 2px 6px; border-radius: 4px; }
.entry-body pre code { background: transparent; padding: 0; }

blockquote { margin: 0 0 18px; padding: 12px 18px; border-left: 4px solid var(--accent); background: var(--bg-card); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-muted); }

/* 試験ポイント注釈 */
.exam-point {
  border: 1px solid rgba(255,153,0,.4); background: rgba(255,153,0,.07);
  border-radius: var(--radius-sm); padding: 14px 16px; margin: 0 0 20px;
}
.exam-point .ep-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--accent); font-size: .85rem; margin-bottom: 6px; }
.exam-point .ep-label::before { content: "🎯"; }

/* 目次 */
.toc { font-size: .9rem; }
.toc ol { list-style: none; counter-reset: toc; padding: 0; margin: 0; display: grid; gap: 7px; }
.toc li { counter-increment: toc; }
.toc a { color: var(--text-muted); }
.toc a::before { content: counter(toc) ". "; color: var(--accent); font-weight: 700; }
.toc a:hover { color: var(--accent); }

/* ページネーション */
.pagination { display: flex; justify-content: center; gap: 10px; margin-top: 36px; }
.pagination a, .pagination span {
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text); font-weight: 600; font-size: .9rem;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- フッター ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-elev); padding: 40px 0 28px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; margin-bottom: 28px; }
.footer-grid h4 { font-size: .95rem; margin: 0 0 12px; color: var(--text); }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-grid a { color: var(--text-muted); font-size: .9rem; }
.footer-grid a:hover { color: var(--accent); }
.footer-brand p { color: var(--text-muted); font-size: .9rem; max-width: 360px; }
.affiliate-disclaimer {
  border-top: 1px solid var(--border); padding-top: 18px; font-size: .78rem;
  color: var(--text-dim); line-height: 1.7;
}
.footer-copy { text-align: center; font-size: .8rem; color: var(--text-dim); margin-top: 18px; }

/* ---------- ユーティリティ ---------- */
.text-muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
