/* つきよみ暦 — ニュアンスパステル / モバイルファースト / JSゼロ / システムフォント
   ターゲット: 女性30〜40代。やわらかいライフスタイルメディアの空気感。 */

:root {
  --bg: #fdfbf9;            /* オフホワイト */
  --lavender: #b8a9d9;      /* くすみラベンダー（メインアクセント） */
  --lavender-deep: #9a88c4;
  --lavender-mist: #f1edf8;
  --pinkbeige: #e8cfc4;     /* ピンクベージュ（サブ） */
  --pinkbeige-mist: #f8efeb;
  --ink: #4a4a52;           /* 濃グレー（真っ黒にしない） */
  --ink-soft: #6b6b76;      /* 白地で5.2:1（AA） */
  --link: #6f5ba6;          /* リンク・見出しアクセント。白地で5.6:1（AA） */
  --badge-ink: #3a3a42;     /* パステルバッジ上の文字色。全バッジ地で5.2:1以上 */
  --line: #eee7e0;
  --card: #ffffff;
  --shadow: 0 4px 16px rgba(184, 169, 217, 0.18);
  /* バッジ（やわらかトーン） */
  --c-tensha: #cbb27a;      /* ゴールドベージュ */
  --c-ichiryu: #e8a49c;     /* コーラルピンク */
  --c-tora: #e5b98e;        /* アプリコット */
  --c-mi: #a3bfa8;          /* セージ */
  --c-fujoju: #c3c3c9;      /* ライトグレー */
  --c-full: #cbb27a;
  --c-new: #b8a9d9;
  --c-blue: #9db4d9;
  /* ブランドキャラ用フック */
  --brand-accent: var(--lavender);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.9;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  /* iOSノッチ・ホームバー対応 */
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* ヘッダ */
.site-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem 1.15rem;
  background: var(--card);
}
/* ラベンダー→ピンクベージュのグラデーションヘアライン */
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--lavender), var(--pinkbeige) 55%, var(--lavender-mist));
}
.brand {
  display: flex;
  align-items: center;
  min-height: 44px; /* タップ目標 */
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.16rem;
  letter-spacing: 0.05em;
}
.brand-mark { display: inline-flex; color: var(--brand-accent); }
.brand-mark svg { width: 26px; height: 26px; }
/* Latin表記のロゴ: トラッキング広め・少し小さめで和文ナビと幅バランスを取る */
.brand-name { font-size: 1.04rem; letter-spacing: 0.12em; }
.site-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.35rem; font-size: 0.9rem; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px; /* タップ目標 */
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}
.site-nav a:hover { color: var(--link); background: var(--lavender-mist); }
.site-nav a:active { background: var(--pinkbeige-mist); }

/* パンくず（視認性重視: 少し大きめ・現在地を強調・ホバーで下地） */
.breadcrumbs {
  padding: 0.15rem 1.1rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--ink-soft);
  overflow-x: auto;
  white-space: nowrap;
}
.breadcrumbs a {
  display: inline-block;
  color: var(--link);
  text-decoration: none;
  padding: 0.7rem 0.45rem; /* タップ目標44px */
  margin: 0 -0.15rem;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}
.breadcrumbs a:hover { background: var(--lavender-mist); text-decoration: underline; }
.breadcrumbs a:active { background: var(--pinkbeige-mist); }
.breadcrumbs .sep { margin: 0 0.45rem; color: var(--lavender); }
.breadcrumbs > span:last-child { color: var(--ink); font-weight: 600; }

/* 本文 */
.site-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0.6rem 1.1rem 3rem;
}
h1 {
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
  margin: 1.1rem 0 0.4rem;
}
h1::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--lavender), var(--pinkbeige));
  margin-top: 0.55rem;
}
h2 {
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--ink);
  margin: 2.2rem 0 0.7rem;
  padding-left: 0.7rem;
  border-left: 3px solid var(--lavender);
  border-radius: 1px;
}
h3 { font-size: 1rem; font-weight: 600; margin: 1.6rem 0 0.5rem; }
a { color: var(--link); }
.lead { color: var(--ink-soft); margin-top: 0.8rem; font-size: 0.95rem; }
.note, .notice { font-size: 0.85rem; color: var(--ink-soft); }
.notice {
  background: var(--lavender-mist);
  border-radius: 12px;
  padding: 0.6rem 1rem;
}

/* カードグリッド（トップ） */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}
.card {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem;
}
.card h2 { margin-top: 0.1rem; border-left: none; padding-left: 0; font-size: 1rem; color: var(--link); }
.stat {
  display: grid;
  grid-template-columns: 5em 1fr;
  gap: 0.2rem 0.8rem;
  margin: 0.4rem 0;
}
.stat dt { color: var(--ink-soft); font-size: 0.88rem; }
.stat dd { margin: 0; font-weight: 600; }
.tarot-name { font-weight: 600; margin: 0.3rem 0; }
.tarot-keywords { font-size: 0.9rem; margin: 0.2rem 0; color: var(--ink-soft); }

/* バッジ（ピル型・やわらかトーン） */
.badge {
  display: inline-block;
  font-size: 0.82rem; /* 13px以上を維持（可読性） */
  font-weight: 600;
  color: var(--badge-ink);
  padding: 0.14rem 0.62rem;
  border-radius: 999px;
  margin: 0.12rem 0.25rem 0.12rem 0;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.badge-tensha { background: var(--c-tensha); }
.badge-ichiryu { background: var(--c-ichiryu); }
.badge-tora { background: var(--c-tora); }
.badge-mi { background: var(--c-mi); }
.badge-fujoju { background: var(--c-fujoju); }
.badge-full { background: var(--c-full); }
.badge-new { background: var(--c-new); }
.badge-blue { background: var(--c-blue); }
.badge-row { margin: 0.6rem 0 0.2rem; }

/* テーブルの横スクロールラッパ（狭い画面で表を自分の中でスクロールさせる） */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
  box-shadow: var(--shadow);
  margin: 0.6rem 0 1rem;
}
.table-scroll > .day-table { box-shadow: none; margin: 0; }

/* 縦型カレンダーテーブル（1行=1日） */
.day-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  font-size: 0.92rem;
}
.day-table th {
  background: var(--lavender-mist);
  color: var(--link);
  font-weight: 600;
  padding: 0.55rem 0.6rem;
  text-align: left;
  font-size: 0.82rem;
  white-space: nowrap;
}
.day-table td {
  padding: 0.45rem 0.6rem;
  border-top: 1px solid var(--line);
  vertical-align: top;
  white-space: nowrap; /* 六曜・干支を縦割れさせない */
}
.day-table td.col-badges { white-space: normal; } /* バッジは行内で折り返す */
.day-table td.col-text { white-space: normal; min-width: 11em; } /* 説明系の長文は折り返す */
/* 表内の日付リンク: 見た目は変えずタップ領域を44pxに広げる */
.day-table td a {
  display: inline-block;
  padding-block: 0.55rem;
  margin-block: -0.55rem;
}
.day-table .weekend { background: var(--pinkbeige-mist); }
.col-date { white-space: nowrap; font-weight: 600; }
.col-badges { line-height: 1.7; }

/* リスト */
.link-list, .event-list, .highlight-list, .month-grid {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}
.link-list li, .event-list li { padding: 0.32rem 0; }
.link-list a { display: inline-block; padding: 0.28rem 0; }
/* 下線がすっとスライドして現れる（マイクロインタラクション） */
.link-list a, .footer-links a {
  text-decoration: none;
  background-image: linear-gradient(var(--lavender-deep), var(--lavender-deep));
  background-repeat: no-repeat;
  background-size: 0% 1.5px;
  background-position: 0 100%;
  transition: background-size 0.25s ease;
}
.link-list a:hover, .footer-links a:hover { background-size: 100% 1.5px; }
/* モバイル幅ではリスト内リンクのタップターゲットを44px確保する
   （scripts/audit_responsive.py のタップ監査と対応） */
@media (max-width: 480px) {
  .link-list a, .event-list a, .toc-list a, .toc-sub a,
  .highlight-list a, .article-body li a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}
.event-list.compact li { padding: 0.16rem 0; font-size: 0.93rem; }
.highlight-list li {
  background: var(--card);
  border: 1.5px solid var(--pinkbeige);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 0.7rem 1rem;
  margin: 0.5rem 0;
  font-weight: 600;
}
.month-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
}
.month-grid a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px; /* タップ目標 */
  text-align: center;
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 0.55rem 0;
  text-decoration: none;
  font-weight: 600;
  color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.month-grid a:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(184, 169, 217, 0.28);
}

/* ページャ */
.pager {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 1.4rem 0;
  font-size: 0.93rem;
}
.pager a {
  display: inline-flex;
  align-items: center;
  min-height: 44px; /* 親指で押せるタップ目標 */
  text-decoration: none;
  background: var(--lavender-mist);
  border-radius: 999px;
  padding: 0.3rem 0.95rem;
  transition: background 0.2s ease, transform 0.15s ease;
}
.pager a:hover { background: var(--pinkbeige-mist); }
.pager a:active { transform: scale(0.96); }

/* 記事 */
.article-meta { font-size: 0.83rem; color: var(--ink-soft); }
.article-body p { margin: 1rem 0; }
.article-body table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
  display: block;
  overflow-x: auto;
  border-radius: 12px;
}
.article-body th, .article-body td {
  border: 1px solid var(--line);
  padding: 0.38rem 0.65rem;
}
.article-body th { background: var(--lavender-mist); color: var(--link); }
.article-body blockquote {
  margin: 1rem 0;
  padding: 0.1rem 1rem;
  border-left: 3px solid var(--pinkbeige);
  color: var(--ink-soft);
  background: var(--card);
  border-radius: 0 12px 12px 0;
}

/* 解説ブロック */
.explain {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 0.4rem 1.2rem 1rem;
  margin-top: 2.4rem;
}
.explain h2 { border-left: none; padding-left: 0; font-size: 1rem; color: var(--link); }
.explain p { font-size: 0.93rem; }

/* イラスト差し込みスロット（後日、生成アートで置き換え予定） */
.illust-slot {
  aspect-ratio: 3 / 1;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--lavender-mist), var(--pinkbeige-mist));
  margin: 1.2rem 0;
}

/* 記事挿絵（テーマ別ライブラリ・装飾） */
.article-illust {
  margin: 1.8rem 0;
}
.article-illust img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  box-shadow: var(--shadow);
  user-select: none;
  pointer-events: none;
}

/* 生成イラスト: 雲の区切り（再利用ユーティリティ） */
.cloud-divider {
  display: block;
  width: min(100%, 540px);
  height: auto;
  margin: 1.6rem auto;
  user-select: none;
  pointer-events: none;
}
.cloud-divider-footer { margin: 2.6rem auto 0; opacity: 0.85; }

/* 点線ディバイダ */
.dot-divider {
  border: none;
  border-top: 2px dotted var(--pinkbeige);
  margin: 2rem auto;
  width: 60%;
}

/* フッタ */
.site-footer {
  background: var(--lavender-mist);
  color: var(--ink);
  padding: 1.5rem 1.1rem calc(1.8rem + env(safe-area-inset-bottom));
  font-size: 0.84rem;
  text-align: center;
  margin-top: 2rem;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin: 0 0 0.6rem;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px; /* タップ目標 */
  color: var(--link);
}
.footer-note { color: var(--ink-soft); margin: 0.4rem 0; }
.copyright { margin: 0.5rem 0 0; color: var(--ink-soft); }

/* タブレット以上 */
@media (min-width: 600px) {
  body { font-size: 17px; }
  h1 { font-size: 1.65rem; }
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .month-grid { grid-template-columns: repeat(6, 1fr); }
}

/* ============================================================
   M1.5 インタラクションパス
   スマホ（390px/360px）ファースト。PCは余白のある1〜2カラムに広げる。
   アニメーションは opacity / transform / filter のみ（CLSゼロ）。
   ============================================================ */

/* --- ページ全体のふわっとした立ち上がり --- */
@media (prefers-reduced-motion: no-preference) {
  .site-main { animation: page-in 0.45s ease both; }
}
@keyframes page-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- トップページ: ワイドレイアウト（PCでも間延びしない） --- */
@media (min-width: 900px) {
  .site-main-wide { max-width: 1000px; }
}

/* --- ヒーロー（月相SVGがビジュアルアンカー） --- */
.hero-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin: 1.2rem 0 1.5rem;
  padding: 1.5rem 1.2rem;
  border-radius: 24px;
  background:
    radial-gradient(120% 90% at 85% 0%, rgba(232, 207, 196, 0.35), transparent 60%),
    linear-gradient(160deg, var(--lavender-mist), #fff 70%);
  box-shadow: var(--shadow);
  text-align: center;
}
/* 生成イラストの三日月（あくまで背景装飾。月相SVGがデータ本体） */
.hero-illust {
  position: absolute;
  right: -34px;
  top: -22px;
  width: 170px;
  height: auto;
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
}
.hero-moon, .hero-facts { position: relative; }
.hero-moon { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.hero-phase { margin: 0; font-weight: 600; color: var(--link); letter-spacing: 0.06em; }
.hero-facts { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.hero-rokuyo {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.3;
  color: var(--ink);
}
.hero-sub { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }
.hero-facts .badge-row { margin: 0.2rem 0 0; }
@media (min-width: 900px) {
  .hero-panel {
    flex-direction: row;
    justify-content: center;
    gap: 3.5rem;
    padding: 2.2rem 2.5rem;
    text-align: left;
  }
  .hero-facts { align-items: flex-start; }
  .hero-rokuyo { font-size: 2.4rem; }
  .hero-illust { width: 240px; right: -12px; top: -36px; }
}

/* インライン統計チップ（月齢6.72 など。まばらな表にしない） */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin: 0.35rem 0 0;
}
@media (min-width: 900px) {
  .chip-row { justify-content: flex-start; }
}
.stat-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.22rem 0.75rem;
  font-size: 0.85rem;
  white-space: nowrap;
}
.stat-chip .stat-k { color: var(--ink-soft); font-size: 0.82rem; }
.stat-chip .stat-v { font-weight: 600; }

/* --- 今日のグリッド（タロット＋誕生日診断） --- */
/* 「今日の一枚」と「星座と数秘」は別セクションとして縦に積む
   （詰め込み感の解消。2カラム横並びは廃止し、区切り線と余白で
   独立したセクションだとわかるようにする） */
.today-section { margin: 1.3rem 0; }
.today-section-shindan {
  margin-top: 2.1rem;
  padding-top: 2.1rem;
  border-top: 1px solid var(--line);
}
.disclaimer { text-align: center; margin: 0.8rem 0 0.4rem; }

/* --- 月相SVG（照射部はビルド時計算の静的パス） --- */
.moon-svg { display: block; }
.moon-dark { fill: #eae4f4; }
.moon-lit { fill: #f6e7bd; }
.star { fill: var(--lavender); opacity: 0.55; }
@media (prefers-reduced-motion: no-preference) {
  .moon-lit { animation: moon-glow 5.5s ease-in-out infinite; }
  .star { animation: twinkle 3.4s ease-in-out infinite; }
  .star-2 { animation-delay: 1.2s; }
  .star-3 { animation-delay: 2.3s; }
}
@keyframes moon-glow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(203, 178, 122, 0.35)); }
  50% { filter: drop-shadow(0 0 8px rgba(203, 178, 122, 0.75)); }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.9; }
}

/* --- タロットのカードめくり ---
   JSなし: .is-facedown が付かないので表面が最初から見える（行き止まりなし）。
   JSあり: 裏面スタート → タップで3D回転。カード全体がタップ目標。 */
.tarot-scene { perspective: 900px; margin: 0.3rem 0 0.5rem; }
.tarot-flipper {
  position: relative;
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  aspect-ratio: 2 / 3;
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.33, 1, 0.55, 1);
}
.tarot-flipper:focus-visible { outline: 3px solid var(--lavender); outline-offset: 3px; border-radius: 16px; }
.tarot-face { display: block; }
.tarot-back { display: none; }
/* 裏面/表面は同一グリッドセルに重ねる（絵札で表面が縦に伸びても
   ボタンの高さが表面に追従する。absolute重ねだと高さが取れない） */
.tarot-flipper.is-facedown {
  cursor: pointer;
  display: grid;
  border-radius: 16px;
  box-shadow: 0 10px 22px rgba(74, 74, 82, 0.18), 0 2px 6px rgba(74, 74, 82, 0.12);
  transition: transform 0.6s cubic-bezier(0.33, 1, 0.55, 1), box-shadow 0.3s ease;
}
.tarot-flipper.is-facedown .tarot-face {
  grid-area: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
/* 裏面: 生成した装飾イラスト（クリーム地に金線マンダラ・三日月・星）を
   カード全体に敷き、紫グラデーションは廃止。厚み感は親要素の box-shadow で出す */
.tarot-flipper.is-facedown .tarot-back {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 1rem;
  color: var(--ink);
  background-image: url(/static/illust/tarot/tarot-back.webp);
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}
.tarot-back-hint {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(253, 249, 242, 0.86);
  box-shadow: 0 2px 6px rgba(74, 74, 82, 0.15);
}
.tarot-flipper.is-facedown .tarot-front {
  transform: rotateY(180deg);
  background: var(--lavender-mist);
}
.tarot-flipper.is-flipped { transform: rotateY(180deg); }
.tarot-flipper.is-facedown:not(.is-flipped):hover { box-shadow: 0 14px 28px rgba(74, 74, 82, 0.22), 0 3px 8px rgba(74, 74, 82, 0.14); }
.tarot-flipper.is-facedown:not(.is-flipped):active { transform: scale(0.98); }
.tarot-front {
  padding: 0.9rem 1rem;
}
/* タイトル/キーワードはボタンの外（.tarot-flipper の兄弟要素）に出す。
   裏向き（.is-facedown で未フリップ）の間は表示しない */
.tarot-flipper.is-facedown ~ .tarot-info { display: none; }
.tarot-info { margin-top: 0.6rem; }
.tarot-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.tarot-name { font-weight: 700; font-size: 1.06rem; }
/* 正位置/逆位置は名前の横の小バッジ（タイトルの括弧内に入れない） */
.tarot-orient {
  display: inline-block;
  font-size: 0.82rem; /* 13px以上を維持 */
  font-weight: 600;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.tarot-orient.is-upright { background: var(--c-mi); color: var(--badge-ink); }
.tarot-orient.is-reversed { background: var(--c-fujoju); color: var(--badge-ink); }
/* 額装カード画像（大アルカナ＋ペンタクルの6）。逆位置は180度回転で提示 */
.tarot-art {
  display: block;
  width: min(100%, 230px);
  height: auto;
  margin: 0 auto 0.7rem;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(74, 74, 82, 0.16);
}
.tarot-art.is-reversed,
.tarot-plain.is-reversed { transform: rotate(180deg); }
/* 画像がない小アルカナのテキスト表面（額装画像と同じカード型に揃える） */
.tarot-plain {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 230px);
  aspect-ratio: 2 / 3;
  margin: 0 auto 0.7rem;
  padding: 0.55rem 0.7rem;
  border-radius: 14px;
  background: linear-gradient(172deg, #fdf9f2, var(--lavender-mist));
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.65),
    inset 0 0 0 6px rgba(192, 166, 110, 0.6),
    0 4px 14px rgba(74, 74, 82, 0.12);
}
.tarot-plain-num {
  align-self: flex-start;
  font-weight: 700;
  font-size: 1rem;
  color: #9c8654;
}
.tarot-plain-glyph {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  color: #c0a875;
}
.tarot-plain-glyph svg {
  width: 42%;
  height: auto;
  fill: currentColor;
}
.tarot-plain-name {
  padding-bottom: 0.3rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
}
/* キーワードは文章ではなくチップで折り返す */
.kw-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.kw-chip {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.14rem 0.65rem;
  font-size: 0.82rem;
  color: var(--ink);
  white-space: nowrap;
}

/* トップページの1枚引き（.tarot-scene）だけ、めくった後にカードを
   左・情報（タイトル＋キーワード）を右に並べる2カラムにする。
   3枚引きスプレッド（.tarot-spread）は対象外、従来どおり縦積み。
   カード本体（.tarot-flipper）は裏向き・表向きともサイズ・アスペクト比
   （2:3, max-width 300px）を一切変えない。並べ替えは .tarot-scene 側の
   flexレイアウトだけで行う（.tarot-info は上のルールで裏向き中は非表示）。 */
@media (min-width: 600px) {
  .tarot-scene {
    display: flex;
    align-items: flex-start;
    gap: 1.4rem;
  }
  .tarot-scene .tarot-flipper { flex: 0 0 auto; }
  .tarot-scene .tarot-info {
    flex: 1 1 auto;
    margin-top: 0.4rem;
  }
}

/* 診断カードの隅に、きらきらシートをうっすら敷く */
.shindan-card { position: relative; overflow: hidden; }
.shindan-card::after {
  content: "";
  position: absolute;
  right: -46px;
  bottom: -46px;
  width: 210px;
  height: 208px;
  background: url("/static/illust/sparkles.webp") center / contain no-repeat;
  opacity: 0.3;
  pointer-events: none;
}
.shindan-card > * { position: relative; z-index: 1; }

/* --- 誕生日診断ウィジェット --- */
.shindan-label { display: block; font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 0.35rem; }
.shindan-input {
  width: 100%;
  max-width: 22rem;
  min-height: 48px;
  font: inherit;
  font-size: 16px; /* iOSの自動ズームを防ぐため16px未満にしない */
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 0.5rem 0.8rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.shindan-input:focus {
  outline: none;
  border-color: var(--lavender);
  box-shadow: 0 0 0 3px rgba(184, 169, 217, 0.25);
}
.shindan-result { display: flex; flex-wrap: wrap; gap: 0.45rem; min-height: 2.4rem; margin: 0.7rem 0 0.2rem; }
.shindan-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--badge-ink);
  border-radius: 999px;
  padding: 0.3rem 0.95rem;
  animation: badge-pop 0.3s ease both;
}
.shindan-sign { background: var(--lavender); }
.shindan-lp { background: var(--c-ichiryu); }
@keyframes badge-pop {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

/* --- ふわっと出現（CSSスクロール駆動。未対応ブラウザは普通に表示） --- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .site-main > section,
    .layout-main > section,
    .highlight-list li,
    .day-table {
      animation: rise-in linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 50%;
    }
  }
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* --- マイクロインタラクション --- */
.badge { transition: transform 0.18s ease; }
.badge:hover { transform: scale(1.08); }
.badge:active { transform: scale(0.92); }
button { touch-action: manipulation; }
button:active { transform: scale(0.98); }

/* --- 動きを控えたい設定を尊重する --- */
@media (prefers-reduced-motion: reduce) {
  .tarot-flipper { transition: none; }
  .shindan-badge { animation: none; }
  .moon-lit, .star { animation: none; }
  .badge, .month-grid a, .pager a { transition: none; }
}

/* ============================================================
   M2 入籍日カレンダー・記事ハブ
   ============================================================ */

/* 六曜バッジ（入籍日ランキングのスコア内訳用） */
.badge-taian { background: #a9c9b4; }      /* ソフトグリーン */
.badge-tomobiki { background: #aec6de; }   /* ソフトブルー */
.badge-butsumetsu { background: #c8b7c9; } /* ソフトモーブ */
.badge-sensho { background: #e9dcae; }     /* ソフトイエロー（先勝・納車/開業用） */

/* 日取りコンシェルジュ（/hidori/）: 目的アンカーのピルナビと基準の折りたたみ */
.purpose-nav { margin: 1rem 0 1.8rem; }
.purpose-section { margin-bottom: 2.4rem; }
.purpose-basis { margin: 0.9rem 0; }
.purpose-basis summary {
  cursor: pointer;
  color: var(--ink-soft);
  padding: 0.35rem 0;
  font-weight: 600;
}

/* 戌の日カレンダー: 大安×戌の日の行と、雑節ページの丑の日の行をハイライト */
.inu-taian > td { background: #eef5ef; }   /* badge-taianと同系の淡グリーン */
.yaku-taiyaku > td { background: var(--pinkbeige-mist); }  /* 大厄の行をやわらかく強調 */

/* トップページ: 雑節バッジ（今日は土用の丑の日 など） */
.badge-zassetsu { background: #e4c9a2; color: inherit; text-decoration: none; }

/* ランキングテーブル: TOP3をゴールド・シルバー・ブロンズの淡色でハイライト */
.rank-table .col-rank { text-align: center; }
.rank-num { font-weight: 700; color: var(--link); }
.rank-table .col-score { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rank-1 > td { background: #f9f1da; }  /* ゴールド */
.rank-2 > td { background: #f1f1f5; }  /* シルバー */
.rank-3 > td { background: #f6e9de; }  /* ブロンズ */
.rank-1 .rank-num { color: #a8842e; }
.rank-2 .rank-num { color: #75757f; }
.rank-3 .rank-num { color: #a06a44; }

/* PR枠: アフィリエイト提携が決まるまで非表示。有効化は body.has-pr で行う */
.pr-slot { display: none; }
body.has-pr .pr-slot {
  display: block;
  background: var(--card);
  border: 1.5px dashed var(--line);
  border-radius: 16px;
  padding: 0.9rem 1.1rem;
  margin: 1.4rem 0;
}
.pr-label {
  display: inline-block;
  font-size: 0.82rem; /* 13px以上を維持 */
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--badge-ink);
  background: var(--c-fujoju);
  border-radius: 4px;
  padding: 0.05rem 0.45rem;
}

/* 記事カード（記事ハブ・関連記事）／トップページのカレンダーカードグリッドと
   グリッド定義を共有する（.calendar-card-grid は900px時3列だけ追加で持つ） */
.article-cards, .calendar-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  margin: 1rem 0;
}
@media (min-width: 600px) {
  .article-cards, .calendar-card-grid { grid-template-columns: 1fr 1fr; }
}
.article-card {
  display: block;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1rem 1.2rem;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(184, 169, 217, 0.28);
}
.article-card-title { margin: 0 0 0.3rem; font-weight: 600; color: var(--link); }
.article-card-desc { margin: 0; font-size: 0.87rem; color: var(--ink-soft); line-height: 1.7; }
.article-card-date { margin: 0.45rem 0 0; font-size: 0.82rem; color: var(--ink-soft); }

/* トップページ「解説記事」: articles_index の .article-card を流用しつつ、
   サムネイル挿絵つき・掲載数を絞った帯にしてカレンダーカードグリッドと差をつける */
.home-articles .article-card-thumb {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 0 0 0.6rem;
}
.home-articles .article-card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (min-width: 700px) {
  .home-articles { grid-template-columns: repeat(3, 1fr); }
}

/* トップページ「カレンダーを見る」: カテゴリ別カードグリッド（メディア風）
   グリッド定義は .article-cards と共有（上部で定義済み）。900px時だけ3列にする。 */
@media (min-width: 900px) {
  .calendar-card-grid { grid-template-columns: repeat(3, 1fr); }
}
/* 背景・角丸・影・paddingは .card を流用する（テンプレート側で class="calendar-card card"
   を併記）。ここでは .card にない差分（縦並びflex）だけを持つ。 */
.calendar-card {
  display: flex;
  flex-direction: column;
}
.calendar-card-icon { margin: 0; width: 40px; height: 40px; object-fit: contain; }
.calendar-card-title {
  margin: 0.4rem 0 0.3rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--link);
}
.calendar-card-desc {
  margin: 0;
  font-size: 0.87rem;
  color: var(--ink-soft);
  line-height: 1.7;
}
.calendar-card-years {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.6rem 0 0;
}
/* ピル型リンクの共通土台。個別クラス（.calendar-card-year・.luna-follow）は
   テンプレート側で class="… pill-link" と併記し、ここでは差分だけ持つ。 */
.pill-link {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--lavender-mist);
  color: var(--link);
  font-weight: 600;
  text-decoration: none;
}
.calendar-card-year {
  min-height: 40px;
  padding: 0.2rem 0.9rem;
  font-size: 0.85rem;
}
.calendar-card-year:hover { background: var(--pinkbeige-mist); }
.calendar-card-year--current {
  background: var(--lavender);
  color: var(--badge-ink);
}

/* カレンダー→入籍日ページへの導線 */
.cross-link {
  background: var(--pinkbeige-mist);
  border-radius: 12px;
  padding: 0.6rem 1rem;
  font-size: 0.92rem;
}

@media (prefers-reduced-motion: reduce) {
  .article-card { transition: none; }
}

/* --- 小さめスマホ（360px級）: ヘッダとテーブルを詰める --- */
.brand-name { white-space: nowrap; }
.site-nav a { white-space: nowrap; }
@media (max-width: 419px) {
  .site-header { padding: 0.8rem 0.8rem; }
  .brand { font-size: 1.02rem; gap: 0.4rem; }
  .brand-name { font-size: 0.9rem; letter-spacing: 0.1em; }
  .brand-mark svg { width: 22px; height: 22px; }
  .site-nav { gap: 0.1rem; font-size: 0.84rem; }
  .site-nav a { padding: 0.3rem 0.5rem; }
  .site-main { padding: 0.6rem 0.85rem 3rem; }
  .day-table { font-size: 0.88rem; }
  .day-table th, .day-table td { padding: 0.45rem 0.45rem; }
}

/* ============================================================
   M3 タロット3枚スプレッド・今日のあなた
   ============================================================ */

/* トップの「3枚で詳しく引く →」リンク */
.tarot-more-link { margin: 0.3rem 0 0; font-size: 0.92rem; }
.tarot-more-link a { color: var(--ink-soft); }

/* 3枚スプレッド: 横一列（狭い画面では1列に落とす） */
.tarot-spread {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin: 1rem 0 0.5rem;
  perspective: 900px;
}
.tarot-slot {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.7rem 0.7rem 0.8rem;
}
.tarot-pos {
  margin: 0 0 0.5rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
}
@media (max-width: 599px) {
  .tarot-spread { grid-template-columns: 1fr; }
}

/* 今日のあなた（誕生日入力後に追加表示） */
.shindan-today {
  flex-basis: 100%;
  margin-top: 0.4rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--line);
}
.shindan-today-title {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}
.shindan-rank { background: var(--pinkbeige); }
.shindan-message { margin: 0.5rem 0 0; font-size: 0.95rem; color: var(--ink); }

/* あなたの開運日（誕生日×今月・来月の吉日。app.jsがクライアント側で算出） */
.kaiun-box {
  width: 100%;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--line, #ddd6e4);
}
.kaiun-title {
  margin: 0 0 0.45rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-soft);
}
a.kaiun-chip {
  text-decoration: none;
  color: var(--badge-ink);
  background: var(--c-ichiryu);
  margin: 0 0.3rem 0.3rem 0;
  display: inline-block;
}
.kaiun-share-row { margin: 0.55rem 0 0; }
.kaiun-none { margin: 0.2rem 0 0; font-size: 0.9rem; color: var(--ink-soft); }
.kaiun-note { margin: 0.5rem 0 0; font-size: 0.8rem; color: var(--ink-soft); }

/* ============================================================
   M4 記事目次（TOC）・デスクトップサイドバー
   ============================================================ */

/* --- 目次box: <details open> なのでJSゼロで開閉できる --- */
.toc {
  margin: 1.5rem 0;
  padding: 0.3rem 1.15rem 0.9rem;
  background: linear-gradient(150deg, var(--lavender-mist), var(--pinkbeige-mist));
  border: 1.5px solid var(--line);
  border-radius: 16px;
  font-size: 0.92rem;
}
.toc summary {
  cursor: pointer;
  padding: 0.55rem 0; /* タップ目標44px */
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--link);
  user-select: none;
}
.toc summary:hover { opacity: 0.8; }
.toc-list {
  margin: 0.55rem 0 0.1rem;
  padding-left: 1.5rem;
}
.toc-list li { padding: 0.14rem 0; }
.toc-list a { text-decoration: none; }
.toc-list a:hover { text-decoration: underline; }
.toc-sub {
  margin: 0.15rem 0 0.1rem;
  padding-left: 1.2rem;
  font-size: 0.94em;
  list-style: lower-latin;
}
/* アンカー着地位置に上余白（見出しが画面上端に張り付かない） */
.article-body h2[id], .article-body h3[id] { scroll-margin-top: 1rem; }

/* --- デスクトップサイドバー（<1000pxは完全非表示。モバイル下部と重複させない） --- */
.side-rail { display: none; }
@media (min-width: 1000px) {
  .site-main.has-aside {
    max-width: 1100px;
    display: grid;
    grid-template-columns: minmax(0, 720px) 300px;
    gap: 0 2.2rem;
    justify-content: center;
    align-items: start;
  }
  .site-main.has-aside > .layout-main { min-width: 0; }
  .site-main.has-aside > .cloud-divider-footer { grid-column: 1 / -1; }
  .side-rail {
    display: block;
    position: sticky;
    top: 1.2rem;
    margin-top: 1.4rem;
  }
}
.side-card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 0.9rem 1.15rem 1rem;
  margin-bottom: 1rem;
}
.side-card h2 {
  margin: 0 0 0.5rem;
  padding-left: 0;
  border-left: none;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  color: var(--link);
}
.side-today .side-date { margin: 0; font-weight: 600; }
.side-today .side-date a { color: var(--ink); text-decoration: none; }
.side-today .side-date a:hover { color: var(--link); text-decoration: underline; }
.side-rokuyo { margin: 0.15rem 0 0; font-size: 0.88rem; color: var(--ink-soft); }
.side-card .badge-row { margin: 0.45rem 0 0; }
.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.side-list li { padding: 0.26rem 0; font-size: 0.88rem; line-height: 1.6; }
.side-list a { text-decoration: none; }
.side-list a:hover { text-decoration: underline; }

/* --- 回遊ナビ「ほかの暦を見る」（カレンダーページ共通・全幅で表示） --- */
.cross-nav {
  margin: 2.8rem 0 0;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}
.site-main.has-aside > .cross-nav { grid-column: 1 / -1; }
.cross-nav-title {
  margin: 0 0 0.6rem;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--link);
}
.cross-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.cross-nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.3rem 1.1rem;
  border-radius: 999px;
  background: var(--lavender-mist);
  color: var(--link);
  font-size: 0.92rem;
  text-decoration: none;
}
.cross-nav-list a:hover { background: var(--pinkbeige-mist); }
.cross-nav-list a.is-current {
  background: var(--lavender);
  color: var(--badge-ink);
  font-weight: 600;
}

/* --- あすの暦ティーザー（トップページ） --- */
.tomorrow-card {
  background: var(--lavender-mist);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1rem 1.3rem 1.1rem;
  margin: 1.6rem 0 0;
}
.tomorrow-card h2 {
  margin: 0 0 0.4rem;
  padding-left: 0;
  border-left: none;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  color: var(--link);
}
.tomorrow-headline {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}
.tomorrow-date { margin: 0.15rem 0 0; font-size: 0.92rem; color: var(--ink-soft); }
.tomorrow-link { margin: 0.5rem 0 0; font-size: 0.92rem; }
.tomorrow-link a { text-decoration: none; }
.tomorrow-link a:hover { text-decoration: underline; }

/* --- るな（Threads）フォロー導線 --- */
.luna-card {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  background: var(--pinkbeige-mist);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1rem 1.3rem 1.1rem;
  margin: 1.6rem 0 0;
}
.luna-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 3px solid var(--card);
  box-shadow: var(--shadow);
}
.luna-card h2 {
  margin: 0 0 0.4rem;
  padding-left: 0;
  border-left: none;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  color: var(--link);
}
.luna-intro p { margin: 0; font-size: 0.95rem; }
.luna-intro .luna-follow-row { margin: 0.7rem 0 0; }
.luna-follow {
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.25rem 1.15rem;
  font-size: 0.9rem;
}
.luna-follow:hover { background: #e6def5; }
@media (max-width: 560px) {
  .luna-card { flex-direction: column; text-align: center; }
}

/* --- シェアリンク（外部スクリプトなしの素アンカー） --- */
.share-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1rem 0 0;
}
.share-note { font-size: 0.82rem; color: var(--ink-soft); }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.25rem 1rem;
  border-radius: 999px;
  background: var(--lavender-mist);
  color: var(--link);
  font-size: 0.88rem;
  text-decoration: none;
}
.share-btn:hover { background: var(--pinkbeige-mist); }
.share-btn svg { flex-shrink: 0; }

/* --- 404ページ（お月さまの挿絵） --- */
.notfound { text-align: center; }
.notfound-moon {
  display: block;
  margin: 1.2rem auto 0.4rem;
  width: min(240px, 60vw);
  height: auto;
}
.notfound h1 { border-left: none; padding-left: 0; }
.notfound .lead { text-align: center; }
