/* ============================================================
   lunar.css — 月のゲートカレンダー（lunar.php）専用スタイル v=1
   ============================================================
   chart.css は交代制＋キャッシュキー問題のため読み込まない。
   共有UI（言語トグル / フッター / ボトムナビ）は chart.css から
   必要ブロックのみ複製（複製元: chart.css の該当セクション）。
   サイトトーン: 背景 #F5F2ED / 紺 #1A2B4C / 金 #C4A265
   ============================================================ */

/* ============================
   言語切替ボタン（chart.css より複製）
   ============================ */
.lang-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 50;
  display: flex;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(196, 162, 101, 0.3);
  border-radius: 4px;
  backdrop-filter: blur(8px);
}

.lang-btn {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  background: transparent;
  border: none;
  color: #1A2B4C;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.lang-btn:hover { background: rgba(196, 162, 101, 0.15); }
.lang-btn.active { background: #C4A265; color: #fff; }

/* ============================
   フッター（chart.css より複製）
   ============================ */
.site-footer {
  margin-top: 3rem;
  padding: 1.5rem 1rem 2rem;
  border-top: 1px solid rgba(196, 162, 101, 0.25);
  text-align: center;
  font-size: 0.75rem;
  color: rgba(26, 43, 76, 0.55);
}
.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1rem;
  margin-bottom: 0.6rem;
}
.site-footer-links a {
  color: rgba(26, 43, 76, 0.7);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.site-footer-links a:hover {
  color: #C4A265;
  border-bottom-color: #C4A265;
}
.site-footer-copy {
  color: rgba(26, 43, 76, 0.45);
}

/* ============================
   ボトムナビ（chart.css より複製）
   ============================ */
:root {
  --hdsl-nav-h: 56px;
}

body.has-bottom-nav {
  padding-bottom: calc(var(--hdsl-nav-h) + env(safe-area-inset-bottom));
}

.hdsl-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  box-sizing: border-box;
  height: calc(var(--hdsl-nav-h) + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(196, 162, 101, 0.28);
  box-shadow: 0 -2px 14px rgba(26, 43, 76, 0.07);
  padding-bottom: env(safe-area-inset-bottom);
}

.hdsl-nav-item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 7px 2px 8px;
  text-decoration: none;
  color: rgba(26, 43, 76, 0.5);
  transition: color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.hdsl-nav-item:hover { color: rgba(26, 43, 76, 0.85); }

.hdsl-nav-icon {
  position: relative;
  width: 24px;
  height: 24px;
}
.hdsl-nav-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.hdsl-nav-label {
  font-size: 0.65rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.hdsl-nav-item.is-active { color: #1A2B4C; }
.hdsl-nav-item.hdsl-nav-accent { color: #C4A265; }
.hdsl-nav-item.hdsl-nav-accent:hover { color: #B7944D; }

body.logged-in .hdsl-nav-account .hdsl-nav-icon::after {
  content: "";
  position: absolute;
  top: -1px;
  right: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3FA868;
  border: 1.5px solid #fff;
}

/* ============================================================
   ここから lunar 専用
   ============================================================ */

/* ---- リード文 ---- */
.lunar-intro {
  max-width: 42rem;
  margin: 0 auto 2.5rem;
}
.lunar-lead {
  font-size: 0.95rem;
  line-height: 1.9;
  color: #1A2B4C;
  margin-bottom: 1rem;
}
.lunar-note {
  font-size: 0.85rem;
  line-height: 1.9;
  color: rgba(26, 43, 76, 0.75);
  background: rgba(255, 255, 255, 0.65);
  border-left: 3px solid #C4A265;
  padding: 0.9rem 1.1rem;
  border-radius: 0 6px 6px 0;
}
.lunar-dilemma-note {
  font-size: 0.85rem;
  line-height: 1.9;
  color: rgba(26, 43, 76, 0.75);
  background: rgba(196, 162, 101, 0.10);
  border-left: 3px solid #C4A265;
  padding: 0.9rem 1.1rem;
  border-radius: 0 6px 6px 0;
  margin-top: 0.75rem;
}

/* ---- 出生チャート未作成の案内 ---- */
.lunar-notice {
  max-width: 32rem;
  margin: 2rem auto;
  padding: 1.5rem 1.25rem;
  background: #FFF8EC;
  border: 1px solid rgba(196, 162, 101, 0.4);
  border-radius: 8px;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.8;
  color: #1A2B4C;
}
.lunar-notice-link {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.55rem 1.4rem;
  background: #1A2B4C;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.2s ease;
}
.lunar-notice-link:hover { background: #243a66; }

/* ---- ローディング / エラー ---- */
.lunar-loading {
  text-align: center;
  padding: 3rem 1rem;
  color: rgba(26, 43, 76, 0.5);
  font-size: 0.9rem;
}
.lunar-error {
  max-width: 32rem;
  margin: 1.5rem auto;
  background: #fee2e2;
  color: #ef4444;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  font-size: 0.85rem;
  text-align: center;
}

/* ---- カレンダー見出し・メタ ---- */
.lunar-list-title {
  font-size: 1.25rem;
  font-family: "Shippori Mincho", "Noto Serif JP", serif;
  text-align: center;
  color: #1A2B4C;
  margin-bottom: 0.5rem;
}
.lunar-meta {
  text-align: center;
  font-size: 0.78rem;
  color: rgba(26, 43, 76, 0.6);
  margin-bottom: 0.75rem;
}
.lunar-legend {
  max-width: 40rem;
  margin: 0 auto 2rem;
  font-size: 0.78rem;
  line-height: 1.8;
  color: rgba(26, 43, 76, 0.6);
  text-align: center;
}

/* ---- タイムライン ---- */
.lunar-timeline {
  position: relative;
  max-width: 38rem;
  margin: 0 auto;
  padding-left: 1.5rem;
}
.lunar-timeline::before {
  content: "";
  position: absolute;
  left: 0.45rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 2px;
  background: rgba(196, 162, 101, 0.35);
}

/* ---- ゲート期間カード ---- */
.lunar-card {
  position: relative;
  background: #fff;
  border: 1px solid rgba(26, 43, 76, 0.08);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.7rem;
  box-shadow: 0 1px 4px rgba(26, 43, 76, 0.05);
}
.lunar-card::before {
  content: "";
  position: absolute;
  left: -1.34rem;
  top: 1.1rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #F5F2ED;
  border: 2px solid rgba(196, 162, 101, 0.6);
}

/* 「今」滞在中の期間: 金ハイライト */
.lunar-card--now {
  border-color: #C4A265;
  box-shadow: 0 2px 10px rgba(196, 162, 101, 0.28);
}
.lunar-card--now::before {
  background: #C4A265;
  border-color: #C4A265;
}

/* 一時チャネルが成立する期間: 薄金の下地 */
.lunar-card--channel {
  background: #FDF9F0;
  border-color: rgba(196, 162, 101, 0.45);
}

.lunar-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
}
.lunar-card-time {
  font-size: 0.78rem;
  color: rgba(26, 43, 76, 0.55);
  font-variant-numeric: tabular-nums;
}
.lunar-card-gate {
  font-family: "Shippori Mincho", "Noto Serif JP", serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1A2B4C;
}
.lunar-now-badge {
  display: inline-block;
  background: #C4A265;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.05em;
}

/* ---- 一時チャネル / センター バッジ ---- */
.lunar-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.4rem;
  margin-top: 0.55rem;
}
.lunar-badge-label {
  font-size: 0.68rem;
  color: rgba(26, 43, 76, 0.55);
  margin-right: 0.1rem;
}
.lunar-badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  line-height: 1.4;
}
.lunar-badge-channel {
  background: #1A2B4C;
  color: #fff;
}
.lunar-badge-center {
  background: rgba(196, 162, 101, 0.16);
  border: 1px solid rgba(196, 162, 101, 0.55);
  color: #1A2B4C;
}
.lunar-badge-type {
  background: #C4A265;
  color: #fff;
  font-weight: 600;
}

/* ---- ライン切替時刻（折りたたみ） ---- */
.lunar-lines {
  margin-top: 0.55rem;
  font-size: 0.75rem;
}
.lunar-lines summary {
  cursor: pointer;
  color: rgba(26, 43, 76, 0.5);
  list-style: none;
}
.lunar-lines summary::-webkit-details-marker { display: none; }
.lunar-lines summary::before {
  content: "▸ ";
  color: #C4A265;
}
.lunar-lines[open] summary::before {
  content: "▾ ";
}
.lunar-lines ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
  color: rgba(26, 43, 76, 0.65);
}
.lunar-lines li {
  margin-bottom: 0.15rem;
  font-variant-numeric: tabular-nums;
  list-style: none;
}

/* ---- 新月 / 満月 マーカー行 ---- */
.lunar-phase {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.55rem 0 0.7rem;
  padding: 0.3rem 0.5rem;
  font-size: 0.78rem;
  color: rgba(26, 43, 76, 0.7);
}
.lunar-phase::before {
  content: "";
  position: absolute;
  left: -1.28rem;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1A2B4C;
}
.lunar-phase-full::before { background: #C4A265; }
.lunar-phase-icon { font-size: 0.95rem; }
.lunar-phase-label {
  font-variant-numeric: tabular-nums;
}
.lunar-phase-new .lunar-phase-label,
.lunar-phase-full .lunar-phase-label {
  border-bottom: 1px dashed rgba(196, 162, 101, 0.5);
}

/* ---- カレンダー表示切替 ---- */
.lunar-calendar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}
.lunar-view-toggle {
  display: inline-flex;
  border: 1px solid rgba(196, 162, 101, 0.4);
  border-radius: 999px;
  background: rgba(196, 162, 101, 0.10);
}
.lunar-view-btn {
  font-family: inherit;
  font-size: 0.75rem;
  padding: 0.35rem 0.85rem;
  background: transparent;
  border: none;
  color: rgba(26, 43, 76, 0.75);
  cursor: pointer;
  transition: all 0.2s ease;
}
.lunar-view-btn:hover {
  background: rgba(196, 162, 101, 0.15);
}
.lunar-view-btn:focus-visible {
  outline: 2px solid rgba(196, 162, 101, 0.6);
  outline-offset: 2px;
}
.lunar-view-btn.is-active {
  background: #1A2B4C;
  color: #fff;
}
.lunar-view-btn.is-active:hover {
  background: #243a66;
}

/* ---- タイプ補足 ---- */
.lunar-type-hint {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: rgba(26, 43, 76, 0.6);
}

/* ---- レスポンシブ（480px 以下） ---- */
@media (max-width: 480px) {
  .lunar-intro { margin-bottom: 1.75rem; }
  .lunar-lead { font-size: 0.88rem; }
  .lunar-note { font-size: 0.8rem; padding: 0.75rem 0.9rem; }
  .lunar-dilemma-note { font-size: 0.8rem; padding: 0.75rem 0.9rem; }
  .lunar-timeline { padding-left: 1.1rem; }
  .lunar-timeline::before { left: 0.3rem; }
  .lunar-card { padding: 0.65rem 0.75rem; }
  .lunar-card::before { left: -0.97rem; width: 7px; height: 7px; }
  .lunar-phase::before { left: -0.92rem; }
  .lunar-card-gate { font-size: 0.95rem; }
  .lunar-card-time { font-size: 0.72rem; }
  .lunar-badge { font-size: 0.68rem; }
  .lunar-badge-type { font-size: 0.68rem; }
  .lunar-list-title { font-size: 1.1rem; }
  .lunar-calendar-head {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  .lunar-view-btn { font-size: 0.72rem; padding: 0.3rem 0.7rem; }
  .lunar-type-hint { font-size: 0.72rem; }
}
