:root {
  --nav-bar-height: 96px;
  --btn-brown: #8c6442; /* お寺らしい茶色の共通変数 */
}

/* ===============================
   ナビ全体
================================ */
.nav {
  position: relative;
  width: 100%;
  z-index: 50;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
}

/* スクロール後に固定 */
.nav.is-fixed {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
}

/* ===============================
   上段メッセージバー（PC）
================================ */
.nav-message {
  display: grid;
  /* 左(コピー)・中(メニュー)・右(ボタン群)の3等分 */
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--nav-bar-height);
  padding: 0 32px;
  background: #3a3a3a;
  color: #fff;
  letter-spacing: .18em;
  box-sizing: border-box;
}

/* 左：キャッチコピー */
.nav-catch {
  font-size: 24px;
  font-weight: 500;
  white-space: nowrap;
  opacity: .95;
  cursor: default;
  position: relative;
  z-index: 5;
  pointer-events: none;
}

/* =============================================
   中央メニュー（PC）：横長ボタン・文字拡大
============================================= */
.nav-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px; /* ボタン同士の隙間 */
}

.nav-center span[data-pc] {
  position: relative;
  cursor: pointer;
  
  /* --- ボタンのデザイン（横長のカプセル型） --- */
  padding: 0 40px;      /* 左右の余白を広げて横長に */
  height: 64px;         /* 高さを少し抑えてスマートに */
  background: var(--btn-brown);
  border-radius: 32px;  /* 高さの半分を指定して角丸に */
  display: flex;
  align-items: center;
  justify-content: center;
  
  /* --- 文字のデザイン（拡大） --- */
  color: #fff;
  font-size: 28px;      /* 文字を大きく修正 */
  font-weight: bold;
  line-height: 1;
  letter-spacing: 0.1em;
  white-space: nowrap;
  
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
}

/* ホバー時の動き */
.nav-center span[data-pc]:hover {
  background: #a67b58; 
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.4);
  opacity: 1;
}

/* アクティブ（選択中）のデザイン */
.nav-center span[data-pc].active {
  background: #c5a059; 
  opacity: 1;
}

/* 区切り線の削除 */
.nav-center span[data-pc] + span[data-pc]::before {
  display: none !important;
}

/* ===============================
   ハンバーガー（PCでは非表示）
================================ */
.hamburger {
  display: none;
}

/* ===============================
   PC用 展開パネル
================================ */
.nav-pc-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: rgba(0,0,0,.88);
  backdrop-filter: blur(4px);
  color: #eee;
  z-index: 100;
  white-space: nowrap;
}

.nav-pc-panel.open {
  display: block;
}

.nav.is-fixed .nav-pc-panel {
  position: fixed;
  top: var(--nav-bar-height);
  left: 0;
  width: 100%;
  z-index: 9998;
}

.nav-pc-panel .pc-cols {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
}

.nav-pc-panel h4 {
  font-size: 28px;
  margin-bottom: 16px;
  border-left: 3px solid #aaa;
  padding-left: 14px;
}

.nav-pc-panel a {
  display: block;
  margin: 10px 0;
  font-size: 26px;
  color: #ddd;
  text-decoration: none;
}

.nav-pc-panel a:hover {
  color: #fff;
  text-decoration: underline;
}

/* ===============================
   モバイルメニュー本体
================================ */
.nav-mobile {
  display: none;
  background: #111;
}

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

/* ===============================
   レスポンシブ（モバイル専用）
================================ */
@media (max-width: 1025px) {

  .nav-message {
    padding-right: 150px !important; 
    grid-template-columns: 1fr;
    height: 72px; 
    padding-left: 20px;
    letter-spacing: .08em;
    position: relative;
  }

  .nav-catch {
    font-size: 18px;
  }

  /* PCメニュー無効 */
  .nav-center {
    display: none;
  }

  .nav-pc-panel {
    display: none;
  }

  /* ハンバーガー（スマホ版：茶色い円） */
  .hamburger {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: var(--btn-brown);
    color: #fff; 
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 10;
    
    position: absolute !important;
    right: 20px;
    top: 50%;
    transform: translateY(-50%) !important;
    
    width: 38px !important;
    height: 38px !important;
    font-size: 20px;
    padding-bottom: 2px;
    transition: all 0.3s ease;
  }

  .hamburger:active {
    transform: translateY(-50%) scale(0.95) !important;
  }

  /* OPEN時のバツ印（ズレ修正） */
  .nav.open .hamburger {
    position: fixed !important;
    top: 36px !important; /* ヘッダー高さ72pxの半分 */
    right: 20px;
    z-index: 10001;
    color: transparent; 
  }

  .nav.open .hamburger::before {
    content: "✕";
    color: #fff;
    font-size: 22px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  /* モバイルメニュー本体 */
  .nav-mobile {
    position: fixed;
    top: 72px;
    left: 0;
    width: 100%;
    height: calc(100vh - 72px);
    background: #111;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 9997;
    display: none;
  }

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

  .nav.open .nav-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
  }

  .nav-group {
    list-style: none;
    margin: 0;
    padding: 0 0 40px;
  }

  .nav-section {
    border-top: 1px solid rgba(255,255,255,.15);
  }

  .nav-section:last-child {
    border-bottom: 1px solid rgba(255,255,255,.15);
  }

  .nav-section-title {
    font-size: 26px;
    padding: 18px 20px;
    color: #fff;
    cursor: pointer;
    letter-spacing: .15em;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .nav-section-title::after {
    content: "▾";
    font-size: 20px;
    opacity: .6;
    transition: transform .3s;
  }

  .nav-section.open .nav-section-title::after {
    transform: rotate(180deg);
  }

  .nav-section ul {
    display: none;
    padding: 0 20px 16px;
  }

  .nav-section.open ul {
    display: block;
  }

  .nav-section ul li {
    margin: 12px 0;
  }

  .nav-section ul a {
    display: block;
    font-size: 18px;
    padding: 10px 0;
    color: #ddd;
    text-decoration: none;
  }

  .nav-section ul a:hover {
    color: #fff;
  }
}

/* =============================================
   AIボタン・TOPボタン配置エリア
============================================= */

/* ボタン配置エリア（PC） */
.nav-right-area {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px; /* ボタン同士の間隔 */
  height: 100%;
}

/* AIボタンのデザイン */
.ai-trigger {
  background: #c5a059;
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  z-index: 60;
}

/* TOPボタンのデザイン（PC） */
.nav-top-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--btn-brown);
  color: #fff;
  text-decoration: none;
  width: 80px;
  height: 38px;
  border-radius: 19px;
  font-size: 14px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  z-index: 60;
}

.ai-trigger:hover,
.nav-top-btn:hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

/* --- モバイル表示の調整（AI・TOP・三 を並べる） --- */
@media (max-width: 1025px) {
  
  .nav-right-area {
    position: absolute;
    right: 66px; 
    top: 50%;
    transform: translateY(-50%);
    gap: 8px; /* スマホ時のボタン間隔 */
    z-index: 60;
    display: flex;
    align-items: center;
  }

  .ai-trigger,
  .nav-top-btn {
    width: 38px !important;
    height: 38px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin: 0 !important;
  }

  .ai-trigger .ai-text {
    display: none !important;
  }

  .ai-trigger .ai-icon {
    font-size: 18px;
    margin: 0;
  }

  .nav-top-btn {
    font-size: 10px;
  }
}

/* ===============================
   スライドパネル（AI）
================================ */
.ai-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: 380px;
  max-width: 85%;
  height: 100vh;
  background: #fff;
  color: #333;
  z-index: 10002;
  box-shadow: -5px 0 20px rgba(0,0,0,0.2);
  transition: right 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  flex-direction: column;
}

.ai-panel.is-active {
  right: 0;
}

.ai-header {
  height: 60px;
  background: #3a3a3a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.ai-title {
  font-size: 16px;
  letter-spacing: 0.1em;
}

.ai-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}

.ai-body {
  flex: 1;
  padding: 0;
  background: #f9f9f9;
  overflow-y: auto;
}
