/* 全ページ共通のヘッダーとフッター。色は site.css / shindan.css の変数を使う。
   スマホの幅を基本に書き、広い画面は下の @media で整える。 */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
}
.site-header-inner,
.site-footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
}
/* ロゴは 16の粒の輪 と nene の文字の絵（static/img/logo/、2026-11-14 から） */
.logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}
.logo img { display: block; width: auto; height: 40px; }
.header-nav { display: flex; gap: 8px; }
/* 指で押しやすいよう、高さは40px以上にする。 */
.header-button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 0;
  box-shadow: inset 0 0 0 1.5px var(--accent);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.header-button.primary { background: var(--accent); color: var(--accent-fg); }
.header-button:focus-visible,
.logo:focus-visible,
.footer-nav a:focus-visible { outline: 3px solid var(--fg); outline-offset: 2px; }

/* 質問ページの進み具合は、ヘッダーのすぐ下に貼り付ける。 */
.progress-head { top: 57px; }

.site-footer {
  margin-top: 48px;
  padding: 28px 0 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}
.footer-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
  margin: 0 0 16px;
}
.footer-nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  color: var(--fg);
  text-decoration: none;
}
.footer-note { margin: 0 0 6px; }
.copyright { margin: 16px 0 0; }

/* パンくず（今いる場所）。構造化データの BreadcrumbList も兼ねる。 */
.breadcrumb { margin: 0 0 12px; font-size: 0.82rem; color: var(--muted); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 0 6px; margin: 0; padding: 0; list-style: none; }
.breadcrumb li { display: flex; align-items: center; min-height: 32px; }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; color: var(--muted); }
.breadcrumb a { color: var(--muted); }

@media (min-width: 760px) {
  .site-header-inner,
  .site-footer-inner { padding: 0 32px; }
  .site-header-inner { min-height: 64px; }
  .progress-head { top: 65px; }
  .header-button { padding: 0 18px; }
  .footer-nav { display: flex; flex-wrap: wrap; gap: 4px 28px; }
}

/* 右下の「上へ戻る」（2026-11-16）。円はよい決まり。紺の丸に、ピンクの丸を少しずらして重ねる。 */
html { scroll-padding-top: 64px; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
.to-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 20;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #1f2a63;
  box-shadow: 4px 4px 0 #ec6f7b;
  transition: box-shadow 0.2s ease;
}
.to-top-arrow {
  width: 14px;
  height: 14px;
  margin-top: 6px;
  border-top: 3px solid #fff;
  border-left: 3px solid #fff;
  transform: rotate(45deg);
}
.to-top:focus-visible { outline: 3px solid #1f2a63; outline-offset: 4px; box-shadow: 4px 4px 0 #ec6f7b, 0 0 0 9px #fff; }
/* 診断の質問のページでは出さない（右下の「当てはまる」のボタンに重なるため） */
body:has(.seg) .to-top { display: none; }
/* 少し下がるまで隠す。スクロールに合わせて動かす CSS（対応しないブラウザでは、いつも出ている） */
@supports (animation-timeline: scroll()) {
  .to-top {
    animation: to-top-in linear both;
    animation-timeline: scroll(root);
    animation-range: 240px 400px;
  }
  @keyframes to-top-in {
    from { opacity: 0; translate: 0 12px; visibility: hidden; }
    to { opacity: 1; translate: 0 0; visibility: visible; }
  }
}
@media (hover: hover) {
  .to-top:hover { box-shadow: 6px 6px 0 #ec6f7b; }
}
@media (prefers-reduced-motion: reduce) {
  .to-top { transition: none; }
}
@media print {
  .to-top { display: none; }
}
