/*
  Advent Cosplay — layout.css (stable/safe)
  目的：全体の「骨格」だけを定義。テーマ/各ページの見た目は別CSSで。
  依存：base.css（.wrapper の既定は base 側。ここでは再定義しない）
*/

/* ===========================
   Design tokens for layout only
=========================== */
:root{
  --site-max: 1200px;
  --site-gutter: clamp(12px, 2vw, 24px);
  --site-gap: clamp(16px, 2.2vw, 28px);
}

/* ===========================
   全体
=========================== */
html, body {
  height: 100%;
  width: 100%;
  background: transparent;
}

/* ===========================
   ヘッダー
=========================== */
.site-header {
  position: relative;
  width: 100%;
  z-index: 20;
}
.site-header .header-inner {
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

/* ===========================
   メイン（各ページの土台）
   - flow-root で外部の margin / float 影響を遮断
   - 幅はページ側の .wrapper / section が制御
=========================== */
main.home-main,
main.site-main {
  display: flow-root;
  width: 100%;
  margin: 0;
  padding: var(--site-gutter) 0;
  box-sizing: border-box;
  position: relative;
  z-index: 1; /* 背景や装飾より前に出す土台 */
}

/* ===========================
   共通グリッド（必要な箇所で使用）
=========================== */
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--site-gap);
}

/* ===========================
   サイドバー（使うページのみ）
=========================== */
.sidebar {
  flex: 0 0 300px;
  padding: 16px;
  box-sizing: border-box;
}

/* ===========================
   フッター（骨格のみ）
=========================== */
.site-footer {
  width: 100%;
  text-align: center;
  padding: 16px 0;
  font-size: 0.9rem;
  border-top: 1px solid rgba(0,0,0,.06);
  background: rgba(255,255,255,.85);
}

/* ===========================
   汎用コンテナ（ページ側で選んで使う）
=========================== */
.container,
.content-inner {
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

/* 幅のバリエーション（ページ専用CSSがない時の簡易ユーティリティ） */
.container-narrow { max-width: min(860px, 92vw); margin-inline: auto; }
.container-wide   { max-width: min(1400px, 96vw); margin-inline: auto; }

/* 全幅を “安全に” はみ出させたいとき（ヒーロー等のフルブリード） */
.full-bleed {
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
}

/* ===========================
   汎用ヘルパ
=========================== */
.section { margin: clamp(24px, 3vw, 48px) auto; }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* 画像/メディアの横はみ出し保険（base.css にもあるが二重で安全策） */
main img, main video, main svg, main canvas, main iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── 調整しやすい色（アンティーク系） ── */
:root{
  --wine: #6d213c;        /* 深いワインレッド */
  --wine-ink: #2f0f1b;    /* 文字用の濃色（反転時の背景にも可） */
  --beige: #f5e9da;       /* 文字用の薄ベージュ（反転時の文字色） */
  --navy: #234b8f;        /* 英語ボタン用の差し色（任意） */
  --ring: #e8d2c2;        /* フォーカスリング色 */
}

/* コンテナは余白のみ。背景なしでOK */
.lang-switch{
  display:flex; justify-content:center; align-items:center; gap:.8rem;
  margin:1.4rem auto;
}

/* ベース：単色+細枠。影は極小で“厚み”だけ出す */
.lang-btn{
  display:inline-flex; align-items:center; gap:.4em;
  padding:.5em 1em; border-radius:999px; text-decoration:none;
  font-weight:700; line-height:1;
  background: var(--wine);
  color: var(--beige);
  border:1px solid var(--wine-ink);
  box-shadow: 0 1.5px 0 var(--wine-ink);
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}

/* 反転ホバー：色を入れ替えるだけでクッキリ */
.lang-btn:hover,
.lang-btn:focus-visible{
  background: var(--beige);
  color: var(--wine-ink);
  border-color: var(--wine-ink);
  outline: 2px solid var(--ring);      /* 視認性の高いフォーカス */
  outline-offset: 2px;
}

/* 現在言語（クリック不可の“栞”扱い） */
html[lang="ja"] .lang-btn.is-ja,
html[lang="en"] .lang-btn.is-en{
  cursor: default;
  filter: saturate(110%);
  box-shadow: 0 2px 0 var(--wine-ink);
}

/* 英語ボタンだけ色違いにしたい場合（不要なら削除） */
.lang-btn.is-en{
  background: var(--navy);
  border-color: #18386b;
}
.lang-btn.is-en:hover,
.lang-btn.is-en:focus-visible{
  background: var(--beige);
  color: #18386b;
  border-color: #18386b;
}

/* 触覚の少ない端末でも差が出るよう、:activeで押し込み感 */
.lang-btn:active{ transform: translateY(1px); box-shadow:none; }

