/* ---------------------------------------------------------
   IT基礎ポータル 統合スタイルシート (styles.css)
   2025年版モダン・ダークテーマ & レスポンシブ対応
   --------------------------------------------------------- */

:root {
  --bg: #0b0f14;
  --card: #121924;
  --text: #e8eef6;
  --muted: #9fb0c3;
  --line: #233042;
  --accent: #66b3ff;
  --radius: 16px;
  --tap: 44px;
}

/* ✅ ここに「対応ブラウザだけ変数を上書き」を追加 */
@supports (color: oklch(60% 0.1 240)) {
  :root {
    --bg: oklch(18% 0.02 240);
    /* 必要なら text も上書きしてOK */
    /* --text: oklch(...); */
  }
}

/* 変数を実際の背景・文字色に使う（保険） */
html, body { background: var(--bg); color: var(--text); }


* {
  box-sizing: border-box;
}

body {
  margin: 0;
  /* システム標準フォントを使用し、認知的負荷を軽減 */
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  max-width: 980px; /* index.htmlの設計に合わせて拡張 */
  margin-left: auto;
  margin-right: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

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

p {
  line-height: 1.8; /* 読みやすさを重視した広めの行間 [2] */
  margin: 1em 0;
}

/* コードブロック：旧styles.cssの意匠をダークテーマに最適化 */
pre {
  background-color: #000;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  border: 1px solid var(--line);
  margin: 1.5em 0;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* レイアウトコンテナ */
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px;
}

/* ヘッダー：2025年のトレンドである透過・ぼかし効果付きの固定ヘッダー  */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 15, 20, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.toprow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.2rem;
}

/* ナビゲーション（ピル型デザイン） */
.nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  min-height: var(--tap);
  transition: all 0.2s ease;
}

.nav .pill.active{
  border-color: var(--accent, #66b3ff);
  color: var(--text, #e8eef6);
  background: rgba(102, 179, 255, 0.08);
}

.pill:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(102, 179, 255, 0.05);
}

/* モバイル用メニューボタン */
.menuBtn {
  display: none;
  border: 1px solid var(--line);
  background: #0f1520;
  color: var(--text);
  border-radius: 12px;
  cursor: pointer;
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0 12px;
  align-items: center;
  justify-content: center;
}

.burger {
  position: relative;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  display: block;
}

.burger::before,
.burger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.burger::before { top: -6px; }
.burger::after { top: 6px; }

/* メインコンテンツエリア */
main {
  padding: 18px 0 28px;
}

.hero {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(102, 179, 255, 0.12), rgba(18, 25, 36, 0.0));
  border-radius: var(--radius);
  padding: 24px;
}

.section {
  margin-top: 24px;
}

.section h2 {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* カードレイアウト：情報の階層化と視認性の向上  */
.card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

li + li {
  margin-top: 12px;
}

/* リストアイテムの共通スタイル */
.news-item,.item {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s;
}

.item {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.news-item:hover,.item:hover {
  border-color: var(--accent);
}

.news-sub,.meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

/* ツールグリッド：モジュール型配置によるUXの改善  */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.tool {
  border: 1px solid var(--line);
  background: #0f1520;
  border-radius: 14px;
  padding: 16px;
  min-height: var(--tap);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.tool:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.tool.name {
  font-weight: 600;
  display: block;
}

.tool.desc {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

/* フッター：情報の区切りと視覚的な安定感 */
footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 40px 0;
  text-align: center;
  font-size: 13px;
}

/* レスポンシブ対応：モバイルファーストの視点  */
@media (max-width: 780px) {
 .grid { grid-template-columns: 1fr; }
 .item { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 640px) {
 .menuBtn { display: inline-flex; }
 .nav {
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
  }
 .nav.open { display: flex; }
 .pill { width: 100%; justify-content: flex-start; }
}

