/* =====================================================================
   白梅屋 凛 — 和のしつらえ（トップページ index.html だけで読み込む。先に wa-common.css を読むこと）
   地紋・和紙・木札のボタンなどの共通部分は wa-common.css。ここはトップページだけの飾り。
     ・文様と紙: 梅鉢の地紋、和紙の御宿帳、角印の見出し番号、帳面の二重罫
     ・宿のしつらえ: 立ち絵を掛け軸に表装、区切りに障子の桟
   ===================================================================== */
:root{
  /* 掛け軸の寸法（狭い画面では細くする） */
  --wa-ten: 46px;      /* 上の表装 */
  --wa-chi: 70px;      /* 下の表装 */
  --wa-hashira: 26px;  /* 左右の表装 */
  --wa-jiku: 16px;     /* 軸の太さ */
}

/* ---------- 文様と紙 ---------- */
/* 暗い区画に、ごく薄く梅鉢の地紋を敷く（御宿帳は和紙なので除く） */
body > section:not(.ledger){
  background-color: var(--ink);
  background-image: var(--wa-veil), var(--wa-umebachi);
  background-size: auto, 72px 72px;
}
.ledger{ background-color: var(--wa-washi-bg); background-image: var(--wa-washi); }
.about-figure{ background:#FBF9FA; }

/* 見出し番号（壱・弐…）を角印に */
.section-head{ align-items:center; }
.section-num{
  font-family:'Shippori Mincho', serif; font-style:normal; font-size:17px; line-height:1;
  width:40px; height:40px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  border:1.5px solid var(--gold-soft); border-radius:3px; color:var(--gold-soft);
  box-shadow: inset 0 0 0 3px var(--ink), inset 0 0 0 4px rgba(217,190,129,.45);
}
.ledger .section-num{
  color:var(--plum); border-color:var(--plum);
  box-shadow: inset 0 0 0 3px var(--wa-washi-bg), inset 0 0 0 4px rgba(74,59,92,.4);
}
/* 見出し右の読みがな */
.section-sub{ font-family:'Shippori Mincho', serif; letter-spacing:.3em; }

/* 御宿帳の罫を、帳面のような二重罫に */
.entry-grid{ border-top:3px double rgba(74,59,92,.35); }
.entry-grid .entry-label{ font-family:'Shippori Mincho', serif; color:var(--plum); letter-spacing:.3em; }

/* ---------- 宿のしつらえ ---------- */
/* 立ち絵を掛け軸に表装する: 中廻し（金襴）→ 一文字（金の細線）→ 本紙（立ち絵） */
.hero-visual{ padding: 9vh 0; }
.hero-character{
  width:380px; max-width:100%; height:100%;
  -webkit-mask-image:none; mask-image:none; filter:none; border-radius:0;
  border-style:solid; border-color:transparent;
  border-width: var(--wa-ten) var(--wa-hashira) var(--wa-chi);
  background: url('../images/hero-rin.png') center top / cover padding-box, var(--wa-kinran) border-box;
  background-size: cover, 28px 28px;
  box-shadow: inset 0 0 0 2px rgba(201,162,75,.9), inset 0 0 0 4px var(--ink), 0 30px 60px rgba(0,0,0,.45);
}
/* 上の八双（横木） */
.hero-visual::before{
  content:""; position:absolute; top:calc(9vh - 10px); left:50%; transform:translateX(-50%);
  width:min(380px, 100%); height:10px; border-radius:2px;
  background:linear-gradient(#5b4a3c, #2e241c);
}
/* 下の軸と、両端の軸先 */
.hero-visual::after{
  content:""; position:absolute; bottom:calc(9vh - var(--wa-jiku)); left:50%; transform:translateX(-50%);
  width:calc(min(380px, 100%) + 36px); height:var(--wa-jiku); border-radius:8px;
  background:
    radial-gradient(circle at 50% 50%, #E6CF93 0 40%, #9C7A35 46%, transparent 52%) left / var(--wa-jiku) var(--wa-jiku) no-repeat,
    radial-gradient(circle at 50% 50%, #E6CF93 0 40%, #9C7A35 46%, transparent 52%) right / var(--wa-jiku) var(--wa-jiku) no-repeat,
    linear-gradient(#3a2d23, #1d1611) center / calc(100% - 28px) 70% no-repeat;
}
.visual-caption{ right:-4%; }

/* 区画の上端に、障子の桟 */
section::before{
  content:""; position:absolute; left:0; right:0; top:0; height:14px; pointer-events:none;
  background:
    repeating-linear-gradient(90deg, transparent 0 58px, rgba(217,190,129,.5) 58px 60px),
    linear-gradient(rgba(217,190,129,.5), rgba(217,190,129,.5)) top / 100% 2px no-repeat,
    linear-gradient(rgba(217,190,129,.5), rgba(217,190,129,.5)) bottom / 100% 2px no-repeat;
  opacity:.55;
}
.ledger::before{
  background:
    repeating-linear-gradient(90deg, transparent 0 58px, rgba(74,59,92,.45) 58px 60px),
    linear-gradient(rgba(74,59,92,.45), rgba(74,59,92,.45)) top / 100% 2px no-repeat,
    linear-gradient(rgba(74,59,92,.45), rgba(74,59,92,.45)) bottom / 100% 2px no-repeat;
}

/* ---------- 狭い画面 ---------- */
@media (max-width: 860px){
  :root{ --wa-ten:22px; --wa-chi:34px; --wa-hashira:12px; --wa-jiku:12px; }
  .hero-visual{ padding: 4vh 0; height:52vh; }
  .hero-character{ width:260px; }
  .hero-visual::before{ top:calc(4vh - 8px); width:min(260px, 100%); height:8px; }
  .hero-visual::after{ bottom:calc(4vh - var(--wa-jiku)); width:calc(min(260px, 100%) + 26px); }
  .visual-caption{ display:none; }
  .scroll-hint{ display:none; }   /* 掛け軸と重なるため */
}
@media (max-width: 600px){
  .hero-visual{ height:48vh; }
  /* スマホ縦: 掛け軸を小さくして、題名の右（空いている所）に掛ける。下にあった大きな掛け軸の分、ページも短くなる */
  .hero{ position:relative; }
  .hero-visual{
    position:absolute; z-index:2; top:104px; right:5vw;
    width:31vw; max-width:160px; height:auto; margin:0; padding:0;
    --wa-ten:12px; --wa-chi:18px; --wa-hashira:7px; --wa-jiku:8px;
  }
  .hero-character{ width:100%; height:calc(min(31vw, 160px) * 1.62); background-size:cover, 16px 16px; }
  .hero-visual::before{ top:-5px; width:100%; height:5px; }
  .hero-visual::after{ bottom:calc(0px - var(--wa-jiku)); width:calc(100% + 16px); }
  .hero-text .eyebrow{ max-width:calc(100% - min(31vw, 160px) - 12px); }
  .section-num{ width:34px; height:34px; font-size:15px; }
}

/* おみくじの箱は、黒漆に金の縁（暗いページの中で白く浮かないように） */
.omikuji-box{
  color:var(--paper);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(139,111,168,.18), transparent 70%),
    linear-gradient(#2F2737, #221C29);
  border:1px solid rgba(217,190,129,.55);
  box-shadow: inset 0 0 0 5px #241E2B, inset 0 0 0 6px rgba(217,190,129,.28), 0 18px 40px rgba(0,0,0,.35);
}
/* 御神籤の筒（六角の木箱）と、出てくる番号の棒 */
.omikuji-tube{ position:relative; width:120px; height:236px; margin:0 auto 26px; transform-origin:50% 85%; }
.omikuji-tube-svg{ position:absolute; left:0; bottom:0; width:120px; height:170px; z-index:2; filter:drop-shadow(0 10px 14px rgba(0,0,0,.45)); }
.omikuji-stick{
  position:absolute; left:50%; bottom:104px; width:14px; height:126px; margin-left:-7px; z-index:1;
  background:linear-gradient(90deg, #C9A574, #E2C796 50%, #B8925F); border-radius:2px 2px 0 0;
  transform:translateY(100px); transition:transform .6s cubic-bezier(.2,.9,.3,1.2);
  display:flex; justify-content:center; padding-top:4px;
}
.omikuji-stick span{ position:absolute; top:6px; left:50%; transform:translateX(-50%); writing-mode:vertical-rl; font-family:'Shippori Mincho', serif; font-size:9.5px; line-height:1; color:#7A2E1F; letter-spacing:0; white-space:nowrap; }
.omikuji-tube.out .omikuji-stick{ transform:translateY(0); }
.omikuji-tube.shaking{ animation:wa-shake .22s ease-in-out 5; }
@keyframes wa-shake{ 0%,100%{ transform:rotate(0); } 25%{ transform:rotate(-14deg) translateY(-4px); } 75%{ transform:rotate(14deg) translateY(-4px); } }
@media (prefers-reduced-motion: reduce){
  .omikuji-stick{ transition:none; }
  .omikuji-tube.shaking{ animation:none; }
}

/* 結果は、縦書きのおみくじの紙（生成りの和紙に朱の二重枠） */
.omikuji-box.drawn .omikuji-result{ max-height:720px; margin-top:34px; }
.omikuji-slip{
  margin:0 auto; max-width:100%; width:max-content; text-align:left;
  background-color:#F1E9DA; background-image:var(--wa-washi); color:#2B2530;
  padding:14px; box-shadow:0 14px 30px rgba(0,0,0,.4); position:relative;
}
.omikuji-slip::before{ content:""; position:absolute; inset:8px; border:1.5px solid #B5452F; box-shadow: inset 0 0 0 3px #F1E9DA, inset 0 0 0 4px rgba(181,69,47,.6); pointer-events:none; }
.omikuji-slip-head{
  text-align:center; font-size:13px; letter-spacing:.5em; color:#F1E9DA; background:#B5452F;
  padding:6px 0 6px .5em; margin:4px 4px 0;
}
.omikuji-slip-body{
  writing-mode:vertical-rl; height:340px; padding:18px 22px; margin:0 auto;
  max-width:100%; overflow-x:auto;
}
/* 縦書きでは、ブロックが右から左へ列として並ぶ */
.omikuji-slip-body > *{ margin:0 0 0 14px; }
.omikuji-no{ font-size:14px; letter-spacing:.2em; color:#B5452F; }
.omikuji-slip .omikuji-rank{
  font-size:44px; line-height:1; letter-spacing:.25em; color:#B5452F; font-weight:700;
  padding:0 0 0 14px; border:0; border-left:1px solid rgba(181,69,47,.4);
}
.omikuji-slip .omikuji-message{ font-size:15px; line-height:1.9; letter-spacing:.08em; color:#2B2530; }
.omikuji-slip .omikuji-lucky{ font-size:13px; letter-spacing:.15em; color:#6A5A4E; margin-left:0; padding-right:12px; border-right:1px dotted rgba(181,69,47,.4); }
.omikuji-slip .omikuji-lucky span{ color:#B5452F; font-weight:700; }
@media (max-width:600px){
  .omikuji-slip-body{ height:380px; padding:16px 14px; }
  .omikuji-slip-body > *{ margin-left:10px; }
  .omikuji-slip .omikuji-rank{ font-size:38px; }
  .omikuji-slip .omikuji-message{ font-size:14px; }
}
