@charset "UTF-8";
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;800;900&family=Zen+Kaku+Gothic+New:wght@400;500;700;900&family=JetBrains+Mono:wght@400;600;800&display=swap');

@import '../themes/digital-asobi/styles/theme.css';

:root {
  /* クリーム基調の明るい編集型デザイン (Notion正本準拠) */
  --color-bg-base: #FAF7F2;          /* ウォームクリーム背景 */
  --color-bg-surface: #FFFFFF;       /* カード・サーフェス白 */
  --color-bg-subtle: #F3ECE1;        /* 薄いベージュ（アクセント背景） */
  --color-bg-alt: #EFE8DC;           /* セクション区切り */

  /* メインテキスト & ボーダー */
  --color-text-main: #23272F;        /* 高コントラストチャコール (WCAG AAA 11:1) */
  --color-text-muted: #64748B;       /* 副文・メタテキスト */
  --color-text-light: #94A3B8;       /* 日付・キャプション */
  --color-border: #E5DEC9;          /* 上品なグレージュボーダー */
  --color-border-subtle: #ECE6D8;

  /* ブランド主役カラー (オモコロ×ムー×新世代ビビッド) */
  --color-brand-orange: #FF6B00;
  --color-brand-orange-light: #FFF0E6;
  --color-brand-orange-dark: #D45400;

  /* Atlas準拠 余白スケール (4px step / ADR-010準拠) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 56px;

  /* 高彩度ビビッド カテゴリトークン (WCAG AA/AAA準拠) */
  --color-cat-streaming: #0066FF;
  --color-cat-resort: #FF2370;
  --color-cat-dev: #B8F500;
  --color-cat-experimental: #7928FF;
  --color-cat-skills: #FFD600;
  --color-cat-life: #00BFA6;

  /* アクセントカラー (オモコロ×LIG×ムーの調和) */
  --color-accent-yellow: #F59E0B;    /* 好奇心・やってみた・注意 */
  --color-accent-yellow-light: #FEF3C7;
  --color-accent-coral: #E11D48;     /* 情熱・エンタメ・オモコロ的熱量 */
  --color-accent-coral-light: #FFE4E6;
  --color-accent-teal: #0D9488;      /* 知性・技術・LIG的洗練 */
  --color-accent-teal-light: #CCFBF1;
  --color-accent-indigo: #4F46E5;    /* 特集・ディープな実験 */
  --color-accent-neon: #E2F952;      /* ネオンライム・好奇心のスパーク */
  --color-accent-purple: #A855F7;    /* 月刊ムー的ミステリー・裏ワザ */

  /* フォントスタック */
  --font-heading: 'Outfit', 'Zen Kaku Gothic New', sans-serif;
  --font-body: 'Zen Kaku Gothic New', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* 角丸 & シャドウ */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 4px rgba(35, 39, 47, 0.04);
  --shadow-md: 0 8px 20px rgba(35, 39, 47, 0.06);
  --shadow-lg: 0 16px 32px rgba(35, 39, 47, 0.09);
  --shadow-pop: 4px 4px 0px #23272F; /* 雑誌・ポップな立体感 */

  /* レイアウト最大幅 */
  --max-width: 1200px;
  --content-width: 820px;
}

/* リセット & ベース */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-body);
  background-color: var(--color-bg-base);
  color: var(--color-text-main);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.85; /* ヒトデブログ準拠の疲れにくい行間 */
  overflow-x: hidden;
}

/* デジタル庁デザインシステム準拠のフォーカスリング */
:focus-visible {
  outline: 3px solid var(--color-brand-orange) !important;
  outline-offset: 3px !important;
}

/* リンク */
a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 画像 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* コンテナ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* 雑誌風見出しユーティリティ */
.font-heading {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}

/* 実験室風ドット方眼オーバーレイ */
.lab-grid-overlay {
  background-image: radial-gradient(rgba(35, 39, 47, 0.08) 1.2px, transparent 1.2px);
  background-size: 24px 24px;
}

/* マーカーハイライト */
.marker-highlight {
  position: relative;
  display: inline-block;
  background: linear-gradient(120deg, transparent 20%, #FF6B00 20%, #FF6B00 85%, transparent 85%);
  background-size: 100% 45%;
  background-repeat: no-repeat;
  background-position: 0 85%;
  padding: 0 4px;
}

/* ポップバッジ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-teal { background: var(--color-accent-teal-light); color: var(--color-accent-teal); }
.badge-coral { background: var(--color-accent-coral-light); color: var(--color-accent-coral); }
.badge-yellow { background: var(--color-accent-yellow-light); color: #B45309; }
.badge-neon { background: #E2F952; color: #0F141C; font-weight: 900; }
.badge-purple { background: #7928FF; color: #FFFFFF; font-weight: 900; }
.badge-blue { background: #0066FF; color: #FFFFFF; font-weight: 900; }
.badge-pink { background: #FF2370; color: #1B1B21; font-weight: 900; }
.badge-lime { background: #B8F500; color: #1B1B21; font-weight: 900; }
.badge-yellow { background: #FFD600; color: #1B1B21; font-weight: 900; }
.badge-turquoise { background: #00BFA6; color: #1B1B21; font-weight: 900; }
.badge-orange { background: #FF6B00; color: #1B1B21; font-weight: 900; }

/* 雑誌風カードベース */
.mag-card {
  background: var(--color-bg-surface);
  border: 2px solid var(--color-text-main);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.mag-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 7px 7px 0px #23272F;
}

/* 記事上部 読了プログレスバー */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3.5px;
  background: linear-gradient(90deg, #FF6B00 0%, #FF2370 50%, #B8F500 100%);
  width: 0%;
  z-index: 9999;
  transition: width 0.08s ease-out;
}

/* ----------------------------------------------------
   記事本文内 装飾ブロック (ヒトデ×オモコロ×ムー)
---------------------------------------------------- */
.post-body-content {
  font-size: 1.05rem;
  line-height: 1.95;
  color: #1E293B;
}

.post-body-content h2 {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 900;
  margin-top: 48px;
  margin-bottom: 20px;
  padding: 12px 18px;
  background: #FFFFFF;
  border-left: 8px solid var(--color-brand-orange);
  border-top: 1.5px solid var(--color-border);
  border-right: 1.5px solid var(--color-border);
  border-bottom: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: 2px 2px 0px rgba(35, 39, 47, 0.06);
}

.post-body-content h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  margin-top: 36px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--color-accent-teal-light);
  padding-bottom: 8px;
}

.post-body-content p {
  margin-bottom: 24px;
}

.post-body-content strong {
  background: linear-gradient(transparent 65%, #FEF08A 65%);
  font-weight: 800;
}

.post-body-content blockquote {
  border-left: 4px solid var(--color-accent-teal);
  background: var(--color-bg-subtle);
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
}

.post-body-content ul, .post-body-content ol {
  margin: 20px 0 24px 28px;
  padding-left: 4px;
}

.post-body-content li {
  margin-bottom: 8px;
}

/* 吹き出し・会話ブロック (オモコロ風) */
.post-body-content .speech-bubble {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 28px 0;
}
.post-body-content .speech-bubble-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--color-text-main);
  background: #0F141C;
  color: #E2F952;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.post-body-content .speech-bubble-body {
  position: relative;
  background: #FFFFFF;
  border: 2px solid var(--color-text-main);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: 3px 3px 0px #23272F;
}

/* 検証・結論ボックス (サンクチュアリ出版風) */
.post-body-content .box-verify,
.post-body-content .callout-box {
  background: #FEF3C7;
  border: 2px solid #F59E0B;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 28px 0;
  box-shadow: 3px 3px 0px #78350F;
}

/* 注意・裏話枠 (月刊ムー風) */
.post-body-content .box-secret {
  background: #F3E8FF;
  border: 2px solid #A855F7;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 28px 0;
  box-shadow: 3px 3px 0px #581C87;
}

/* 記事カードの内側には広告を出さない（AdSense 自動広告が挿入した枠を非表示にする。サイト全体の広告は止めない） */
.magazine-card .adsbygoogle,
.magazine-card [class*="google-auto-placed"],
.magazine-card .ap_container {
  display: none !important;
}

/* 広告が埋まらなかった（または広告ブロックで止まった）枠は、空白を残さず畳む */
.ad-container-wrap:has(ins.adsbygoogle[data-ad-status="unfilled"]) {
  display: none;
}

/* prefers-reduced-motion 対応 (完全アクセシビリティ) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== あそびモード（配色のみ切り替える。ヘッダーの切替ボタンで data-play を付け外しする） ===== */
:root[data-play="on"] {
  --color-bg-base: #FFF6D6;          /* 明るいレモン系の背景 */
  --color-bg-surface: #FFFFFF;
  --color-bg-subtle: #FFE9B8;
  --color-bg-alt: #FFE2A0;
  --color-text-main: #1B1464;        /* 濃い紺（背景とのコントラスト 14:1 以上） */
  --color-text-muted: #3D3A7A;       /* 副文も紺系で読みやすさを保つ */
  --color-text-light: #4B4787;
  --color-border: #E8B84A;
  --color-border-subtle: #F2CF73;
  --color-brand-orange: #D9006C;     /* アクセントをピンクに（白文字との対比 5:1 以上） */
  --color-brand-orange-light: #FFE0EE;
  --color-brand-orange-dark: #A8004F;
}

/* ページ遷移のアニメーションを減らす設定の利用者には、遷移の動きを出さない */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root),
  ::view-transition-group(*) {
    animation: none !important;
  }
}
