@charset "UTF-8";

/* ==========================================
 * ACE Renewal - Scoped Base Styles
 * 既存サイトとの競合を防ぐための初期化と基底設定
 * ========================================== */

html,
body {
  height: auto;
  min-height: 100%;
}

/* ページ全体のアンカーリンク移動をなめらかなスライドにする、および横スクロールを抑止 */
html {
  /* scroll-behavior: smooth; */
  overflow-x: clip !important;
}

/* 親サイト側の元々のはみ出し要素が露出するのを防ぎつつ、Page Top 等の固定要素への干渉を最小化 */
body {
  overflow-x: clip !important;
}

/* 
 * 親ページの Page Top ボタン (#page-top) の表示復旧。
 * 1. ACEの要素の z-index が高い場合に背後に隠れるのを防止
 */
#page-top {
  z-index: 9999 !important;
  right: 20px !important;
  /* 端に寄りすぎて overflow で切られるのを防ぐため内側へ移動 */
}

/* 
 * 2. 100px以上スクロールされた全域で表示を強制
 * ページトップ（スクロール位置0）付近では ace-is-scrolled クラスが外れるため、
 * 親サイト本来の非表示挙動が有効になります。
 */
body.ace-is-scrolled #page-top {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* 
 * 既存サイト(office02.html)との統合用：ACEセクション閲覧中に親の追従フッターを隠す
 * main.js の IntersectionObserver によって body にクラスが付与されます。
 * .is-show クラス（親サイトのスクリプトによる強制表示）を上書きするため最優先で定義します。
 */
body.ace-section-visible .clone-nav,
body.ace-section-visible .clone-nav.is-show {
  display: none !important;
  /* 物理的に排除 */
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(100%) !important;
  transition: none !important;
  /* 瞬時に消去 */
}

/* 親サイトの追従ヘッダー (.clone-nav-top) をACE表示中のみ完全に無効化 */
body.ace-section-visible .clone-nav-top {
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
  display: none !important;
}

/* ラッパー全体のリセットと基本フォント設定 */
:is(#ace, #ace-renewal-wrapper) {
  /* 基底のリセット */
  box-sizing: border-box;
  margin: 0;
  padding: 0;

  /* フォントとタイポグラフィ（福祉事業としての温かみ・可読性重視） */
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  color: #3b3b3b;
  /* 視覚刺激を抑えるため真っ黒を避けた高コントラストなダークグレー */
  line-height: 1.6;
  font-size: clamp(16px, 1.2vw + 12px, 20px);
  /* 福祉特化: ユニバーサル対応の可変フォントサイズ(最大20px) */
  background-color: #ffffff;
  /* 既存コンテンツの背景が透けないよう白で下地指定 */

  /* 基本的なコンテナ幅設定 */
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;

  /* モーダル表示時等のガタつきを防止するため、常時相対配置にする */
  position: relative;
}

/* 内部要素すべてのボックスモデルを統一 */
:is(#ace, #ace-renewal-wrapper) *,
:is(#ace, #ace-renewal-wrapper) *::before,
:is(#ace, #ace-renewal-wrapper) *::after {
  box-sizing: inherit;
}

/* ブラウザデフォルトの余白リセット（カプセル化範囲のみ） */
:is(#ace, #ace-renewal-wrapper) h1,
:is(#ace, #ace-renewal-wrapper) h2,
:is(#ace, #ace-renewal-wrapper) h3,
:is(#ace, #ace-renewal-wrapper) h4,
:is(#ace, #ace-renewal-wrapper) p,
:is(#ace, #ace-renewal-wrapper) ul,
:is(#ace, #ace-renewal-wrapper) li,
:is(#ace, #ace-renewal-wrapper) figure {
  margin: 0;
  padding: 0;
}

/* アクセシビリティ・UI要素のリセット */
:is(#ace, #ace-renewal-wrapper) ul {
  list-style: none;
}

:is(#ace, #ace-renewal-wrapper) a {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.3s ease;
  /* ホバー時のマイクロアニメーション基本値 */
}

/* 画像のレスポンシブベースと崩れ防止 */
:is(#ace, #ace-renewal-wrapper) img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* === 基本的なレイアウト設定 === */
:is(#ace, #ace-renewal-wrapper) .ace-main {
  width: 100%;
  padding: 20px 0;
}

/* ==========================================
 * Shared Components (共通コンポーネント)
 * ========================================== */

/* --- サマリーカード (SVGサマリーをHTML/CSSで置換) --- */
#ace-renewal-wrapper .ace-summary-card {
  background-color: #ffffff;
  border-radius: 24px;
  padding: 50px 40px;
  margin: 0 auto 60px auto;
  max-width: 900px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
  text-align: center;
  position: relative;
  border-bottom: 4px solid transparent;
  /* 各テーマカラーに連動 */
  overflow: hidden;
}

/* 移行支援テーマ：ドット装飾の追加 (SVGの雰囲気を継承) */
#ace-renewal-wrapper .ace-summary-card--ikou::before {
  content: "";
  position: absolute;
  top: 15px;
  right: 15px;
  width: 50px;
  height: 50px;
  background-image: radial-gradient(#82c1d7 1.5px, transparent 1.5px);
  background-size: 8px 8px;
  opacity: 0.5;
}

#ace-renewal-wrapper .ace-summary-card__header {
  margin-bottom: 24px;
}

#ace-renewal-wrapper .ace-summary-card__title {
  display: inline-block;
  padding: 8px 48px;
  border-radius: 100vmax;
  font-size: 1.15rem;
  font-weight: 800;
  color: #595757;
  letter-spacing: 0.12em;
}

/* カテゴリ別の配色定義 */
#ace-renewal-wrapper .ace-summary-card--ikou {
  border-bottom-color: #b7e1f3;
}

#ace-renewal-wrapper .ace-summary-card--ikou .ace-summary-card__title {
  background-color: #ddf1fa;
}

#ace-renewal-wrapper .ace-summary-card--teichaku {
  border-bottom-color: #d2e1a7;
}

#ace-renewal-wrapper .ace-summary-card--teichaku .ace-summary-card__title {
  background-color: #e8efd2;
}

#ace-renewal-wrapper .ace-summary-card--sentaku {
  border-bottom-color: #f2c3b8;
}

#ace-renewal-wrapper .ace-summary-card--sentaku .ace-summary-card__title {
  background-color: #f9e3dd;
}

#ace-renewal-wrapper .ace-summary-card__text {
  font-size: clamp(16px, 1.25vw + 12px, 20px);
  line-height: 1.9;
  letter-spacing: 0.01em;
  color: #4a4a4a;
  text-align: center;
  max-width: 780px;
  margin: 0 auto;
}

#ace-renewal-wrapper .ace-summary-card__text br {
  display: block;
}

@media screen and (max-width: 768px) {
  #ace-renewal-wrapper .ace-summary-card {
    padding: 32px 20px;
    border-radius: 20px;
    margin-bottom: 40px;
  }

  #ace-renewal-wrapper .ace-summary-card__title {
    font-size: 1rem;
    padding: 6px 32px;
  }

  #ace-renewal-wrapper .ace-summary-card__text {
    text-align: left;
    /* モバイルでは左揃えの方が見やすい場合が多い */
    line-height: 1.7;
  }

  #ace-renewal-wrapper .ace-summary-card__text br {
    display: none;
    /* モバイルでは改行を解除して自然な折り返しに任せる */
  }
}

/* ==========================================
 * 1. Hero Section (メインバナー)
 * ========================================== */
:is(#ace, #ace-renewal-wrapper) .ace-hero {
  position: relative;
  width: 100%;
  margin-bottom: 40px;
  /* セクション間の間隔を調整（旧80px） */

  /* ページ読み込み時の「ふんわり表示」アニメーション初期値 */
  opacity: 0;
  transform: translateY(20px);
  animation: aceFadeInUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

:is(#ace, #ace-renewal-wrapper) .ace-hero__inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
  /* スマホ操作時等の左右余白確保 */
}

:is(#ace, #ace-renewal-wrapper) .ace-hero__image-wrapper {
  /* モダンUI: 緩やかな角丸と柔らかい影で、福祉テーマの「温かさ・安心感」を表現 */
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #fdfdfd;
}

:is(#ace, #ace-renewal-wrapper) .ace-hero__image {
  display: block;
  width: 100%;
  height: auto;
}

/* === マイクロインタラクション定義 === */
@keyframes aceFadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes aceBounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

#ace-renewal-wrapper .ace-lead {
  width: 100%;
  padding: 40px 0;
  background-color: #ffffff;
  opacity: 0;
  transform: translateY(20px);
  animation: aceFadeInUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s forwards;
}

#ace-renewal-wrapper .ace-lead__inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

#ace-renewal-wrapper .ace-lead__header {
  text-align: center;
  margin-bottom: 60px;
}

#ace-renewal-wrapper .ace-lead__catch {
  font-size: clamp(22px, 3vw + 14px, 38px);
  font-weight: bold;
  color: #3b3b3b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  line-height: 1.4;
}

#ace-renewal-wrapper .ace-lead__symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5em;
  height: 1.5em;
  border-radius: 50%;
  color: #ffffff;
  font-size: 0.75em;
  font-family: Arial, sans-serif;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#ace-renewal-wrapper .ace-lead__symbol--a {
  background-color: #7abedb;
}

/* 移行支援テーマカラー系 */
#ace-renewal-wrapper .ace-lead__symbol--c {
  background-color: #e6a091;
}

/* 選択支援テーマカラー系 */
#ace-renewal-wrapper .ace-lead__symbol--e {
  background-color: #b3c67d;
}

/* 定着支援テーマカラー系 */

#ace-renewal-wrapper .ace-lead__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

#ace-renewal-wrapper .ace-lead__text-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

#ace-renewal-wrapper .ace-lead__text {
  font-size: 1.05rem;
  line-height: 1.9;
  letter-spacing: 0.02em;
  color: #4a4a4a;
}

#ace-renewal-wrapper .ace-lead__images {
  display: flex;
  flex-direction: column;
  gap: 40px;
  position: relative;
}

#ace-renewal-wrapper .ace-lead__figure {
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
  transition: transform 0.5s ease;
}

#ace-renewal-wrapper .ace-lead__figure:hover {
  transform: scale(1.02);
}

#ace-renewal-wrapper .ace-lead__figure--office {
  width: 50%;
  align-self: flex-start;
}

#ace-renewal-wrapper .ace-lead__image-group {
  position: relative;
  width: 50%;
  align-self: flex-end;
  margin-top: -80px;
  z-index: 2;
}

#ace-renewal-wrapper .ace-lead__figure--support {
  width: 100%;
}

@media screen and (max-width: 768px) {
  #ace-renewal-wrapper .ace-lead {
    padding: 30px 0;
  }

  #ace-renewal-wrapper .ace-lead__header {
    margin-bottom: 40px;
  }

  #ace-renewal-wrapper .ace-lead__catch {
    font-size: 20px;
    gap: 8px;
  }

  #ace-renewal-wrapper .ace-gallery__grid {
    grid-template-columns: repeat(3, 1fr);
    /* 2列から3列へ強制（デスクトップと同じ比率） */
    gap: 12px;
    /* モバイル向けに隙間を詰め、表示領域を確保 */
  }

  #ace-gallery .ace-gallery__item .ace-gallery__caption {
    font-size: 0.75rem;
    /* 小さくなったカードに合わせて文字サイズを最適化 */
    padding: 8px 4px;
    letter-spacing: -0.02em;
    /* 枠の狭さに合わせて調整 */
  }

  #ace-renewal-wrapper .ace-lead__text {
    line-height: 1.7;
  }

  #ace-renewal-wrapper .ace-lead__content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  #ace-renewal-wrapper .ace-lead__text {
    line-height: 1.7;
  }

  #ace-renewal-wrapper .ace-lead__figure--office,
  #ace-renewal-wrapper .ace-lead__image-group {
    width: 80%;
    margin-top: 0;
  }

  #ace-renewal-wrapper .ace-lead__figure--office {
    align-self: flex-start;
  }

  #ace-renewal-wrapper .ace-lead__image-group {
    align-self: flex-end;
    margin-top: -40px;
  }
}

/* ==========================================
 * 2. Ikou Section (就労移行支援)
 * ========================================== */
#ace-renewal-wrapper .ace-ikou {
  width: 100%;
  padding: 60px 0;
  background-color: #fafafa;
  /* 背景色復旧：画面幅全体に広がる帯 */
}

#ace-renewal-wrapper .ace-ikou__inner {
  max-width: 1000px;
  /* 直下のコンテンツは従来通り中央1000pxで揃える */
  margin: 0 auto;
  padding: 0 20px;
}

#ace-renewal-wrapper .ace-ikou__header {
  text-align: center;
  margin-bottom: 40px;
}

#ace-renewal-wrapper .ace-ikou__banner {
  display: block;
  width: 100%;
  height: auto;
}

#ace-renewal-wrapper .ace-ikou__img-fluid {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

#ace-renewal-wrapper .ace-ikou__margin-top {
  margin-top: 40px;
}

#ace-renewal-wrapper .ace-ikou__summary {
  margin-bottom: 50px;
}

/* --- カードレイアウト (各ステップ表示) --- */
#ace-renewal-wrapper .ace-ikou__steps {
  display: grid;
  /* スマホ等で自動的にカラム数が調整されるレスポンシブなグリッド */
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 50px;
}

#ace-renewal-wrapper .ace-step-card {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: default;
  /* クリック不可な場所として明示しつつ反応は提供する */
}

/* ホバー時のマイクロインタラクション: 視覚的なフィードバック */
#ace-renewal-wrapper .ace-step-card:hover {
  transform: translateY(-5px);
  /* 要素を少し上に浮かせる */
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  /* 影を広げて立体感を強調 */
}

#ace-renewal-wrapper .ace-step-card__img {
  display: block;
  width: 100%;
  height: auto;
}

#ace-renewal-wrapper .ace-ikou__points {
  text-align: center;
}

/* ==========================================
 * 3. Sentaku Section (選択)
 * ========================================== */
#ace-renewal-wrapper .ace-sentaku {
  width: 100%;
  padding: 60px 0;
  background-color: #ffffff;
  /* 背景色復旧 */
}

#ace-renewal-wrapper .ace-sentaku__inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

#ace-renewal-wrapper .ace-sentaku__header {
  text-align: center;
  margin-bottom: 40px;
}

#ace-renewal-wrapper .ace-sentaku__banner {
  display: block;
  width: 100%;
  height: auto;
}

#ace-renewal-wrapper .ace-sentaku__content {
  text-align: center;
}

#ace-renewal-wrapper .ace-sentaku__img-fluid {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

/* カード状の目的提示部分に軽やかなホバーアニメーションを付与 */
#ace-renewal-wrapper .ace-sentaku__purpose {
  margin-bottom: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#ace-renewal-wrapper .ace-sentaku__purpose:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  /* 深みのある影へ */
}

/* ==========================================
 * 4. Teichaku Section (定着支援)
 * ========================================== */
#ace-renewal-wrapper .ace-teichaku {
  width: 100%;
  padding: 60px 0 80px 0;
  background-color: #fafafa;
  /* 背景帯と最終余白の復旧 */
}

#ace-renewal-wrapper .ace-teichaku__inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

#ace-renewal-wrapper .ace-teichaku__header {
  text-align: center;
  margin-bottom: 40px;
}

#ace-renewal-wrapper .ace-teichaku__banner {
  display: block;
  width: 100%;
  height: auto;
}

#ace-renewal-wrapper .ace-teichaku__content {
  text-align: center;
}

#ace-renewal-wrapper .ace-teichaku__img-fluid {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

#ace-renewal-wrapper .ace-teichaku__summary {
  margin-bottom: 50px;
}

/* 情報量の多い図解エリアへのモダンな装飾（カード枠とアニメーション） */
#ace-renewal-wrapper .ace-teichaku__diagram {
  margin-bottom: 50px;
  padding: 40px 20px;
  background-color: #ffffff;
  border-radius: 16px;
  /* 温かみのある大きめの角丸 */
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
  transition: transform 0.3s ease;
}

#ace-renewal-wrapper .ace-teichaku__diagram:hover {
  transform: translateY(-2px);
}

#ace-renewal-wrapper .ace-teichaku__diagram-img {
  transform: scale(1);
  transition: transform 0.4s ease;
}

/* ホバー時に図解が少し手前に近づく（ズームイン）ことで、ユーザーの視線を釘付けにする */
#ace-renewal-wrapper .ace-teichaku__diagram:hover .ace-teichaku__diagram-img {
  transform: scale(1.02);
}

#ace-renewal-wrapper .ace-teichaku__recommend {
  margin-top: 40px;
}

/* ==========================================
 * Tab Layout (:target セマンティック手法)
 * ========================================== */
#ace-renewal-wrapper .ace-sticky-container {
  width: 100%;
  position: relative;
  /* ヒーローイメージと同様の「ふんわり表示」アニメーションを適用 */
  opacity: 0;
  transform: translateY(20px);
  animation: aceFadeInUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s forwards;
}

#ace-renewal-wrapper .ace-tabs {
  width: 100%;
  scroll-margin-top: 0;
}

/* タブナビゲーション */
#ace-renewal-wrapper .ace-tabs__nav,
.ace-renewal-scope .ace-tabs__nav {
  position: sticky;
  top: 0 !important;
  /* デスクトップでもビューポート最上部に固定（既存ヘッダー非表示のため） */
  transition: top 0.3s ease;
  /* スムーズな位置切り替え */
  z-index: 990;
  /* 既存ヘッダーとの重なりを防ぐため調整 */
  background-color: #ffffff;
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 10px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(8px);

  /* 
   * View Transitions API の遷移グループに含め、レイヤーを前面に維持する。
   * ただし、親フレーム(office02.html)の追従フッター(z-index: 500)を超えない数値(400)に調整し、
   * 重なり順の自然さを保ちます。
   */
  view-transition-name: ace-tabs-nav;
  z-index: 400;
  /* 990から400に引き下げ */
  transition: top 0.3s ease, margin-top 0.3s ease;
  /* スムーズな位置調整用 */
}

/* 
 * 親フレーム(office02.html)のハンバーガーメニュー切り替えブレイクポイント(1150px)に合わせた調整 
 */
@media screen and (max-width: 1150px) {
  #ace-renewal-wrapper .ace-tabs__nav {
    top: 0 !important;
    /* ブラウザ標準のsticky挙動を優先 */
    margin: 0 !important;
    /* PC用の中央寄せを完全にリセット */
    /* zoomを廃止し、物理的なプロパティでサイズを縮小して安定化を図る */
    zoom: normal;

    /* ボタン(65px相当)を確実に回避するための最大幅 */
    width: 100% !important;
    max-width: calc(100% - 72px) !important;
    left: 0 !important;
    z-index: 100;
    padding: 8px 4px;
    /* パディングを縮小 */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    display: flex;
    justify-content: space-around;
    /* 均等配置 */
  }

  /* 非アクティブ時のタブボタン（フォントサイズ等を直接調整） */
  #ace-renewal-wrapper .ace-tabs__trigger {
    padding: 10px 4px;
    font-size: 13px;
    /* zoom:0.72相当 */
    letter-spacing: -0.05em;
    border-radius: 8px 8px 0 0;
    margin: 0 2px;
    flex: 1;
    max-width: none;
  }

  /* 固定時のスタイルも同様に調整（一貫性確保） */
  body.ace-tabs-fixed #ace-renewal-wrapper .ace-tabs__nav {
    display: flex;
    flex-wrap: nowrap;
    position: sticky;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: calc(100% - 72px) !important;
    padding: 4px;
    margin: 0 !important;
    zoom: normal;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  }
}

/* 768px以下のモバイル向けにさらに最適化 */
@media screen and (max-width: 768px) {

  #ace-renewal-wrapper .ace-tabs__nav,
  body.ace-tabs-fixed #ace-renewal-wrapper .ace-tabs__nav {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0;
    width: 100% !important;
    max-width: calc(100% - 68px) !important;
    /* 極小画面向け調整 */
    padding: 4px 2px;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
  }

  #ace-renewal-wrapper .ace-tabs__trigger {
    padding: 8px 1px;
    font-size: 0.72rem;
    letter-spacing: -0.07em;
  }
}

/* タブボタン（aタグ）の基本骨格 */
:is(#ace, #ace-renewal-wrapper) .ace-tabs__trigger {
  flex: 1;
  /* 等幅で広がる */
  max-width: 320px;
  display: block;
  padding: 18px 20px;
  text-align: center;
  font-weight: bold;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 12px 12px 0 0;
  margin: 0 4px;
}

/* 各タブ独自の待機中（非アクティブ）カラー設定。色覚サポートとして淡いパステル色を適用 */
:is(#ace, #ace-renewal-wrapper) a[href="#tab-ikou"].ace-tabs__trigger {
  background-color: #e6f5fb;
  /* 極薄ブルー */
  border-bottom: 3px solid #e6f5fb;
  color: #5c7b89;
}

:is(#ace, #ace-renewal-wrapper) a[href="#tab-sentaku"].ace-tabs__trigger {
  background-color: #fcece9;
  /* 極薄ピンク */
  border-bottom: 3px solid #fcece9;
  color: #8c6861;
}

:is(#ace, #ace-renewal-wrapper) a[href="#tab-teichaku"].ace-tabs__trigger {
  background-color: #eef4e1;
  /* 極薄グリーン */
  border-bottom: 3px solid #eef4e1;
  color: #6a7657;
}

/* ホバー時は少し色を濃くして反応を明示 */
:is(#ace, #ace-renewal-wrapper) a[href="#tab-ikou"].ace-tabs__trigger:hover {
  background-color: #d0ebf7;
  border-bottom-color: #d0ebf7;
  color: #3b3b3b;
}

:is(#ace, #ace-renewal-wrapper) a[href="#tab-sentaku"].ace-tabs__trigger:hover {
  background-color: #fadfd9;
  border-bottom-color: #fadfd9;
  color: #3b3b3b;
}

:is(#ace, #ace-renewal-wrapper) a[href="#tab-teichaku"].ace-tabs__trigger:hover {
  background-color: #e3eed0;
  border-bottom-color: #e3eed0;
  color: #3b3b3b;
}

/* 
 * アクティブなタブボタンの判定（完全なバナーカラーに塗りつぶす）
 * 1. 初期表示（URLに何もtargetが無い場合）は1番目をハイライト
 * 2. 各パネルがtargetになった場合は対象のボタンをハイライト
 */
:is(#ace, #ace-renewal-wrapper) .ace-tabs:not(:has(.ace-tabs__panel:target)) a[href="#tab-ikou"],
:is(#ace, #ace-renewal-wrapper) .ace-tabs:has(#tab-ikou:target) a[href="#tab-ikou"] {
  background-color: #b7e1f3;
  /* 移行のバナー色 */
  color: #3b3b3b;
  border-bottom: 3px solid #b7e1f3;
}

:is(#ace, #ace-renewal-wrapper) .ace-tabs:has(#tab-sentaku:target) a[href="#tab-sentaku"] {
  background-color: #f2c3b8;
  /* 選択のバナー色 */
  color: #3b3b3b;
  border-bottom: 3px solid #f2c3b8;
}

:is(#ace, #ace-renewal-wrapper) .ace-tabs:has(#tab-teichaku:target) a[href="#tab-teichaku"] {
  background-color: #d2e1a7;
  /* 定着のバナー色 */
  color: #3b3b3b;
  border-bottom: 3px solid #d2e1a7;
}

/* タブコンテンツ群のラッパー */
:is(#ace, #ace-renewal-wrapper) .ace-tabs__content {
  position: relative;
  /* 子素のパネルに対して基準を提供 */
  z-index: 1;
  /* スティッキーナビ（z-index: 1000）の背面に配置 */
  background-color: transparent;
  width: 100%;
  border-top: none;
  padding: 0;
  /* paddingは中の個別パネルで指定 */

  /* View Transitions API の独立した切り替え対象として指定 */
  view-transition-name: ace-tab-content;
}

/* View Transition 中のレイヤー順序の制御 */
::view-transition-group(ace-tabs-nav) {
  z-index: 401;
  /* 1000から401に引き下げ。クリック時の一瞬の浮き上がりを防止 */
  /* ナビゲーションの基本レイヤーを維持 */
}

::view-transition-group(ace-tab-content) {
  z-index: 1;
  /* コンテンツを背面に */
  mix-blend-mode: normal;
}

/* View Transition 中のクロスフェードアニメーションの緻密な調整 */
::view-transition-old(ace-tab-content),
::view-transition-new(ace-tab-content) {
  animation-duration: 0.5s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  mix-blend-mode: normal;
}

#ace-renewal-wrapper .ace-tabs__panel {
  display: none;
  /* デフォルトは非表示 */
  width: 100%;
  background-color: transparent;

  /* タブのクリックジャンプ防止と独立した内部スクロール設定を解除 */
  overflow-y: visible;
  /* 
   * スクロール時の着地位置調整 (scroll-margin-top)
   * モバイル統合時(1151px以下)はタブUI自体の高さ分(約50px)だけ空ける
   */
  scroll-margin-top: 50px;

  @media screen and (min-width: 1151px) {
    scroll-margin-top: 80px;
    /* PC用：タブ高さ分（ヘッダー非表示のため66px分を削減） */
  }

  /* 追従フッター（高さ約80px）によってコンテンツが隠れないよう、十分な下部余白を確保 */
  padding-bottom: 120px;
}

/* スクロールバーの美しいカスタマイズ（パネル内） */
#ace-renewal-wrapper .ace-tabs__panel::-webkit-scrollbar {
  width: 8px;
}

#ace-renewal-wrapper .ace-tabs__panel::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

#ace-renewal-wrapper .ace-tabs__panel::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

#ace-renewal-wrapper .ace-tabs__panel::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 
 * アクティブなパネルの表示判定
 * 1. hrefのhashがパネルIDに一致した場合（:target）
 * 2. URLにターゲットが存在しない場合は1番目（#tab-ikou）を表示
 */
#ace-renewal-wrapper .ace-tabs__panel:target {
  display: block;
  /* 選択パネルを表示 */
}

#ace-renewal-wrapper .ace-tabs:not(:has(.ace-tabs__panel:target)) #tab-ikou {
  display: block;
  /* 初期状態の表示 */
}

/* ==========================================
 * Contact Section (お問い合わせ・QRコード)
 * ========================================== */
:is(#ace, #ace-renewal-wrapper) .ace-contact {
  padding: 80px 0;
  background-color: #ffffff;
}

:is(#ace, #ace-renewal-wrapper) .ace-contact__inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

:is(#ace, #ace-renewal-wrapper) .ace-contact__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #f8fbfd 0%, #ffffff 100%);
  padding: 60px;
  border-radius: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.05);
  border: 1px solid #edf5f8;
  gap: 40px;
}

:is(#ace, #ace-renewal-wrapper) .ace-contact__content {
  flex: 1;
}

:is(#ace, #ace-renewal-wrapper) .ace-contact__title {
  font-size: 28px;
  color: #3e3a39;
  margin-bottom: 24px;
  font-weight: 800;
  position: relative;
  padding-left: 20px;
  line-height: 1.4;
}

:is(#ace, #ace-renewal-wrapper) .ace-contact__title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 24px;
  background-color: #82c1d7;
  border-radius: 3px;
}

:is(#ace, #ace-renewal-wrapper) .ace-contact__text {
  font-size: 16px;
  line-height: 1.8;
  color: #555;
  margin: 0;
}

:is(#ace, #ace-renewal-wrapper) .ace-contact__qr-list {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

:is(#ace, #ace-renewal-wrapper) .ace-contact__qr-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

:is(#ace, #ace-renewal-wrapper) .ace-contact__qr-item--primary .ace-contact__qr-image-container {
  border-color: #82c1d7;
  box-shadow: 0 10px 30px rgba(130, 193, 215, 0.25);
}

:is(#ace, #ace-renewal-wrapper) .ace-contact__qr-image-container {
  background-color: #fff;
  padding: 12px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  border: 1px solid #f0f7f9;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

:is(#ace, #ace-renewal-wrapper) .ace-contact__qr-image-container:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(130, 193, 215, 0.2);
}

:is(#ace, #ace-renewal-wrapper) .ace-contact__qr-img {
  width: 90px;
  height: 90px;
  display: block;
}

:is(#ace, #ace-renewal-wrapper) .ace-contact__qr-label {
  font-size: 13px;
  font-weight: bold;
  color: #3e3a39;
  background-color: #f0f7f9;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

:is(#ace, #ace-renewal-wrapper) .ace-contact__qr-item--primary .ace-contact__qr-label {
  color: #fff;
  background-color: #82c1d7;
}

/* ==========================================
 * 4. Access Section (アクセス)
 * ========================================== */
#ace-renewal-wrapper .ace-access {
  padding: 80px 0;
  background-color: #fafafa;
  /* 微かなグレーでセクション間の区切りを明確化 */
}

#ace-renewal-wrapper .ace-access__inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

#ace-renewal-wrapper .ace-access__content {
  display: flex;
  flex-direction: column;
  gap: 40px;
  align-items: center;
}

#ace-renewal-wrapper .ace-access__info,
#ace-renewal-wrapper .ace-access__map {
  width: 100%;
}

/* --- 所在地情報カード (HTMLテキスト) --- */
#ace-renewal-wrapper .ace-access__info-card {
  background-color: #ffffff;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  font-style: normal;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  height: 100%;
  border: 1px solid #f0f0f0;
}

#ace-renewal-wrapper .ace-access__info-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

#ace-renewal-wrapper .ace-access__info-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  min-width: 90px;
  padding: 8px 0;
  background-color: #82c1d7;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: bold;
  border-radius: 8px;
  text-align: center;
  line-height: 1.3;
  letter-spacing: 0.05em;
}

#ace.ace-gallery__close-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 32px;
  line-height: 50px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  cursor: pointer;
  z-index: 100000000;
  /* アイテムよりさらに手前に */
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#ace-renewal-wrapper .ace-access__info-row--tel .ace-access__info-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: #3e3a39;
  letter-spacing: 0.02em;
}

#ace-renewal-wrapper .ace-access__info-value {
  font-size: clamp(16px, 1vw + 12px, 18px);
  color: #4a4a4a;
  line-height: 1.6;
  margin: 0;
}

#ace-renewal-wrapper .ace-access__info-value a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.3s ease;
}

#ace-renewal-wrapper .ace-access__info-value a:hover {
  color: #82c1d7;
  border-bottom-color: #82c1d7;
}

#ace-renewal-wrapper .ace-access__info-row--address,
#ace-renewal-wrapper .ace-access__info-row--access {
  align-items: flex-start;
}

#ace-renewal-wrapper .ace-access__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

#ace-renewal-wrapper .ace-access__list li {
  position: relative;
  padding-left: 1.2em;
  margin-bottom: 4px;
}

#ace-renewal-wrapper .ace-access__list li:last-child {
  margin-bottom: 0;
}

#ace-renewal-wrapper .ace-access__list li::before {
  content: "◎";
  position: absolute;
  left: 0;
  color: #82c1d7;
}

#ace-renewal-wrapper .ace-access__directions {
  margin-top: 30px;
  padding: 24px;
  background-color: #f0f7f9;
  border-left: 4px solid #82c1d7;
  border-radius: 8px;
}

#ace-renewal-wrapper .ace-access__directions p {
  font-size: 0.95rem;
  line-height: 1.8;
  color: #4a4a4a;
  margin: 0;
}

#ace-renewal-wrapper .ace-access__image-container {
  background-color: #ffffff;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#ace-renewal-wrapper .ace-access__image-container:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

#ace-renewal-wrapper .ace-access__location-img,
#ace-renewal-wrapper .ace-access__map-img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* PC用レイアウト (Side by Side) */
@media screen and (min-width: 821px) {
  #ace-renewal-wrapper .ace-access__content {
    flex-direction: row;
    align-items: stretch;
  }

  #ace-renewal-wrapper .ace-access__info {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  #ace-renewal-wrapper .ace-access__map {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  #ace-renewal-wrapper .ace-access__image-container {
    height: 100%;
    /* 内容に合わせて高さを自動調整 */
  }
}

/* ==========================================
 * Map Trigger / Modal
 * ========================================== */
:is(#ace, #ace-renewal-wrapper) .ace-access__map-trigger {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer !important; /* 強制的にポインターとする */
  display: block;
  width: 100%;
  position: relative;
  text-align: left;
  border-radius: 16px;
  transition: transform 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

:is(#ace, #ace-renewal-wrapper) .ace-access__map-trigger:hover {
  transform: translateY(-4px);
}

:is(#ace, #ace-renewal-wrapper) .ace-access__map-trigger .ace-access__image-container {
  margin-bottom: 0;
  /* ボタン内部ではマージン不要 */
  pointer-events: none;
  /* ボタン全体で受けるため */
}

:is(#ace, #ace-renewal-wrapper) .ace-access__map-hint {
  display: block;
  font-size: 14px;
  color: #82c1d7 !important; /* 親ページのスタイル干渉を防ぐため強制 */
  margin-top: 12px;
  font-weight: bold;
  opacity: 0.8;
  transition: all 0.3s ease;
  text-align: center;
}

:is(#ace, #ace-renewal-wrapper) .ace-access__map-trigger:hover .ace-access__map-hint {
  opacity: 1;
  color: #5ab1d0 !important; /* ホバー時は少し濃い色に */
}

/* --- Modal Core --- */
:is(#ace, #ace-renewal-wrapper) .ace-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
}

:is(#ace, #ace-renewal-wrapper) .ace-modal[aria-hidden="true"] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

:is(#ace, #ace-renewal-wrapper) .ace-modal__overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  view-transition-name: ace-modal-overlay;
  /* 背景の暗転を個別レイヤーで制御 */
}

:is(#ace, #ace-renewal-wrapper) .ace-modal__container {
  position: relative;
  width: 90%;
  max-width: 1000px;
  background-color: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.5);
  z-index: 1;
  view-transition-name: map-modal;
  /* View Transitions用 */
}

:is(#ace, #ace-renewal-wrapper) .ace-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #fff;
  border: 1px solid #eee;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  color: #3e3a39;
  transition: all 0.3s ease;
}

#ace-renewal-wrapper .ace-modal__close:hover {
  background-color: #f8f8f8;
  transform: rotate(90deg);
}

#ace-renewal-wrapper .ace-modal__body {
  width: 100%;
  padding-bottom: 60%;
  /* Aspect Ratio */
  position: relative;
  background-color: #f0f0f0;
  /* ロード前の背景色 */
}

#ace-renewal-wrapper .ace-modal__iframe-holder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#ace-renewal-wrapper .ace-modal__iframe-holder iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* --- View Transitions 定義 --- */
::view-transition-old(map-modal) {
  animation: 300ms cubic-bezier(0.4, 0, 1, 1) both fade-out,
             300ms cubic-bezier(0.4, 0, 1, 1) both modal-zoom-reverse;
  mix-blend-mode: normal;
}

::view-transition-new(map-modal) {
  animation: 500ms cubic-bezier(0, 0, 0.2, 1) both modal-zoom;
  mix-blend-mode: normal;
}

/* モーダル表示時の背景（root）のクロスフェードを抑制 */
.ace-modal-open::view-transition-group(root) {
  animation-duration: 0s;
}

/* オーバーレイとモーダル本体の重なり順 */
::view-transition-group(ace-modal-overlay) {
  z-index: 9999;
  mix-blend-mode: normal;
}

::view-transition-group(map-modal) {
  z-index: 10000;
  mix-blend-mode: normal;
}

@keyframes modal-zoom {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(30px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes modal-zoom-reverse {
  from {
    transform: scale(1) translateY(0);
  }

  to {
    transform: scale(0.95) translateY(10px);
  }
}

@keyframes fade-out {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

/* ==========================================
 * 5. Responsive / Media Queries
 * レスポンシブ挙動（スマートフォン等）向け余白の最適化
 * ========================================== */
@media screen and (max-width: 768px) {

  /* スマホの狭い画面でも間延びしないように各所の余白を縮小 */
  #ace-renewal-wrapper .ace-hero {
    margin-bottom: 20px;
  }

  #ace-renewal-wrapper .ace-ikou,
  #ace-renewal-wrapper .ace-sentaku,
  #ace-renewal-wrapper .ace-teichaku {
    padding: 40px 0;
  }

  #ace-renewal-wrapper .ace-ikou__header,
  #ace-renewal-wrapper .ace-sentaku__header,
  #ace-renewal-wrapper .ace-teichaku__header {
    margin-bottom: 24px;
  }

  #ace-renewal-wrapper .ace-ikou__summary,
  #ace-renewal-wrapper .ace-sentaku__purpose,
  #ace-renewal-wrapper .ace-teichaku__summary,
  #ace-renewal-wrapper .ace-teichaku__diagram {
    margin-bottom: 32px;
  }

  #ace-renewal-wrapper .ace-teichaku__diagram {
    padding: 24px 16px;
    /* スマホ向け内部余白の最適化 */
  }

  #ace-renewal-wrapper .ace-ikou__margin-top,
  #ace-renewal-wrapper .ace-teichaku__recommend {
    margin-top: 32px;
  }

  /* タブのレスポンシブ最適化 */
  #ace-renewal-wrapper .ace-tabs__trigger {
    padding: 12px 4px;
    font-size: 14px;
    /* スマホ時は少し小さく */
    margin: 0 2px;
  }

  /* アクセスセクションのスマホ対応 */
  #ace-renewal-wrapper .ace-access {
    padding: 60px 0;
  }

  #ace-renewal-wrapper .ace-access__content {
    gap: 32px;
  }

  #ace-renewal-wrapper .ace-access__image-container {
    padding: 16px;
  }

  /* 住所カードのスマホ調整 */
  #ace-renewal-wrapper .ace-access__info-card {
    padding: 30px 20px;
    gap: 20px;
  }

  #ace-renewal-wrapper .ace-access__info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  #ace-renewal-wrapper .ace-access__info-label {
    width: 60px;
    min-width: 60px;
    font-size: 11px;
    padding: 4px 0;
  }

  #ace-renewal-wrapper .ace-access__info-row--tel .ace-access__info-value {
    font-size: 1.4rem;
  }

  #ace-renewal-wrapper .ace-access__info-value {
    font-size: 14px;
    line-height: 1.5;
  }

  /* モーダルのスマホ調整 */
  #ace-renewal-wrapper .ace-modal__container {
    width: 95%;
    border-radius: 16px;
  }

  #ace-renewal-wrapper .ace-modal__body {
    padding-bottom: 120%;
    /* スマホでは縦長気味に */
  }

  #ace-renewal-wrapper .ace-modal__close {
    width: 36px;
    height: 36px;
    font-size: 22px;
    top: 10px;
    right: 10px;
  }

  /* お問い合わせセクションのスマホ調整 */
  #ace-renewal-wrapper .ace-contact {
    padding: 60px 0;
  }

  #ace-renewal-wrapper .ace-contact__container {
    flex-direction: column;
    padding: 40px 24px;
    text-align: center;
    gap: 32px;
    border-radius: 20px;
  }

  #ace-renewal-wrapper .ace-contact__title {
    font-size: 22px;
    padding-left: 0;
    margin-bottom: 16px;
  }

  #ace-renewal-wrapper .ace-contact__title::before {
    display: none;
  }

  #ace-renewal-wrapper .ace-contact__text {
    font-size: 14px;
    line-height: 1.7;
  }

  #ace-renewal-wrapper .ace-contact__qr-list {
    gap: 16px;
  }

  #ace-renewal-wrapper .ace-contact__qr-img {
    width: 80px;
    height: 80px;
  }

  #ace-renewal-wrapper .ace-contact__qr-label {
    font-size: 12px;
    padding: 3px 10px;
  }
}

/* office.html 組み込み時の sticky 動作阻害を解消 (祖先要素の overflow: hidden を上書き) */
.wrapp {
  overflow: visible !important;
}

/* ==========================================
   Gallery Section
   ========================================== */
.ace-gallery {
  padding: 80px 0;
  background-color: #fff;
}

.ace-gallery__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 5%;
}

.ace-gallery__header {
  text-align: center;
  margin-bottom: 50px;
}

.ace-gallery__title {
  font-family: 'Zen Maru Gothic', serif;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  color: #333;
  margin-bottom: 10px;
}

.ace-gallery__subtitle {
  font-size: 1.1rem;
  color: #666;
}

.ace-gallery__grid {
  display: grid;
  gap: 25px;
  /* モバイル: 1列 -> タブレット: 2列 -> PC: 3列 */
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .ace-gallery__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 950px) {
  .ace-gallery__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.ace-gallery__item {
  margin: 0;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: box-shadow 0.3s ease;
}

.ace-gallery__item:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.ace-gallery__image-wrapper {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.ace-gallery__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ace-gallery__caption {
  padding: 15px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: bold;
  color: #333;
  border-top: 1px solid #f0f0f0;
}

/* ==========================================
   Gallery Section - View Transitions REFACTORED
   ========================================== */

/* 1. 一覧 vs 拡大の状態管理 */
/* 拡大表示中、他のアイテムを非表示にする */
.ace-gallery__grid.is-show-details .ace-gallery__item:not(.is-expanded) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* 2. 拡大されたアイテム (Hero State) */
:where(html, body)>.ace-gallery__item.is-expanded {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 99999999 !important;
  /* 最前面を確保 */
  margin: 0 !important;
  padding: 40px;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center !important;
  overflow: hidden !important;
  opacity: 1 !important;
  visibility: visible !important;
  will-change: transform, opacity;
  cursor: zoom-out;
}

/* ルート要素のトランスフォームが Containing Block を作るのを防ぐための最終手段 */
:is(html, body).ace-modal-open {
  transform: none !important;
  perspective: none !important;
  filter: none !important;
}


/* 拡大時の画像コンテナ */
.ace-gallery__item.is-expanded .ace-gallery__image-wrapper {
  width: auto;
  height: auto;
  max-width: 90vw;
  max-height: 80vh;
  aspect-ratio: auto;
  overflow: visible;
  border-radius: 0;
}

/* 拡大時の画像本体 */
.ace-gallery__item.is-expanded .ace-gallery__img {
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
  /* box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8); */
  /* 拡大後の要素に名前を継承（JSで動的に付与されるが念のため） */
  view-transition-name: active-gallery-image;
}

/* 拡大時のキャプション */
.ace-gallery__item.is-expanded .ace-gallery__caption {
  color: #fff;
  border: none;
  font-size: 1.25rem;
  margin-top: 25px;
  font-weight: 500;
  background: transparent;
  transform: translateY(0);
  opacity: 1;
}

/* 3. View Transitions アニメーションのチューニング */
::view-transition-group(active-gallery-image) {
  animation-duration: 0.45s;
  animation-timing-function: cubic-bezier(0.5, 0, 0.2, 1);
  mix-blend-mode: normal;
}

/* 背景全体（root）の遷移負荷を最小化する */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-backdrop {
  background-color: transparent !important;
}

/* 4. 閉じるボタン（詳細表示時のみ現れる） */
/* 5. パフォーマンス最適化用クラス */
.ace-gallery__item.is-expanded.is-ready {
  backdrop-filter: blur(15px);
}

.ace-gallery__close-btn {
  display: none;
  position: fixed;
  top: 30px;
  right: 30px;
  width: 54px;
  height: 54px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  z-index: 100000001;
  /* アイテム(99999999)より前面を確実に確保 */
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
}

html.ace-modal-open .ace-gallery__close-btn {
  display: flex;
}

.ace-gallery__close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
}

/* モーダル表示時の背景スクロール禁止（共通） */
html {
  scrollbar-gutter: stable;
}

html.ace-modal-open {
  scroll-behavior: auto !important;
  /* スクロールバー消失時の跳ね返り防止 */
}

body.ace-modal-open {
  overflow: hidden;
}

/* ==========================================
   CTA Buttons (Inquiry & Reserve)
   ========================================== */
.ace-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  align-items: center;
  margin-top: 50px;
  width: 100%;
}

.ace-cta__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 200px;
  /* 3つ並んでも収まるサイズ */
  max-width: 320px;
  height: 64px;
  /* PCはマウス操作のため元の64pxに維持 */
  border-radius: 32px;
  font-size: 1.125rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.05em;
}

.ace-cta__btn::after {
  content: '>';
  position: absolute;
  right: 24px;
  font-size: 1.25rem;
  transition: transform 0.3s ease;
}

.ace-cta__btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.ace-cta__btn:hover::after {
  transform: translateX(5px);
}

/* お電話で: Turquoise/Blue Gradient */
.ace-cta__btn--tel {
  background: linear-gradient(135deg, #0288d1 0%, #26c6da 100%);
  color: #fff !important;
}

/* お問い合わせ: Orange Gradient */
.ace-cta__btn--inquiry {
  background: linear-gradient(135deg, #f57c00 0%, #ffa726 100%);
  color: #fff !important;
}

/* 見学予約: Pink/Red Gradient */
.ace-cta__btn--reserve {
  background: linear-gradient(135deg, #d81b60 0%, #ec407a 100%);
  color: #fff !important;
}

@media screen and (max-width: 768px) {
  .ace-cta {
    flex-direction: column;
    gap: 20px;
    /* 余白を広げて押し間違いを防止 */
    margin-top: 40px;
  }

  .ace-cta__btn {
    width: 100%;
    min-width: auto;
    height: 56px !important;
    min-height: 56px !important;
    flex-shrink: 0 !important;
    font-size: 1.125rem;
    border-radius: 28px;
  }
}

/* ==========================================
   Parent Page Integration Fixes (office02.html)
   ========================================== */


/* 
 * 2. モーダル（ギャラリー拡大、地図）表示中に
 * 親の全要素よりも前面にACEを表示する
 */
/* ==========================================
 * Forced Hamburger Menu (ACE表示中のナビ制御) 
 * 親フレームのファイルを編集せず、このCSSから上書きします。
 * ========================================== */

@media screen and (min-width: 1151px) {

  /* ACE表示中は既存のデスクトップヘッダー要素を隠す */
  body.ace-section-visible .head-area,
  body.ace-section-visible .global-nav-item-list {
    display: none !important;
  }

  /* ACEタブUIを最上部に固定 */
  body.ace-section-visible #ace-renewal-wrapper .ace-tabs__nav {
    top: 0 !important;
    max-width: 100%;
    /* 横幅を広げて安定させる */
  }

  /* ハンバーガーボタンの強制表示とモバイル風スタイル再現 */
  body.ace-section-visible .global-nav-button {
    display: block !important;
    position: fixed !important;
    top: 10px !important;
    right: 20px !important;
    width: 45px !important;
    height: 45px !important;
    background: #099 !important;
    border-radius: 4px !important;
    z-index: 2000 !important;
    /* ACEのタブ(z-index: 400)より前面へ */
    cursor: pointer !important;
  }

  /* アイコン（三本線）の描画（親CSSに依存せず自己完結） */
  body.ace-section-visible .global-nav-button-icon {
    position: absolute !important;
    top: 50% !important;
    left: 9px !important;
    width: 27px !important;
    height: 2px !important;
    background: white !important;
    display: block !important;
    transform: translateY(-50%);
  }

  body.ace-section-visible .global-nav-button-icon::before,
  body.ace-section-visible .global-nav-button-icon::after {
    position: absolute !important;
    left: 0 !important;
    display: block !important;
    content: "" !important;
    width: 100% !important;
    height: 2px !important;
    background: white !important;
    transition: 0.2s all !important;
  }

  body.ace-section-visible .global-nav-button-icon::before {
    top: -8px !important;
  }

  body.ace-section-visible .global-nav-button-icon::after {
    top: 8px !important;
  }

  /* オープン時のアイコン（×印） */
  body.ace-section-visible .global-nav-button.open .global-nav-button-icon {
    background: transparent !important;
  }

  body.ace-section-visible .global-nav-button.open .global-nav-button-icon::before {
    top: 0 !important;
    transform: rotate(45deg) !important;
  }

  body.ace-section-visible .global-nav-button.open .global-nav-button-icon::after {
    top: 0 !important;
    transform: rotate(-45deg) !important;
  }

  /* ロゴを固定位置へ移動 */
  body.ace-section-visible nav .head-logo {
    position: fixed !important;
    top: 8px !important;
    left: 3% !important;
    z-index: 2000 !important;
    width: 200px !important;
    background: rgba(255, 255, 255, 0.8) !important;
    padding: 5px 10px !important;
    border-radius: 4px !important;
    backdrop-filter: blur(4px) !important;
    display: none !important;
  }

  /* サイドメニュー（スマホ版の挙動を再現） */
  body.ace-section-visible .global-nav.open .global-nav-item-list {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    background: rgba(255, 255, 240, 0.98) !important;
    z-index: 1500 !important;
    overflow-y: auto !important;
    pointer-events: all !important;
    padding: 80px 0 40px 0 !important;
  }

  body.ace-section-visible .global-nav.open .global-nav-item {
    display: block !important;
    width: 100% !important;
    border-bottom: 1px solid #ddd !important;
    position: static !important;
  }

  body.ace-section-visible .global-nav.open .global-nav-item>a {
    display: flex !important;
    align-items: center !important;
    padding: 20px 30px !important;
    text-align: left !important;
    font-size: 18px !important;
    color: #4f4f4f !important;
    text-shadow: 2px 2px 3px #ccc !important;
  }

  /* PC版のホバーエフェクト（下線）を解除 */
  body.ace-section-visible .global-nav.open .global-nav-item>a::after {
    display: none !important;
  }

  /* モバイル版の矢印アイコン再現 */
  body.ace-section-visible .global-nav.open .global-nav-item>a::before {
    box-sizing: border-box !important;
    content: "" !important;
    display: block !important;
    margin-right: 10px !important;
    width: 10px !important;
    height: 10px !important;
    border: solid #099 !important;
    border-width: 0 3px 3px 0 !important;
    transform-origin: center !important;
    transform: translateX(-25%) rotate(-45deg) !important;
    transition: 0.2s all !important;
  }

  /* 展開時の矢印向き変転 */
  body.ace-section-visible .global-nav.open .global-nav-item>a.open::before {
    transform: translate(-25%, -2.5px) rotate(45deg) !important;
  }

  /* サブメニュー（展開リスト）を縦並び・インライン表示に強制 */
  body.ace-section-visible .global-nav.open .global-nav-sub-item-list {
    display: none !important;
    /* JS(.open)で制御 */
    position: static !important;
    width: 100% !important;
    min-width: auto !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    background: rgba(0, 0, 0, 0.03) !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    pointer-events: all !important;
  }

  body.ace-section-visible .global-nav.open .global-nav-sub-item-list.open {
    display: block !important;
  }

  body.ace-section-visible .global-nav.open .global-nav-sub-item>a {
    padding: 15px 30px 15px 50px !important;
    font-size: 16px !important;
    color: #4f4f4f !important;
    border-top: 1px dotted #ccc !important;
    display: flex !important;
    align-items: center !important;
  }

  body.ace-section-visible .global-nav.open .global-nav-sub-item>a::before {
    box-sizing: border-box !important;
    content: "" !important;
    display: block !important;
    margin-right: 10px !important;
    width: 8px !important;
    height: 8px !important;
    border: solid #099 !important;
    border-width: 0 2px 2px 0 !important;
    transform: translateX(-25%) rotate(-45deg) !important;
  }
}

:is(html, body).ace-modal-open #ace-renewal-wrapper {
  z-index: 1000000;
}

#ace-renewal-wrapper header .clone-nav-top {
  display: none !important;
}


/* Slickが適用される前の状態を制御 */
.slider {
  display: block;
  width: 100%;
  /* 640/426 の比率を維持して高さを予約 */
  aspect-ratio: 640 / 426;
  overflow: hidden;
  background-color: #f0f0f0;
  /* 読み込み中の背景色 */
}

/* Slickが起動した後は、Slick側の高さ制御に任せる */
.slider.slick-initialized {
  aspect-ratio: auto;
  overflow: visible;
}

/* スライド中の画像が枠からはみ出さないよう調整 */
.slider .slick-slide img {
  width: 100%;
  height: auto;
  vertical-align: bottom;
}