/**
 * Almond Booking Portal — CSS v2.0
 *
 * 設計思想:
 *   - 黒・白・グレー + 青1色のみ
 *   - 枠ではなく細い線で区切る
 *   - 押せる場所は矢印で明示
 *   - モバイルファースト
 *   - CTAは5つ以内
 *
 * 統合:
 *   - フォント: Manrope (サイト既存と同一)
 *   - テキスト: #333333 (サイト共通)
 *   - ボーダー: #e5e5e5 (サイト共通)
 *   - アクセント青: #2563EB (十分なコントラスト, WCAG AA)
 */

/* ══════════════════════════════════════════════════════════════
   トークン（CSS カスタムプロパティ）
══════════════════════════════════════════════════════════════ */
.almond-bp {
  /* カラー */
  --bp-bg:          #f7f7f7;
  --bp-surface:     #ffffff;
  --bp-text:        #333333;   /* サイトのプライマリテキストに合わせる */
  --bp-muted:       #767676;   /* WCAG AA 4.5:1 on white */
  --bp-line:        #e5e5e5;   /* サイトのボーダーに合わせる */
  --bp-black:       #111111;
  --bp-white:       #ffffff;
  --bp-blue:        #2563EB;   /* 青1色（WCAG AA 確保） */
  --bp-blue-light:  rgba(37, 99, 235, 0.08);
  --bp-blue-hover:  #1D4ED8;

  /* 影 */
  --bp-shadow-sm:   0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --bp-shadow-md:   0 4px 16px rgba(0,0,0,.07), 0 1px 4px rgba(0,0,0,.04);
  --bp-shadow-lg:   0 16px 40px rgba(0,0,0,.09), 0 2px 8px rgba(0,0,0,.04);

  /* 角丸 */
  --bp-radius-xl:   20px;
  --bp-radius-lg:   14px;
  --bp-radius-md:   10px;
  --bp-radius-sm:   6px;

  /* トランジション */
  --bp-ease:        cubic-bezier(.4,0,.2,1);
  --bp-t-fast:      100ms var(--bp-ease);
  --bp-t-base:      180ms var(--bp-ease);

  /* フォント（サイト統合）*/
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont,
               'Helvetica Neue', 'Yu Gothic', 'Hiragino Sans',
               'Hiragino Kaku Gothic ProN', sans-serif;
  color: var(--bp-text);
}

.almond-bp *,
.almond-bp *::before,
.almond-bp *::after {
  box-sizing: border-box;
}

/* ══════════════════════════════════════════════════════════════
   レイアウト
══════════════════════════════════════════════════════════════ */
.almond-bp {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;          /* post-content の幅いっぱいに広げる */
  background: transparent;
}

/* セクション（細い線区切り・左右余白は各セクションが制御） */
.almond-bp__section {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 20px 16px;
  border: none;
  border-bottom: 1px solid var(--bp-line);
}

.almond-bp__section:last-child {
  border-bottom: none;
}

/* ── ダイレクトブッキング（白カード・全幅） ── */
.almond-bp__section--direct {
  background: var(--bp-surface);
  border-radius: var(--bp-radius-xl);
  box-shadow: var(--bp-shadow-lg);
  border: 1px solid rgba(0, 0, 0, .04);
  padding: clamp(20px, 5vw, 32px);
  margin-bottom: 8px;
}

/* ── 管理セクション ── */
.almond-bp__section--manage {
  margin-top: 0;
}

/* ══════════════════════════════════════════════════════════════
   セクションヘッダー
══════════════════════════════════════════════════════════════ */
.almond-bp__section-head {
  margin-bottom: 20px;
}

.almond-bp__kicker {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--bp-muted);
}

.almond-bp__section-title {
  margin: 0;
  font-size: clamp(20px, 4.5vw, 28px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--bp-black);
}

/* ══════════════════════════════════════════════════════════════
   フォームフィールド
══════════════════════════════════════════════════════════════ */
.almond-bp__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.almond-bp__field {
  display: block;
}

.almond-bp__field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--bp-muted);
}

.almond-bp__input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  background: var(--bp-white);
  color: var(--bp-text);
  border: 1px solid var(--bp-line);
  border-radius: var(--bp-radius-sm);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--bp-t-base), box-shadow var(--bp-t-base);
}

.almond-bp__input:focus {
  outline: none;
  border-color: var(--bp-blue);
  box-shadow: 0 0 0 3px var(--bp-blue-light);
}

/* ══════════════════════════════════════════════════════════════
   サマリー表示
══════════════════════════════════════════════════════════════ */
.almond-bp__summary {
  padding: 4px 0 12px;
  /* border-top 削除: サマリーをフォームの上に移動したため不要 */
  font-size: 14px;
  font-weight: 700;
  color: var(--bp-text);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
}

/* ══════════════════════════════════════════════════════════════
   CTA① 今日泊まれる（青・最優先）
══════════════════════════════════════════════════════════════ */
.almond-bp__cta--today {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  min-height: 56px;
  background: var(--bp-blue);
  color: var(--bp-white);
  border: none;
  border-radius: var(--bp-radius-md);
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color var(--bp-t-base), transform var(--bp-t-fast), box-shadow var(--bp-t-base);
  box-shadow: 0 6px 20px rgba(37,99,235,.25), 0 1px 4px rgba(37,99,235,.15);
  margin-bottom: 20px;
}

.almond-bp__cta--today:hover {
  background: var(--bp-blue-hover);
  transform: translateY(-1px);
}

.almond-bp__cta--today:active {
  transform: scale(0.985);
  transition: transform var(--bp-t-fast);
}

.almond-bp__cta--today .almond-bp__cta-arrow { color: rgba(255,255,255,.7); }

.almond-bp__cta--today:hover .almond-bp__cta-arrow {
  transform: translateX(3px);
}

/* ══════════════════════════════════════════════════════════════
   CTA② 空室確認（黒・プライマリ）
══════════════════════════════════════════════════════════════ */
.almond-bp__cta--primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  min-height: 56px;
  background: var(--bp-black);
  color: var(--bp-white);
  border: none;
  border-radius: var(--bp-radius-md);
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color var(--bp-t-base), transform var(--bp-t-fast), box-shadow var(--bp-t-base);
  box-shadow: 0 6px 20px rgba(17,17,17,.22), 0 1px 4px rgba(17,17,17,.12);
  margin-bottom: 12px;
}

.almond-bp__cta--primary:hover {
  background: #222222;
  transform: translateY(-1px);
}

.almond-bp__cta--primary:active {
  transform: scale(0.985);
  transition: transform var(--bp-t-fast);
}

/* ══════════════════════════════════════════════════════════════
   CTA③④⑤ クイックグリッド（細い線区切り）
══════════════════════════════════════════════════════════════ */
.almond-bp__quick-grid {
  border-top: 1px solid var(--bp-line);
}

.almond-bp__cta--line,
.almond-bp__cta--muted {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border: none;
  border-bottom: 1px solid var(--bp-line);
  border-radius: 0;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--bp-text);
  cursor: pointer;
  text-align: left;
  transition: background-color var(--bp-t-fast), color var(--bp-t-fast);
}

.almond-bp__cta--line:last-child,
.almond-bp__cta--muted:last-child {
  border-bottom: none;
}

.almond-bp__cta--line:hover {
  color: var(--bp-black);
  background: rgba(0,0,0,.015);
}

.almond-bp__cta--line:active,
.almond-bp__cta--muted:active {
  transform: scale(0.99);
}

.almond-bp__cta--muted {
  color: var(--bp-muted);
  font-weight: 600;
}

/* ── 矢印 ── */
.almond-bp__cta-arrow {
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  transition: transform var(--bp-t-base);
}

.almond-bp__cta--primary .almond-bp__cta-arrow { color: rgba(255,255,255,.7); }
.almond-bp__cta--line    .almond-bp__cta-arrow { color: var(--bp-muted); }
.almond-bp__cta--muted   .almond-bp__cta-arrow { color: var(--bp-line); }

.almond-bp__cta--line:hover .almond-bp__cta-arrow {
  transform: translateX(3px);
}

/* ══════════════════════════════════════════════════════════════
   予約管理リスト
══════════════════════════════════════════════════════════════ */
.almond-bp__link-list {
  border-top: 1px solid var(--bp-line);
}

.almond-bp__link-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  border: none;
  border-bottom: 1px solid var(--bp-line);
  border-radius: 0;
  background: transparent;
  font-family: inherit;
  color: var(--bp-text);
  cursor: pointer;
  text-align: left;
  transition: background-color var(--bp-t-fast);
}

.almond-bp__link-row:last-child {
  border-bottom: none;
}

.almond-bp__link-row:hover {
  background: rgba(0,0,0,.015);
}

.almond-bp__link-row:active {
  transform: scale(0.995);
}

.almond-bp__link-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.almond-bp__link-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--bp-black);
}

.almond-bp__link-desc {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--bp-muted);
}

.almond-bp__row-arrow {
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--bp-muted);
  transition: transform var(--bp-t-base), color var(--bp-t-base);
}

.almond-bp__link-row:hover .almond-bp__row-arrow {
  transform: translateX(3px);
  color: var(--bp-text);
}

/* ══════════════════════════════════════════════════════════════
   URLプレビュー（開発用）
══════════════════════════════════════════════════════════════ */
.almond-bp__preview {
  border-left: 3px solid var(--bp-blue);
  background: var(--bp-blue-light);
}

.almond-bp__code {
  display: block;
  padding: 12px 0 0;
  border-top: 1px solid rgba(37,99,235,.15);
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 12px;
  line-height: 1.8;
  color: var(--bp-text);
  font-family: 'Fira Code', 'Courier New', monospace;
}

/* ══════════════════════════════════════════════════════════════
   ローディングオーバーレイ
══════════════════════════════════════════════════════════════ */
.almond-bp__loading {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 9999;
  /* 0.1秒フィードバック: 押下直後に表示 */
  animation: bp-fade-in 80ms var(--bp-ease) both;
}

.almond-bp__loading--hidden {
  display: none;
}

@keyframes bp-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.almond-bp__loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 28px 36px;
  border-radius: 20px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 20px 60px rgba(17,17,17,.12), 0 2px 8px rgba(17,17,17,.06);
  border: 1px solid rgba(17,17,17,.05);
}

.almond-bp__spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid #d9d9d9;
  border-top-color: var(--bp-blue);
  animation: bp-spin .7s linear infinite;
}

@keyframes bp-spin {
  to { transform: rotate(360deg); }
}

.almond-bp__loading-text {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--bp-text);
  font-family: 'Manrope', -apple-system, sans-serif;
}

/* ══════════════════════════════════════════════════════════════
   フォーカス表示（アクセシビリティ）
══════════════════════════════════════════════════════════════ */
.almond-bp__cta:focus-visible,
.almond-bp__link-row:focus-visible {
  outline: 2px solid var(--bp-blue);
  outline-offset: 2px;
}

/* ══════════════════════════════════════════════════════════════
   レスポンシブ: タブレット（〜860px）
══════════════════════════════════════════════════════════════ */
@media (min-width: 641px) {
  .almond-bp__quick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
  }

  .almond-bp__quick-grid .almond-bp__cta--line,
  .almond-bp__quick-grid .almond-bp__cta--muted {
    padding: 16px 8px 16px 0;
  }

  /* 右列の右ボーダー（仕切り線） */
  .almond-bp__quick-grid .almond-bp__cta--line:nth-child(odd),
  .almond-bp__quick-grid .almond-bp__cta--muted:nth-child(odd) {
    border-right: 1px solid var(--bp-line);
    padding-right: 16px;
  }
}

/* ══════════════════════════════════════════════════════════════
   レスポンシブ: モバイル（〜640px）
══════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .almond-bp {
    padding: 12px 0 0;   /* カードとヘッダーの間に余白 */
    gap: 0;
  }

  .almond-bp__section {
    padding: 16px;
    border-radius: 0;
  }

  /* ダイレクトブッキングカードはモバイルでも角丸を維持 */
  .almond-bp__section--direct {
    padding: 20px 16px;
    border-radius: var(--bp-radius-xl);
    margin-bottom: 4px;
  }

  .almond-bp__fields {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  /* モバイル: 空室確認ボタンをスティッキー */
  .almond-bp__cta--primary {
    position: sticky;
    bottom: 12px;
    z-index: 10;
    animation: bp-sticky-in 200ms var(--bp-ease) both;
  }

  @keyframes bp-sticky-in {
    from { transform: translateY(8px); opacity: .7; }
    to   { transform: translateY(0);   opacity: 1; }
  }
}

/* ══════════════════════════════════════════════════════════════
   サイト既存スタイルとの競合防止
══════════════════════════════════════════════════════════════ */

/* TwentyTwentyFive / Gutenberg のリセット上書き防止 */
.almond-bp button {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* WordPressコアのbuttonスタイル上書き */
.almond-bp .almond-bp__cta,
.almond-bp .almond-bp__link-row {
  line-height: 1.2;
  text-transform: none;
  letter-spacing: normal;
}

/* ══════════════════════════════════════════════════════════════
   プリント非表示
══════════════════════════════════════════════════════════════ */
@media print {
  .almond-bp__loading { display: none !important; }
}

/* ══════════════════════════════════════════════════════════════
   フッターフローティングメニュー ×チャットボット 縦位置揃え
   ────────────────────────────────────────────────────────
   #footerFloatingMenu   : align-items:flex-end; padding-bottom Xpx
   #acb-trigger          : bottom:20px; height:60px  → center = 50px from bottom
   pill (.ja-only span)  : height:56px → center = padding-bottom + 28

   padding-bottom: 22px → center = 22 + 28 = 50px  ✓ 揃う
══════════════════════════════════════════════════════════════ */
/* 481　767px: チャットボット bottom:20px / height:60px → center=50px
   padding-bottom:22px → pill center = 22+28 = 50px ✓ */
@media (max-width: 767px) {
  #footerFloatingMenu {
    padding-bottom: 22px !important;
  }
}

/* ≤480px 実機スマホ: チャットボット bottom:16px / height:56px → center=44px
   padding-bottom:16px → pill center = 16+28 = 44px ✓（両者が完全一致） */
@media (max-width: 480px) {
  #footerFloatingMenu {
    padding-bottom: 16px !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   スクロールトリガー（全ページ共通）
   ※ #acb-trigger は transform/transition を上書きしない
     → チャットボットの .acb-on トグル動作を壊さないため
   JS が .almond-scroll-hidden / .almond-scroll-visible を付け外し
══════════════════════════════════════════════════════════════ */
/* --- フッターメニュー: transform アニメーション OK --- */
#footerFloatingMenu.almond-scroll-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(14px) !important;
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

#footerFloatingMenu.almond-scroll-visible {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* --- チャットボット: opacity + visibility のみ（transform/transition 上書き禁止）--- */
#acb-trigger.almond-scroll-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#acb-trigger.almond-scroll-visible {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* ══════════════════════════════════════════════════════════════
   カフェページ — 2ボタンレイアウト
   ──────────────────────────────────────────────────────────
   /cafe/ (page-id-1316) では「カフェを予約」「Uber Eats 出前」の
   2つのピル型ボタンを横並びに表示する。

   重要: 既存の #footerFloatingMenu .ja-only a ルールが
   width:100%!important / height:58px!important を持っているため、
   body.page-id-1316 で詳細度を上げて上書きする。
══════════════════════════════════════════════════════════════ */

/* --- コンテナ: 2ボタンを横並び --- */
body.page-id-1316 .almond-cafe-btns {
  display: flex !important;
  gap: 6px !important;
  width: 100% !important;
}

/* --- 各ボタン共通: 既存 .ja-only a の上書き --- */
@media (max-width: 767px) {
  body.page-id-1316 #footerFloatingMenu .ja-only a.almond-cafe-btn,
  body.page-id-1316 #footerFloatingMenu .en-only a.almond-cafe-btn {
    flex: 1 1 0% !important;
    width: auto !important;
    height: 56px !important;
    padding: 0 14px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
    gap: 6px !important;
    border-radius: 50px !important;
    color: #ffffff !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    transition: transform 0.15s ease, opacity 0.15s ease !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  body.page-id-1316 #footerFloatingMenu .ja-only a.almond-cafe-btn:active,
  body.page-id-1316 #footerFloatingMenu .en-only a.almond-cafe-btn:active {
    transform: scale(0.97) !important;
    opacity: 0.85 !important;
  }

  body.page-id-1316 #footerFloatingMenu a.almond-cafe-btn--reserve {
    background: #000000 !important;
  }

  body.page-id-1316 #footerFloatingMenu a.almond-cafe-btn--uber {
    background: #222222 !important;
  }

  body.page-id-1316 #footerFloatingMenu .almond-cafe-btn svg {
    flex-shrink: 0 !important;
    opacity: 0.85;
  }
}

@media (max-width: 480px) {
  body.page-id-1316 #footerFloatingMenu .ja-only a.almond-cafe-btn,
  body.page-id-1316 #footerFloatingMenu .en-only a.almond-cafe-btn {
    height: 56px !important;
    font-size: 12px !important;
    padding: 0 12px !important;
    gap: 5px !important;
  }
}
