/* 全ページ共通：スクロール追従メニュー（スマホ）＋アンカー位置の補正
   - スマホ（768px以下）：ヘッダーが画面外に出たら右上にメニューボタン（四角い箱＋三）が出現 → タップで全画面メニュー（ボタンは丸い×に変化）
   - PC：ヘッダーは常時表示のまま（ボタンは出さない）
   - #about 等へのジャンプ時、見出しがヘッダーに隠れないよう余白を確保 */

section[id], [id="apply"], [id="products"] { scroll-margin-top: 120px; }

/* 数字の形を全ページでそろえる（明朝体の数字が小さく沈んで見えないよう、高さのそろった数字に） */
html { font-variant-numeric: lining-nums; }

/* 句の途中で改行しない（日本語の見出し用。<span class="nb">…</span> で囲んだ部分は、まとめて次の行へ送る） */
.nb { display: inline-block; }

/* ページの先頭へ戻るボタン（NN/gの推奨どおり：4画面より長いページだけ・右下に固定・文字ラベルつき・
   何画面か読み進めたあと上へ戻ろうとしたときだけ表示・出た後は位置を動かさない） */
.to-top {
  position: fixed; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 900;
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 17px 0 14px;
  border: 1px solid rgba(61, 46, 34, 0.16); border-radius: 999px; background: #fff; color: #3D2E22;
  box-shadow: 0 8px 20px rgba(61, 46, 34, 0.16);
  font-family: "Inter", "Noto Sans JP", sans-serif; font-size: 0.8rem; font-weight: 500; letter-spacing: 0.04em; line-height: 1; text-decoration: none;
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity 0.25s ease, transform 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
.to-top.is-shown { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { width: 16px; height: 16px; flex: none; }
.to-top:hover { border-color: #C28E68; color: #A87454; }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }
@media print { .to-top { display: none !important; } }

/* フッターのプライバシーポリシーへのリンク */
footer .copy a, .footer-bottom a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* ロゴ：「Myro ｜ EYELASH & BEAUTY」の横組み（押すとトップへ）
   - 文字どうしが重ならないよう、ブランド名と説明を縦線で左右に分ける
   - フッターも同じ組み方（色はページ側の設定＝クリーム色のまま） */
header.site-header .logo, footer .logo {
  display: inline-flex; align-items: center; gap: 0.85rem;
  line-height: 1; letter-spacing: 0.02em; text-decoration: none; white-space: nowrap;
}
header.site-header .logo { font-size: 2.3rem; cursor: pointer; }
header.site-header .logo small, footer .logo small {
  display: block; margin: 0; padding: 0.15rem 0 0.15rem 0.85rem;
  border-left: 1px solid rgba(61, 46, 34, 0.38);
  font-size: 0.54rem; font-weight: 500; letter-spacing: 0.32em; text-transform: uppercase; line-height: 1.7;
}
header.site-header .logo small { color: #604A38; }
footer .logo small { border-left-color: rgba(248, 244, 237, 0.4); }
/* フッターのロゴ（押すとトップページの先頭へ）：1行を占め、下の「Back to Top」等と横に並ばないように。中央寄せのフッターでは中央に */
footer .logo { display: flex; width: fit-content; cursor: pointer; }
footer.site-footer > .logo { margin-left: auto; margin-right: auto; }

/* 中くらいの画面幅：メニュー7項目が1行に収まるよう間隔を詰める */
@media (min-width: 769px) and (max-width: 1180px) {
  nav.main-nav ul { gap: 1.3rem; }
  nav.main-nav a { letter-spacing: 0.12em; font-size: 0.72rem; }
}
@media (min-width: 769px) and (max-width: 960px) {
  html header.site-header { padding-left: 1.5rem; padding-right: 1.5rem; }
  nav.main-nav ul { gap: 1rem; }
  nav.main-nav a { font-size: 0.68rem; letter-spacing: 0.08em; }
  header.site-header .logo { font-size: 2rem; gap: 0.7rem; }
  header.site-header .logo small { padding-left: 0.7rem; font-size: 0.5rem; letter-spacing: 0.28em; }
}
@media (max-width: 768px) {
  header.site-header .logo { font-size: 2rem; gap: 0.7rem; }
  header.site-header .logo small { padding-left: 0.7rem; font-size: 0.5rem; }
}


.sn-btn, .sn-overlay { display: none; }

@media (max-width: 768px) {
  section[id], [id="apply"], [id="products"] { scroll-margin-top: 24px; }

  /* メニューボタン：閉じているとき＝四角い箱にハンバーガー（三）＋MENU、開いたとき＝丸い×ボタンに変化 */
  .sn-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    position: fixed; top: calc(14px + env(safe-area-inset-top, 0px)); right: calc(14px + env(safe-area-inset-right, 0px)); z-index: 1001;
    width: 54px; height: 54px; border-radius: 10px;
    border: 1px solid rgba(248, 244, 237, 0.32);
    background: #3D2E22;
    box-shadow: 0 6px 18px rgba(61, 46, 34, 0.22);
    cursor: pointer; padding: 0;
    opacity: 0; transform: scale(0.6) translateY(-8px); pointer-events: none;
    transition: opacity 0.28s ease, transform 0.32s cubic-bezier(.2, .9, .3, 1.3), border-radius 0.35s ease, gap 0.3s ease, background 0.2s;
    -webkit-tap-highlight-color: transparent;
  }
  .sn-btn.is-shown, .sn-btn.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .sn-btn:active { transform: scale(0.96); }
  .sn-bars { position: relative; display: block; width: 22px; height: 13px; }
  .sn-bars i {
    position: absolute; left: 0; display: block; width: 22px; height: 1.5px; border-radius: 1px;
    background: #F8F4ED; transition: top 0.3s ease, transform 0.3s ease, opacity 0.2s ease;
  }
  .sn-bars i:nth-child(1) { top: 0; }
  .sn-bars i:nth-child(2) { top: 5.75px; }
  .sn-bars i:nth-child(3) { top: 11.5px; }
  .sn-lbl {
    display: block; max-height: 10px; overflow: hidden;
    font-family: "Inter", "Noto Sans JP", sans-serif; font-size: 8.5px; font-weight: 500; line-height: 10px;
    letter-spacing: 0.18em; padding-left: 0.18em; color: #F8F4ED;
    transition: opacity 0.2s ease, max-height 0.3s ease;
  }
  /* 開いたとき：四角 → 丸、三 → × */
  .sn-btn.is-open { border-radius: 50%; gap: 0; border-color: #3D2E22; }
  .sn-btn.is-open .sn-lbl { opacity: 0; max-height: 0; }
  .sn-btn.is-open .sn-bars i:nth-child(1) { top: 5.75px; transform: rotate(45deg); }
  .sn-btn.is-open .sn-bars i:nth-child(2) { opacity: 0; }
  .sn-btn.is-open .sn-bars i:nth-child(3) { top: 5.75px; transform: rotate(-45deg); }

  .sn-overlay {
    display: flex; flex-direction: column; justify-content: center;
    position: fixed; inset: 0; z-index: 1000;
    padding: 5.5rem 2rem 3rem;
    background: #F8F4ED;
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    overflow-y: auto;
  }
  .sn-overlay.is-open { opacity: 1; visibility: visible; transition: opacity 0.3s ease; }
  .sn-overlay::before {
    content: ""; position: absolute; right: -6rem; top: -6rem; width: 18rem; height: 18rem;
    border-radius: 50%; background: #C28E68; opacity: 0.16; pointer-events: none;
  }
  .sn-brand { position: absolute; top: 1.4rem; left: 1.6rem; display: flex; text-decoration: none; align-items: center; gap: 0.7rem; font-family: "Cormorant Garamond", "Noto Serif JP", serif; font-size: 1.9rem; line-height: 1; color: #1A1A1A; }
  .sn-brand small { display: block; padding: 0.15rem 0 0.15rem 0.7rem; border-left: 1px solid rgba(61, 46, 34, 0.38); font-family: "Inter", "Noto Sans JP", sans-serif; font-size: 0.5rem; font-weight: 500; letter-spacing: 0.3em; text-transform: uppercase; line-height: 1.7; color: #604A38; }
  .sn-list { list-style: none; margin: 0; padding: 0; }
  .sn-list li {
    border-bottom: 1px solid rgba(61, 46, 34, 0.12);
    opacity: 0; transform: translateY(12px);
    transition: opacity 0.35s ease, transform 0.35s ease;
  }
  .sn-overlay.is-open .sn-list li { opacity: 1; transform: none; }
  .sn-list a {
    display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
    padding: 1.05rem 0.2rem; text-decoration: none; color: #3D2E22;
  }
  .sn-list .en { font-family: "Cormorant Garamond", "Noto Serif JP", serif; font-size: 1.7rem; letter-spacing: 0.02em; }
  .sn-list .ja { font-size: 0.72rem; letter-spacing: 0.12em; color: #604A38; }
  .sn-list a.is-current .en { color: #C28E68; }
  html.sn-lock, html.sn-lock body { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .sn-btn, .sn-bars i, .sn-lbl, .sn-overlay, .sn-list li { transition: none !important; }
}

/* スマホのヘッダーメニューを押しやすく（サイト点検P3-6：押せる高さの目安24px＝WCAG 2.2 達成基準2.5.8） */
@media (max-width: 768px) {
  nav.main-nav a { display: inline-block; padding: 7px 0; }
}

/* メニューが8項目（Franchiseを追加・2026-09-27）になったため、PC表示の最も狭い幅（769〜900px）で詰める */
@media (min-width: 769px) and (max-width: 900px) {
  nav.main-nav ul { gap: 0.75rem; }
  nav.main-nav a { font-size: 0.64rem; letter-spacing: 0.05em; }
  header.site-header .logo { font-size: 1.8rem; gap: 0.55rem; }
  header.site-header .logo small { padding-left: 0.55rem; font-size: 0.46rem; letter-spacing: 0.24em; }
}
