/* === 宝幸院 共通スタイル === */

/* カラーパレット */
:root {
  --white:  #ffffff;
  --black:  #111111;

  /* 表サイト（一般） */
  --red:    #c0392b;
  --green:  #27ae60;
  --red-light:   #e8d5d3;
  --green-light: #d3e8d9;

  /* 裏サイト（性） */
  --blue:   #2980b9;
  --yellow: #f39c12;

  /* UI */
  --bg:        var(--white);
  --text:      #222222;
  --text-sub:  #666666;
  --border:    #e0e0e0;
  --primary:   var(--green);
  --secondary: var(--red);
  --sacred:    var(--black);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 20px; /* 年配向けデフォルト（中）。小=18px / 大=24px をJSで切替 */
  scroll-behavior: smooth;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  font-family: 'Migu 1C', system-ui, sans-serif;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

/* ─────────────────── レイアウト ─────────────────── */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* サイドナビ付き2カラムレイアウト */
.layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ─────────────────── ヘッダー ─────────────────── */

.site-header {
  background: var(--white);
  border-bottom: 2px solid var(--sacred);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ハンバーガーボタン（PC非表示） */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--sacred);
  transition: all 0.3s;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--sacred);
  white-space: nowrap;
}

.site-logo img {
  height: 40px;
  width: auto;
}

.site-logo .logo-sub {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-sub);
  line-height: 1.3;
}

/* ─────────────────── 文字サイズ切替 ─────────────────── */

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.font-size-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.font-size-switcher .fs-label {
  font-size: 0.72rem;
  color: var(--text-sub);
  letter-spacing: .05em;
  margin-right: 2px;
}

.font-size-switcher button {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 9px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  min-width: 28px;
}

.font-size-switcher button:hover {
  border-color: var(--green);
  color: var(--green);
}

.font-size-switcher button.active {
  background: var(--sacred);
  border-color: var(--sacred);
  color: var(--white);
}

@media (max-width: 480px) {
  .font-size-switcher .fs-label { display: none; }
  .font-size-switcher button { padding: 4px 7px; font-size: 0.78rem; min-width: 24px; }
}

/* ─────────────────── 認証バー（ヘッダー直下・全ページ共通） ─────────────────── */

.auth-bar {
  display: flex;
  justify-content: flex-end;
  padding: 8px 24px;
  background: #fafaf6;
  border-bottom: 1px solid #ebebeb;
}
.auth-btn {
  display: inline-block;
  padding: 6px 16px;
  font-size: 0.88rem;
  color: #6a4f1a;
  text-decoration: none;
  border: 1px solid #d8c89c;
  border-radius: 4px;
  background: var(--white);
  white-space: nowrap;
}
.auth-btn:hover { background: #fff7e8; }
.auth-btn-primary {
  background: #fff7e8;
  border-color: #c99a3a;
  font-weight: 600;
}
@media (max-width: 600px) {
  .auth-bar { padding: 6px 16px; }
  .auth-btn { font-size: 0.82rem; padding: 5px 12px; }
}

/* ─────────────────── サイドナビ ─────────────────── */

.site-nav {
  width: 220px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  overflow-y: auto;
  transition: transform 0.3s;
}

.site-nav ul {
  list-style: none;
}

.site-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  font-size: 0.95rem;
  color: var(--text);
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}

.site-nav li a:hover {
  background: var(--green-light);
  color: var(--green);
  border-left-color: var(--green);
}

.site-nav li a.active {
  background: var(--green-light);
  color: var(--green);
  border-left-color: var(--green);
  font-weight: 600;
}

.site-nav .nav-divider {
  margin: 12px 24px;
  border: none;
  border-top: 1px solid var(--border);
}

/* ─────────────────── メインコンテンツ ─────────────────── */

.site-main {
  flex: 1;
  padding: 32px 24px;
  overflow-y: auto;
}

/* ─────────────────── フッター ─────────────────── */

.site-footer {
  background: var(--sacred);
  color: var(--white);
  text-align: center;
  padding: 24px;
  font-size: 0.85rem;
  opacity: 0.9;
}

.site-footer a {
  color: var(--green);
}

/* ─────────────────── オーバーレイ（モバイルナビ背景） ─────────────────── */

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 90;
}

/* ─────────────────── レスポンシブ ─────────────────── */

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    z-index: 95;
    transform: translateX(-100%);
    box-shadow: 2px 0 12px rgba(0,0,0,0.15);
  }

  .site-nav.open {
    transform: translateX(0);
  }

  .nav-overlay.open {
    display: block;
  }

  .site-main {
    padding: 20px 16px;
  }
}

/* ─────────────────── ユーティリティ ─────────────────── */

.text-sacred { color: var(--sacred); }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s, transform 0.1s;
}

.btn:hover { opacity: 0.85; }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--green);
  color: var(--white);
}

.btn-secondary {
  background: var(--red);
  color: var(--white);
}

.btn-sacred {
  background: var(--sacred);
  color: var(--white);
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
