/* =============================
   styles.css（ブログ1ページ＋ヘッダー右上に検索）
   初心者向けコメント付き
   ============================= */

/* === 1) リセット＆基本設定 ====================== */
/* すべての要素のボックスサイズを「枠線込み」に統一（レイアウト崩れを防ぐ） */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ページ全体の高さを100%にしておく（必要に応じて使える） */
html,
body {
  height: 100%;
}

/* 基本の文字設定と行間。日本語では少し広めの行間が読みやすい */
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Noto Sans JP", sans-serif;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  color: var(--fg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* メインコンテンツは縦に伸びる */
main {
  flex: 1;
}

/* 画像は親の幅を超えないようにする */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* === 2) カラーテーマ（変数） ==================== */
/* SVA 風の濃いネイビー＋シアンアクセント */
:root {
  --bg: #020617;
  /* ページ全体のベース（ほぼ黒） */
  --bg-soft: #020617;
  --fg: #f9fafb;
  /* メイン文字色（ほぼ白） */
  --muted: #dee7f8;
  /* サブテキスト */
  --border: #1f2937;
  /* 罫線 */
  --surface: #050816;
  /* セクションの背景カード色 */
  --surface-soft: #0b1120;
  --primary: #38bdf8;
  /* アクセント（シアン） */
  --primary-soft: #0ea5e9;
  --accent: #facc15;
  /* 差し色のゴールド */

  --maxw: 1040px;
  /* コンテンツ幅を少し広めに */
  --radius: 4px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .75);

  /* ===== VIGNETTE controls ===== */
  --vgn-inner: 52%;
  /* 明るい中心の半径 */
  --vgn-mid: 72%;
  /* 暗くなり始め */
  --vgn-outer: 100%;
  /* 端 */
  --vgn-a1: 0.00;
  /* 中心の暗さ(基本0) */
  --vgn-a2: 0.3;
  /* 中間の暗さ */
  --vgn-a3: 0.9;
  /* 端の暗さ：グリッドがうるさいならここを上げる */
}

/* ダークモード指定のときも基本は同じ配色に揃えておく */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #020617;
    --bg-soft: #020617;
    --fg: #f9fafb;
    --muted: #9ca3af;
    --border: #1f2937;
    --surface: #050816;
    --surface-soft: #0b1120;
    --primary: #38bdf8;
    --primary-soft: #0ea5e9;
    --accent: #facc15;
    --shadow: 0 22px 55px rgba(0, 0, 0, .9);
  }
}

/* リンクの色（アクセント色を使用） */
a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}


/* アクセシビリティ用：画面には見せないがスクリーンリーダーには読ませる */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* === 3) レイアウト共通 =========================== */
/* 中央寄せの共通コンテナ。左右の余白は画面幅に応じて可変 */
.container {
  width: 100%;
  max-width: 1600px;
  /* PC で広々レイアウト */
  margin-inline: auto;
  padding-inline: clamp(24px, 4vw, 48px);
}

/* === 4) ヘッダー（上部固定＆半透明背景） ======== */
.site-header {
  background: rgba(3, 7, 18, 0.78);
  backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid rgba(248, 250, 252, 0.10);
}


/* ヘッダー内のレイアウト（ロゴ｜メニュー｜検索） */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  width: 100%;
  min-height: 64px;
  /* ★ ロゴと下線の間に余白 */
}

/* ロゴ画像（バナー）が縦長にならないようにする */
.brand-logo {
  display: block;
  max-height: 44px;
  height: auto;
  width: auto;
}

/* 中央ナビゲーション（PC時） */
.primary-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

/* メニュー（PC 基本状態） */
.nav-list {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* li の余白リセット（念のため） */
.nav-list li {
  margin: 0;
  padding: 0;
}

.nav-list a:hover {
  color: var(--accent);
  border-bottom: 1px solid rgba(250, 204, 21, 0.8);
}


.nav-list a {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 6px 0;
  color: var(--fg);
}

.nav-list a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* 右端ブロック（検索＋ハンバーガー） */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* 検索テキストボックス（細身のピル型） */
.search-input {
  width: clamp(140px, 23vw, 220px);
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .7);
  background: rgba(15, 23, 42, .95);
  color: var(--fg);
  font-size: 13px;
  outline: none;
}

.search-input::placeholder {
  color: rgba(148, 163, 184, .85);
}

.search-input:focus {
  border-color: rgba(56, 189, 248, .9);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, .6),
    0 0 18px rgba(56, 189, 248, .65);
}

/* 検索ボタン：SVA 風ピルボタン */
.search-btn {
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, .85);
  background:
    radial-gradient(circle at 30% 0%, #e0f2fe, transparent 60%),
    linear-gradient(135deg, #0ea5e9, #0369a1);
  color: #0b1120;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}

.search-btn:hover {
  filter: brightness(1.04);
}

/* ハンバーガーメニュー（モバイル） */
.nav-toggle {
  display: none;
  appearance: none;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .7);
  background: rgba(15, 23, 42, .9);
  color: var(--fg);
  padding: 6px 10px;
  cursor: pointer;
}

.nav-toggle .bars {
  display: inline-block;
  inline-size: 18px;
  block-size: 2px;
  background: currentColor;
  box-shadow:
    0 6px 0 0 currentColor,
    0 12px 0 0 currentColor;
}

/* === PC幅の微調整 ========================= */
@media (min-width: 881px) {
  .header-inner {
    align-items: center;
  }
}

/* === モバイル時のナビ配置 ================== */
@media (max-width: 880px) {

  /* ヘッダー内の要素配置：ロゴ左・検索右上にまとめる */
  .header-inner {
    gap: 12px;
  }

  .primary-nav {
    position: absolute;
    inset-inline: 16px;
    top: calc(100% + 8px);
    /* ★ ヘッダーの高さに追従して下に出す */
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 14px;
    box-shadow: var(--shadow);
    display: none;
    justify-content: flex-start;
    z-index: 50;
  }

  .primary-nav.open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    gap: 0;
    padding: 6px 8px;
  }

  .nav-list a {
    padding: 8px 10px;
    font-size: 13px;
  }

  .header-actions {
    margin-left: auto;
  }

  .search-input {
    width: clamp(120px, 32vw, 200px);
  }

  .nav-toggle {
    display: inline-flex;
    /* ★ スマホでだけ表示 */
  }
}

/* さらに狭い幅（スマホ縦）のとき、検索とハンバーガーが重ならないように2段に */
@media (max-width: 520px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .search-input {
    width: 65%;
  }
}

/* === 7) 記事ヘッダー（タイトルなど） ============ */
.layout {
  padding-block: 20px;
}

.article-header {
  margin-block: 10px 18px;
}

.eyebrow {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.title {
  font-size: clamp(22px, 4.6vw, 40px);
  line-height: 1.15;
  margin: .2em 0;
}

.meta {
  color: var(--muted);
  font-size: 14px;
}

.hero {
  margin: 14px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.hero figcaption {
  padding: 8px 12px;
  color: var(--muted);
  font-size: 13px;
}

/* === 8) 本文（読みやすさ重視） ================== */
.prose {
  font-size: clamp(16px, 2.1vw, 18.5px);
  line-height: 1.9;
}

.prose h2 {
  font-size: clamp(20px, 2.8vw, 28px);
  line-height: 1.25;
  margin: 1.6em 0 .6em;
}

.prose h3 {
  font-size: clamp(18px, 2.5vw, 22px);
  margin: 1.2em 0 .4em;
}

.prose p {
  margin: .9em 0;
}

.prose ul,
.prose ol {
  padding-left: 1.2em;
  margin: .8em 0;
}

.prose li {
  margin: .3em 0;
}

.prose blockquote {
  margin: 1em 0;
  padding: .6em 1em;
  border-left: 3px solid color-mix(in oklab, var(--primary) 40%, transparent);
  background: color-mix(in oklab, var(--primary) 6%, transparent);
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .95em;
  padding: .1em .3em;
  border-radius: 6px;
  background: color-mix(in oklab, var(--fg) 10%, transparent);
}

.prose pre {
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in oklab, var(--fg) 12%, transparent);
  overflow: auto;
}

figure {
  margin: 1em 0;
}

figcaption {
  color: var(--muted);
  font-size: .9em;
  margin-top: .4em;
}

/* === 9) 表（横スクロール対応） ================== */
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

table {
  border-collapse: collapse;
  min-width: 560px;
  width: 100%;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
}

/* 注意枠（メモなど） */
.note {
  margin: 1em 0;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: color-mix(in oklab, var(--primary) 5%, transparent);
}

/* === 10) 記事フッター（著者情報） ============== */
.article-footer {
  margin-top: 26px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  inline-size: 48px;
  block-size: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.author-name {
  font-weight: 600;
  margin: 0;
}

.author-bio {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}


/* === 11) サイト全体フッター ====================== */
/* ============================
   フッター（広告耐性・視認性強化）
   ============================ */

.site-footer {
  position: relative;
  /* fixed にしない（重要） */
  margin-top: 48px;
  padding: 24px 16px 20px;

  background: rgba(3, 7, 18, 0.);
  /* ← 不透明度アップ */
  backdrop-filter: blur(10px);
  /* ぼかしは弱めに */

  border-top: 1px solid rgba(148, 163, 184, 0.45);
  /* 境界を明確に */
  color: var(--muted);
  text-align: center;
}

/* フッター内テキスト */
.site-footer p,
.site-footer small {
  font-size: 13px;
  line-height: 1.7;
  margin: 6px 0;
  color: rgba(226, 232, 240, 0.85);
}

/* コピーライト */
.site-footer .copyright {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(226, 232, 240, 0.6);
}


.footer-inner,
.footer-warn {
  padding-block: 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* 注意書きは少し幅を絞って中央に */
.footer-warn {
  max-width: 960px;
  margin-inline: auto;
  padding-bottom: 18px;
}


/* === 検索結果オーバーレイ ==================== */
/* 画面全体を覆うレイヤー（最初は非表示） */
#searchOverlay {
  display: none;
  /* script.js で block に切り替え */
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9999;
  overflow-y: auto;
}

/* 中央に表示する検索結果パネル */
#searchResults.search-results-panel {
  margin: 40px auto;
  max-width: 720px;
  padding: 20px 20px 24px;
  border-radius: 6px;
  background: rgba(5, 10, 25, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.7);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
  color: var(--fg);
}


/* ヘッダー（タイトル＋閉じるボタン） */
.search-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.search-results-title {
  margin: 0;
  font-size: 18px;
  color: var(--fg);
  /* ← ほぼ白に */
}

/* 閉じるボタン */
.search-results-close {
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  background: #f97373;
  color: #fff;
}

.search-results-close:hover {
  filter: brightness(1.05);
}

/* 実際の検索結果テキストを表示する領域 */
.search-results-body {
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 4px;
}



/* ====== ここから「カードっぽく見せる」設定 ====== */

/* 1行分（appendLine や typeToConsole が挿入する1ブロック） */
#resultsContent>div {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #f8fafc;
  padding: 12px 14px;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: #0f172a;
  /* 濃いネイビー */
  /* ★ 追加：結果テキストの色 */
}


/* エラーメッセージらしき行は色を変えたい場合 */
#resultsContent>div:has([data-error]),
#resultsContent>div:has(.error) {
  border-color: #fca5a5;
  background: #fef2f2;
}

/* URL 部分（script.js が自動で <a> にしてくれる）をカード内リンク風に */
#resultsContent a {
  display: inline-block;
  margin-top: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  border: 1px solid rgba(59, 130, 246, 0.55);
  background: #eff6ff;
  color: #1d4ed8;
  word-break: break-all;
}

#resultsContent a:hover {
  background: #dbeafe;
}

/* ダークテーマにしている場合の色調整（任意） */
@media (prefers-color-scheme: dark) {
  #searchResults.search-results-panel {
    margin: 40px auto;
    max-width: 720px;
    padding: 20px 20px 24px;
    border-radius: 4px;
    background: rgba(5, 10, 25, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.7);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
    color: var(--fg);
  }

  #resultsContent>div {
    border-radius: 4px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: rgba(15, 23, 42, 0.95);
    padding: 10px 12px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--fg);
  }

  #resultsContent a {
    background: #0b1120;
    border-color: rgba(96, 165, 250, 0.7);
    color: #bfdbfe;
  }
}

/* ローディング行だけカード枠を外して、普通のテキスト表示にする */
#resultsContent>div.loading-line {
  border: none;
  background: transparent;
  padding: 0;
  margin-bottom: 8px;
  box-shadow: none;
  font-size: 14px;
  line-height: 1.6;
  color: #374151;
  /* ちょっと濃いグレー */
}


/* =========================================
   弓降岳天文台 トップページ用スタイル
   ========================================= */

/* ヒーローセクション ---------------------- */
/* ヒーローセクション ---------------------- */
.observatory-hero {
  margin-top: 44px;
  padding: 40px 16px 32px;
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
  background: none;
  /* 枠っぽい背景を消す */
  box-shadow: none;
  /* カード風シャドウも消す */
}


.hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}

.observatory-title {
  font-size: clamp(30px, 5.2vw, 40px);
  margin: 0 0 14px;
  color: var(--fg);
  border-bottom: 1px solid var(--muted);
}

.observatory-lead {
  margin: 0 0 12px;
  color: color-mix(in oklab, var(--fg) 88%, var(--muted));
  font-size: 16px;
  line-height: 1.9;
}

.observatory-body {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.9;
}


.observatory-title {
  font-size: clamp(26px, 4.4vw, 34px);
  margin: 0 0 10px;
}

.observatory-lead {
  margin: 0 0 10px;
  color: color-mix(in oklab, var(--fg) 82%, var(--muted));
  font-size: 15px;
}

.observatory-body {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* コンテンツ全体 -------------------------- */
.observatory-Item {
  margin-top: 32px;
  padding-block: 8px 24px;
}

.observatory-section-title {
  color: var(--accent);
  text-shadow: 0 0 14px rgba(250, 204, 21, 0.25);
  text-align: center;
  /* 追加 */
  letter-spacing: 0.25em;
  /* お好みで */
  font-size: 14px;
  margin: 0 0 16px;
}





/* 月齢 & 天気カードのグリッド ------------- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  max-width: 720px;
  margin: 0 auto 28px;
  /* 中央寄せ＋少し余白 */
}


/* 共通カードデザイン ---------------------- */
.info-card,
.article01,
.obs-card {
  background: rgba(5, 10, 25, 0.45);
  /* ← 0.65 → 0.45：星空が透ける */
  backdrop-filter: blur(20px) saturate(180%);
  /* ぼかし強めでガラス感UP */
  border: 1px solid rgba(148, 163, 184, 0.35);
  /* 枠線もやや控えめに */
  border-radius: var(--radius);

}



/* カードのタイトル行 ---------------------- */
.info-card-title {
  position: relative;
  margin: 0;
  padding: 10px 14px 8px;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #e5e7eb;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.35), transparent);
  border-bottom: 1px solid rgba(148, 163, 184, 0.6);
}


.info-card-title span {
  background: linear-gradient(90deg, #e5e7eb, #bfdbfe);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.info-card-title::before {
  content: "☾";
  display: inline-block;
  margin-right: 6px;
  font-size: 1.1em;
  vertical-align: -1px;
  color: #fde68a;
  text-shadow: 0 0 6px rgba(253, 224, 71, 0.8);
}

/* 天気カードだけアイコンを変える */
#weather-section .info-card-title::before {
  content: "☼";
  color: #facc15;
}

/* 月齢カードの境界線クリックエリア -------- */
.border-toggle {
  height: 8px;
  background: rgba(148, 163, 184, 0.6);
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

/* 月齢コンテンツ -------------------------- */
.moon-content {
  position: relative;
  padding: 10px 16px 12px;
}

#moon-image {
  width: min(46vw, 160px);
  padding: 4px 0;
}

.phase-text {
  margin: 4px auto 0;
  font-size: 0.9rem;
}

.moon-caption {
  font-size: 11px;
}

.weather-content {
  padding: 12px 16px 14px;
}

.weather-placeholder {
  font-size: 12px;
}


/* 星の粒っぽいテクスチャ */
.moon-content::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(248, 250, 252, 0.35) 0, transparent 55%),
    radial-gradient(circle at 80% 40%, rgba(248, 250, 252, 0.22) 0, transparent 55%),
    radial-gradient(circle at 30% 80%, rgba(248, 250, 252, 0.18) 0, transparent 60%);
  opacity: 0.15;
  pointer-events: none;
}

.moon-content>* {
  position: relative;
  z-index: 1;
}

/* 日付入力欄 */
#moon-date-input {
  display: none;
  /* JS でも制御しているが、初期状態を保証 */
  width: 70%;
  max-width: 230px;
  height: 34px;
  margin: 4px auto 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  text-align: center;
  font-size: 0.9rem;
  outline: none;
  display: block;
  transition:
    border-color 0.2s ease-out,
    box-shadow 0.2s ease-out,
    background-color 0.2s ease-out;
}

#moon-date-input:focus {
  border-color: rgba(96, 165, 250, 0.9);
  box-shadow:
    0 0 0 1px rgba(37, 99, 235, 0.8),
    0 0 18px rgba(59, 130, 246, 0.55);
  background: rgba(15, 23, 42, 0.98);
}

/* 月の画像 */
#moon-image {
  display: block;
  margin: 4px auto 0;
  width: min(52vw, 190px);
  height: auto;
  padding: 8px 0;
  filter:
    drop-shadow(0 0 12px rgba(248, 250, 252, 0.85)) drop-shadow(0 0 32px rgba(56, 189, 248, 0.55));
  transform: translateY(0);
  transition:
    transform 0.25s ease-out,
    filter 0.25s ease-out;
}

/* PC ホバー時にふわっと浮く感じ */
@media (hover: hover) {
  #moon-image:hover {
    transform: translateY(-3px) scale(1.02);
    filter:
      drop-shadow(0 0 18px rgba(248, 250, 252, 0.95)) drop-shadow(0 0 40px rgba(96, 165, 250, 0.8));
  }
}

/* 月相テキスト */
.phase-text {
  color: #e5e7eb;
  text-align: center;
  margin: 4px auto 0;
  padding: 4px 8px 4px;
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow:
    0 0 8px rgba(15, 23, 42, 0.9),
    0 0 18px rgba(15, 23, 42, 0.9);
  box-sizing: border-box;
}

/* 補足説明 */
.moon-caption {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

/* 天気カード ------------------------------ */
.weather-content {
  padding: 14px 18px 16px;
}

.weather-placeholder {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}

/* NEWS セクション ------------------------ */
.observatory-News {
  margin-top: 22px;
}

.article01 {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(148, 163, 184, 0.35);
  /* 共通ルールと合わせる */
  background: rgba(5, 10, 25, 0.45);
  /* 半透明に */
  backdrop-filter: blur(20px) saturate(180%);
  /* ガラス感 */
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  margin-bottom: 10px;
}


.article01 h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.article01 p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}


/* カードリンク一覧 ------------------------ */
.observatory-links {
  margin-top: 26px;
}

.observatory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.obs-card {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(5, 10, 25, 0.45);
  /* 半透明ガラス */
  backdrop-filter: blur(20px) saturate(180%);
  text-decoration: none;
  color: var(--fg);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
}


.obs-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.obs-card p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.obs-card:hover {
  text-decoration: none;
  border-color: var(--primary);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.65);
}

/* 少し画面が広いときの微調整 -------------- */
@media (min-width: 768px) {
  .observatory-hero {
    padding-block: 46px 34px;
  }
}


html,
body {
  font-family: "Montserrat", "Noto Sans JP", sans-serif;
  font-weight: 300;
}

/* ===== 右下の大きい月（“1/4だけ見せる”） ===== */
#moon-wrapper {
  position: fixed;
  right: -18vmin;
  /* 右へはみ出させる */
  bottom: -18vmin;
  /* 下へはみ出させる */
  width: clamp(260px, 42vw, 520px);
  aspect-ratio: 1 / 1;
  pointer-events: none;
  z-index: 5;
  /* グリッドより上／本文より下 にする */
}

.big-moon__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 28px rgba(255, 255, 255, 0.45));
  transform: none;
}

/* 通常月 */
.moon-base {
  z-index: 1;
}

/* 赤月 */
.moon-red {
  z-index: 2;
  opacity: 0;
  transition: opacity 1.2s ease;
}


/* =========================================
   Weather card (追加)
   ========================================= */

.weather-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px 6px;
}

.weather-icon-wrap {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  display: grid;
  place-items: center;
}

.weather-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, .35));
  transform: translateZ(0);
}

/* 5回目：金色フラッシュ */
.weather-icon.is-gold-flash {
  animation: goldFlash 900ms ease-out 1;
}

@keyframes goldFlash {
  0% {
    filter: drop-shadow(0 0 0 rgba(250, 204, 21, 0));
  }

  30% {
    filter: drop-shadow(0 0 22px rgba(250, 204, 21, .95)) drop-shadow(0 0 40px rgba(250, 204, 21, .55));
  }

  100% {
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, .35));
  }
}

.weather-meta {
  min-width: 0;
}

.weather-status {
  margin: 0;
  font-size: 16px;
  letter-spacing: .06em;
  color: rgba(248, 250, 252, .92);
}

.weather-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(226, 232, 240, .72);
}

#weatherTemp {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(226, 232, 240, .72);
}

.weather-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px 14px;
  border-top: 1px solid rgba(148, 163, 184, .22);
}

.weather-btn {
  appearance: none;
  border: 1px solid rgba(56, 189, 248, .55);
  background: rgba(15, 23, 42, .55);
  color: rgba(248, 250, 252, .92);
  padding: 8px 12px;
  border-radius: 6px;
  /* 角丸を強くしない */
  letter-spacing: .08em;
  cursor: pointer;
}

.weather-btn:hover {
  border-color: rgba(56, 189, 248, .9);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, .25);
}

.weather-btn.-gold {
  border-color: rgba(250, 204, 21, .7);
  background: rgba(250, 204, 21, .12);
}

.weather-hint {
  font-size: 12px;
  color: rgba(226, 232, 240, .70);
  letter-spacing: .06em;
}

/* 7回目解放の入力UI */
.weather-unlock {
  margin: 0 16px 16px;
  padding: 14px 14px 12px;
  border: 1px solid rgba(148, 163, 184, .25);
  background: rgba(5, 10, 25, .28);
  backdrop-filter: blur(18px) saturate(170%);
}

.weather-unlock-title {
  font-size: 12px;
  letter-spacing: .14em;
  color: rgba(250, 204, 21, .9);
  margin: 0 0 10px;
}

.weather-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.weather-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: rgba(226, 232, 240, .78);
}

.weather-input {
  width: 180px;
  max-width: 42vw;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, .55);
  background: rgba(15, 23, 42, .55);
  color: rgba(248, 250, 252, .92);
  outline: none;
}

.weather-input:focus {
  border-color: rgba(250, 204, 21, .85);
  box-shadow: 0 0 0 1px rgba(250, 204, 21, .25);
}

.weather-note {
  margin: 10px 0 0;
  font-size: 11px;
  color: rgba(226, 232, 240, .65);
}

@media (max-width: 520px) {
  .weather-row {
    gap: 12px;
  }

  .weather-icon-wrap {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
  }

  .weather-icon {
    width: 48px;
    height: 48px;
  }

  .weather-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .weather-input {
    width: 100%;
    max-width: 100%;
  }
}

/* ===== Weather icon hover (moon と同系統) ===== */
@media (hover: hover) {
  #weather-section #weatherIcon:hover {
    transform: scale(1.06);
    filter:
      drop-shadow(0 0 16px rgba(248, 250, 252, 0.55)) drop-shadow(0 0 34px rgba(56, 189, 248, 0.55));
  }
}

/* ============================
   Weather card reload alert
   ============================ */

/* 赤フラッシュ用 */
.weather-alert {
  animation: weatherAlertFlash 0.9s ease-out 1;
}

@keyframes weatherAlertFlash {
  0% {
    box-shadow:
      0 0 0 rgba(239, 68, 68, 0),
      inset 0 0 0 rgba(239, 68, 68, 0);
    background-color: rgba(239, 68, 68, 0.05);
  }

  35% {
    box-shadow:
      0 0 28px rgba(239, 68, 68, 0.75),
      inset 0 0 24px rgba(239, 68, 68, 0.25);
    background-color: rgba(239, 68, 68, 0.18);
  }

  100% {
    box-shadow:
      0 0 0 rgba(239, 68, 68, 0),
      inset 0 0 0 rgba(239, 68, 68, 0);
    background-color: transparent;
  }
}

/* =========================
   天気カード：警告状態（7回目以降）
   ========================= */
#weather-section.weather-alert {
  background: linear-gradient(180deg,
      rgba(120, 20, 20, 0.85),
      rgba(60, 10, 10, 0.85));
  box-shadow:
    0 0 0 1px rgba(255, 80, 80, 0.6),
    0 0 40px rgba(255, 60, 60, 0.25);
}

/* タイトルと文字も少し強調 */
#weather-section.weather-alert .info-card-title span {
  color: #ffe4e4;
}

#weather-section.weather-alert .weather-phase {
  color: #fff;
}

/* =========================================
   左上固定：だーくまちゃんメニュー（背景なし）
   ========================================= */
.floating-darkuma {
  position: fixed;
  left: 30px;
  top: 96px;
  /* ヘッダーの少し下。必要なら数値だけ微調整 */
  z-index: 9000;

  display: block;
  width: clamp(105px, 15vw, 165px);
  /* 以前の約1.5倍 */
  aspect-ratio: 1 / 1;

  /* 背景の丸い円を完全に消す */
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;

  text-decoration: none;
  cursor: pointer;

  /* 通常時は少し透ける → ホバーで透明度UP */
  opacity: 0.82;
  transition: opacity .2s ease-out;

  /* ふわふわ上下 */
  animation: floatY 3.6s ease-in-out infinite;
}

.floating-darkuma__img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  /* 画像をそのまま（切り抜かずに） */
  border-radius: 0;
  /* 丸マスクもしない（画像そのまま） */

  /* 余計な光り方はさせない */
  filter: none;
  transition: none;
}

/* ホバー時：透明度が上がるだけ */
@media (hover: hover) {
  .floating-darkuma:hover {
    opacity: 1;
  }
}

/* ふわふわアニメ */
@keyframes floatY {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

/* 動きを減らす設定 */
@media (prefers-reduced-motion: reduce) {
  .floating-darkuma {
    animation: none !important;
    transition: none !important;
  }
}


/* PCなど hover 可能環境だけ演出 */
@media (hover: hover) {
  .floating-darkuma:hover {
    transform: translateY(-2px) scale(1.02);
    border-color: rgba(56, 189, 248, 0.65);
    box-shadow:
      0 14px 32px rgba(0, 0, 0, 0.62),
      0 0 34px rgba(56, 189, 248, 0.32);
  }

  .floating-darkuma:hover .floating-darkuma__img {
    transform: scale(1.04);
    filter:
      drop-shadow(0 0 16px rgba(248, 250, 252, 0.45)) drop-shadow(0 0 30px rgba(56, 189, 248, 0.35));
  }
}

/* スマホ：少し下＆少し小さめ */
@media (max-width: 520px) {
  .floating-darkuma {
    left: 8px;
    top: 40vh;
    width: 74px;
  }
}

/* 動きを減らす設定 */
@media (prefers-reduced-motion: reduce) {

  .floating-darkuma,
  .floating-darkuma__img {
    transition: none !important;
  }
}

/* 背景ステージ（最背面） */
.sky-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.sky-stage__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sky-stage__grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}



/* 30秒後の切替で少しだけ強める（任意） */
.sky-stage__grid.is-revealed {
  opacity: 1;
}

/* 既存のビネットがある場合：グリッドより上に置く */
.sky-stage__vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;

  /* ビネットを弱める（暗すぎを解消） */
  background: radial-gradient(circle at 50% 45%,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0.10) 55%,
      rgba(0, 0, 0, 0.35) 100%);
}


/* UIは必ず月より前 */
.site-header,
.observatory-hero,
.observatory-Item,
.observatory-News,
.info-grid,
.article01,
.observatory-section-title,
footer {
  position: relative;
  z-index: 5;
}

/* =========================
   背景レイヤー再定義
   ========================= */

body {
  margin: 0;
  position: relative;
  overflow-x: hidden;
}

/* 星空・グリッド */
#bg-effects {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#bg-grid {
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: screen;
  opacity: 0.35;
}

/* 月（右下 1/4 表示） */
#moon-layer {
  position: fixed;
  right: -20%;
  bottom: -20%;
  width: 50vw;
  max-width: 600px;
  z-index: 1;
  pointer-events: none;
}

#moon-layer img {
  width: 100%;
  height: auto;
}

/* コンテンツは必ず前面 */
.site-header,
main,
footer {
  position: relative;
  z-index: 10;
}

/* ===== ヘッダーは sticky に戻す（上の謎の隙間を消す） ===== */
body {
  padding-top: 0 !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
}

/* =========================================================
   FIX PATCH: 背景/グリッド/大きい月/本文のレイヤーを復旧
   （このブロックは styles.css の末尾に追記）
========================================================= */

/* ブラウザ上の“謎の隙間”対策（基本の余白リセット） */
html,
body {
  margin: 0;
  padding: 0;
}

/* ヘッダーが最前面に来るように */
.site-header,
header {
  position: sticky;
  top: 0;
  z-index: 50;
}

/* 本文が背景より前に来るように（重要） */
main,
.main,
.content,
.container,
.wrapper {
  position: relative;
  z-index: 20;
}

/* ===== 背景ステージ ===== */
.bg-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* 星空（通常合成） */
.bg-stage .bg-sky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;

  /* 20秒〜30秒で赤くする（JSが --bgHue を更新） */
  filter:
    hue-rotate(var(--bgHue, 0deg)) saturate(1.15) brightness(var(--bgDim, 1));
  transition: filter 0.25s linear;
}

/* グリッド（スクリーン合成） */
.bg-stage .bg-grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;

  mix-blend-mode: screen;
  /* ←これが“スクリーン合成” */
  opacity: 0.65;
}

/* 歯車入りグリッドは最初は見えない（30秒でフェードイン） */
.bg-stage .bg-grid--gear {
  opacity: 0;
  transition: opacity 2.8s ease;
  /* “じんわり” */
}

body.is-gear-on .bg-stage .bg-grid--gear {
  opacity: 0.85;
}

/* ===== 大きい月（背景より前、本文より後ろ）===== */
.big-moon {
  position: fixed;
  right: -32vmin;
  /* 右下に“1/4だけ”出すための押し出し */
  bottom: -32vmin;
  width: clamp(420px, 62vmin, 760px);
  aspect-ratio: 1 / 1;
  z-index: 10;
  /* 背景(0) < 月(10) < 本文(20) */
  pointer-events: none;
}

.big-moon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;

  /* 通常の白いグロウ */
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.55));
  transition: filter 0.25s linear;
}

/* 月の減光（赤黒く） */
.big-moon::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.65);
  mix-blend-mode: multiply;
  opacity: var(--moonDim, 0);
  /* 0→1で暗く */
}

/* 月の“円弧”赤化レイヤー（直線clipをやめて円弧マスクに） */
.big-moon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;

  /* 赤い着色（色相） */
  background: rgba(140, 0, 0, 0.92);
  mix-blend-mode: color;
  opacity: 1;

  /* ★ここが肝：円弧で進むマスク */
  /* --moonProg: 0→1 で、赤領域が左から円弧状に広がる */
  -webkit-mask-image: radial-gradient(circle at calc((1 - var(--moonProg)) * 140%) 50%,
      #000 0%,
      #000 30%,
      transparent 65%,
      transparent 100%);
  mask-image: radial-gradient(circle at calc((1 - var(--moonProg)) * 140%) 50%,
      #000 0%,
      #000 30%,
      transparent 65%,
      transparent 100%);

  /* 端を少し柔らかく（好みで） */
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}


/* 月のグロウも赤く変える（進行に合わせてJSがクラス付与） */
body.is-bloodmoon .big-moon img {
  filter: drop-shadow(0 0 18px rgba(255, 80, 80, 0.65));
}

/* スマホで月が寄りすぎる/はみ出る対策 */
@media (max-width: 700px) {
  .big-moon {
    right: -40vmin;
    bottom: -40vmin;
    width: clamp(360px, 78vmin, 680px);
  }
}

/* ===== Scene vignette (背景+グリッド+大きい月にまとめて掛ける) ===== */
.scene-vignette{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 15; /* 背景(0) < 月(10) < これ(15) < 本文(20) */

  background: radial-gradient(circle at 50% 45%,
    rgba(0,0,0,var(--vgn-a1)) 0%,
    rgba(0,0,0,var(--vgn-a2)) var(--vgn-inner),
    rgba(0,0,0,var(--vgn-a2)) var(--vgn-mid),
    rgba(0,0,0,var(--vgn-a3)) var(--vgn-outer)
  );
}
