/*!
Theme Name: Spa Treatment Ivory
Theme URI: https://athealing-stg.greenocean.ltd/
Description: アイボリー＋ウォームグレー配色のSpa Treatment子テーマ。温和で落ち着いた雰囲気を演出します。
Author: Green Ocean
Author URI: https://greenocean.ltd/
Template: spa-treatment
Version: 1.0.0
Requires at least: 5.9
Tested up to: 6.8
Requires PHP: 5.6
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Text Domain: spa-treatment-ivory
Tags: spa, wellness, ivory, warm-gray, relaxation
*/

/*
配色パターン4: 【温和】アイボリー ＋ ウォームグレー
- ベース（アイボリー）: #FCFBF7
- メイン（ウォームグレー）: #EFECEC
- アクセント（チャコール）: #595959
*/

:root {
  /* カスタムカラー変数 */
  --ivory-base: #FCFBF7;
  --ivory-warm-gray: #EFECEC;
  --ivory-charcoal: #595959;
  --ivory-text: #333333;
  --ivory-border: #E0DEDA;
  --ivory-hover: #4A4A4A;
  
  /* フォント設定 */
  --ivory-font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Meiryo', sans-serif;
  
  /* ボタンのカスタマイズ */
  --wp--custom--core-button--color: #FFFFFF;
  --wp--custom--core-button--color--background: #595959;
  --wp--custom--core-button--color-hover: #FFFFFF;
  --wp--custom--core-button--color--background-hover: #4A4A4A;
  --wp--custom--core-button--border-radius--top-left: 4px;
  --wp--custom--core-button--border-radius--top-right: 4px;
  --wp--custom--core-button--border-radius--bottom-left: 4px;
  --wp--custom--core-button--border-radius--bottom-right: 4px;
}

/* ベース背景色の変更 */
body {
  background: var(--ivory-base) !important;
  color: var(--ivory-text) !important;
  font-family: var(--ivory-font-family) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* セクション背景 */
.wp-block-group.has-background,
.wp-block-cover {
  background-color: var(--ivory-warm-gray) !important;
}

/* プライマリカラーの上書き */
.has-primary-color {
  color: var(--ivory-charcoal) !important;
}

.has-primary-background-color {
  background-color: var(--ivory-charcoal) !important;
}

/* セカンダリ背景色の上書き */
.has-background-secondary-background-color,
.has-background-secondary-color {
  background-color: var(--ivory-warm-gray) !important;
}

/* ボタンのスタイル */
.wp-block-button__link,
.wp-element-button {
  background-color: var(--ivory-charcoal) !important;
  color: #FFFFFF !important;
  border-radius: 4px !important;
  transition: all 0.3s ease;
  font-family: var(--ivory-font-family) !important;
}

.wp-block-button__link:hover,
.wp-element-button:hover {
  background-color: var(--ivory-hover) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(89, 89, 89, 0.2);
}

/* リンク色 */
a {
  color: var(--ivory-charcoal);
  transition: color 0.3s ease;
  font-family: var(--ivory-font-family) !important;
}

a:hover {
  color: var(--ivory-hover);
}

/* ヘッダーのスタイル */
header,
.wp-block-template-part[data-area="header"] {
  background-color: var(--ivory-base) !important;
  border-bottom: 1px solid var(--ivory-border);
}

/* ヘッダーカラム間のギャップを最小化 */
.header-main-box.wp-block-columns {
  gap: 8px !important;
  align-items: flex-start !important;
}

.header-main-box .wp-block-column {
  padding-left: 0 !important;
  padding-right: 0 !important;
  display: flex !important;
  align-items: flex-start !important;
}

/* ロゴエリア */
.header-logo {
  padding-top: 0 !important;
}

.header-logo h1 {
  line-height: 1.3 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.header-logo h1 a {
  display: inline-block;
  line-height: 1.3 !important;
  padding: 0 !important;
  vertical-align: top !important;
}

/* メニューエリア */
.header-menu {
  padding-top: 0 !important;
}

.header-menu .ivory-navigation {
  display: flex;
  align-items: flex-start;
  width: 100%;
}

.header-menu .ivory-nav-desktop {
  margin-top: 0 !important;
  align-items: flex-start !important;
}

.header-menu .ivory-nav-desktop a {
  vertical-align: top !important;
  line-height: 1.3 !important;
}

/* ご予約ボタンエリア */
.header-main-box .wp-block-buttons {
  margin: 0 !important;
}

.header-main-box .wp-block-button {
  margin: 0 !important;
}

.header-main-box .wp-block-button__link {
  line-height: 1.3 !important;
  display: inline-block !important;
  vertical-align: top !important;
  box-sizing: border-box !important;
}

.header-nav a {
  color: var(--ivory-text) !important;
}

.header-nav a:hover {
  color: var(--ivory-charcoal) !important;
}

/* フッターのスタイル */
footer,
.wp-block-template-part[data-area="footer"] {
  background-color: var(--ivory-warm-gray) !important;
  color: var(--ivory-text) !important;
  border-top: 1px solid var(--ivory-border);
}

footer a {
  color: var(--ivory-text);
}

footer a:hover {
  color: var(--ivory-charcoal);
}

/* 見出しのスタイル */
h1, h2, h3, h4, h5, h6 {
  color: var(--ivory-charcoal) !important;
  font-family: var(--ivory-font-family) !important;
}

/* 白色テキストを濃い色に上書き（視認性向上） */
.has-white-color,
.has-background-color {
  color: var(--ivory-charcoal) !important;
}

/* ヒーローセクション・カバーブロック内のテキストを濃い色に */
/* ボタンは例外として白文字を維持 */
.wp-block-cover__inner-container,
.wp-block-cover__inner-container h1,
.wp-block-cover__inner-container h2,
.wp-block-cover__inner-container h3,
.wp-block-cover__inner-container h4,
.wp-block-cover__inner-container h5,
.wp-block-cover__inner-container h6,
.wp-block-cover__inner-container p,
.wp-block-cover__inner-container a:not(.wp-block-button__link):not(.wp-element-button) {
  color: var(--ivory-charcoal) !important;
}

/* ヒーローセクション内のボタンは白文字を維持（重要） */
.wp-block-cover__inner-container .wp-block-button__link,
.wp-block-cover__inner-container .wp-element-button {
  color: #FFFFFF !important;
  background-color: var(--ivory-charcoal) !important;
}

/* カバーブロック・グループブロックの段落テキスト */
.wp-block-cover p,
.wp-block-group p {
  color: var(--ivory-text) !important;
}

/* 淡い背景に白いテキストが設定されている場合の強制上書き */
/* ただしボタンは例外 */
.has-background-secondary-background-color *:not(.wp-block-button__link):not(.wp-element-button),
.has-tertiary-background-color *:not(.wp-block-button__link):not(.wp-element-button),
.has-ivory-base-background-color *:not(.wp-block-button__link):not(.wp-element-button),
.has-warm-gray-background-color *:not(.wp-block-button__link):not(.wp-element-button) {
  color: var(--ivory-text) !important;
}

/* リンク色も濃い色に（白背景・淡い背景用）、ボタンは除く */
.has-background-secondary-background-color a:not(.wp-block-button__link):not(.wp-element-button),
.has-tertiary-background-color a:not(.wp-block-button__link):not(.wp-element-button),
.has-ivory-base-background-color a:not(.wp-block-button__link):not(.wp-element-button),
.has-warm-gray-background-color a:not(.wp-block-button__link):not(.wp-element-button) {
  color: var(--ivory-charcoal) !important;
}

/* すべてのボタンは濃い背景＋白文字を確保 */
.wp-block-button__link,
.wp-element-button,
.wp-block-button .wp-block-button__link {
  color: #FFFFFF !important;
  background-color: var(--ivory-charcoal) !important;
}

/* カードのスタイル */
.wp-block-group.is-style-card,
.card {
  background-color: #FFFFFF;
  border: 1px solid var(--ivory-border);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(89, 89, 89, 0.08);
  transition: all 0.3s ease;
}

.wp-block-group.is-style-card:hover,
.card:hover {
  box-shadow: 0 4px 12px rgba(89, 89, 89, 0.12);
  transform: translateY(-2px);
}

/* 入力フォームのスタイル */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
input[type="search"],
textarea,
select {
  background-color: #FFFFFF;
  border: 1px solid var(--ivory-border);
  color: var(--ivory-text);
  border-radius: 4px;
  transition: border-color 0.3s ease;
  font-family: var(--ivory-font-family) !important;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
  border-color: var(--ivory-charcoal);
  outline: none;
  box-shadow: 0 0 0 3px rgba(89, 89, 89, 0.1);
}

/* テーブルのスタイル */
table {
  border-color: var(--ivory-border);
  font-family: var(--ivory-font-family) !important;
}

table thead {
  background-color: var(--ivory-warm-gray);
  color: var(--ivory-text);
}

table tbody tr:nth-child(even) {
  background-color: var(--ivory-base);
}

/* ボーダー */
hr,
.wp-block-separator {
  border-color: var(--ivory-border) !important;
}

/* ナビゲーションメニュー */
.wp-block-navigation a {
  color: var(--ivory-text);
  font-family: var(--ivory-font-family) !important;
}

.wp-block-navigation a:hover {
  color: var(--ivory-charcoal);
}

/* ブロッククォート */
blockquote {
  border-left: 4px solid var(--ivory-charcoal);
  background-color: var(--ivory-warm-gray);
  color: var(--ivory-text);
  padding: 1.5rem;
  border-radius: 4px;
  font-family: var(--ivory-font-family) !important;
}

/* 画像ホバーエフェクト */
img {
  transition: opacity 0.3s ease;
}

.wp-block-image img:hover {
  opacity: 0.9;
}

/* アイコンのスタイル */
.wp-block-social-links a {
  background-color: var(--ivory-charcoal) !important;
  color: #FFFFFF !important;
}

.wp-block-social-links a:hover {
  background-color: var(--ivory-hover) !important;
}

/* ページネーション */
.wp-block-query-pagination a {
  color: var(--ivory-charcoal);
  border: 1px solid var(--ivory-border);
}

.wp-block-query-pagination a:hover {
  background-color: var(--ivory-charcoal);
  color: #FFFFFF;
}

/* モバイル対応 */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }
  
  .wp-block-button__link,
  .wp-element-button {
    padding: 12px 24px;
    font-size: 14px;
  }
}

/* 親テーマから継承される白色テキストの上書き */
.wp-block-cover .wp-block-cover-text,
.wp-block-cover h1.has-text-color,
.wp-block-cover h2.has-text-color,
.wp-block-cover h3.has-text-color,
.wp-block-cover .has-text-color {
  color: var(--ivory-charcoal) !important;
}

/* 特定のテキストカラークラスの上書き */
.has-foreground-color,
.has-text-link-color {
  color: var(--ivory-charcoal) !important;
}

/* 段落テキストの明示的な色指定 */
p,
.wp-block-paragraph {
  color: var(--ivory-text) !important;
  font-family: var(--ivory-font-family) !important;
}

/* スパ関連のセクションタイトル */
.section-title,
.page-title,
.entry-title {
  color: var(--ivory-charcoal) !important;
}

/* すべてのテキスト要素に最低限のコントラストを確保 */
*:not(.wp-block-button__link):not(.wp-element-button) {
  color: inherit;
}

/* アクセシビリティ: フォーカススタイル */
*:focus-visible {
  outline: 2px solid var(--ivory-charcoal);
  outline-offset: 2px;
}

/* スクロールバーのカスタマイズ（WebKit系ブラウザ） */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--ivory-base);
}

::-webkit-scrollbar-thumb {
  background: var(--ivory-warm-gray);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ivory-charcoal);
}

/* 選択テキストのスタイル */
::selection {
  background-color: var(--ivory-charcoal);
  color: #FFFFFF;
}

::-moz-selection {
  background-color: var(--ivory-charcoal);
  color: #FFFFFF;
}

/* ===================================
   モバイルナビゲーションメニューのカスタマイズ
   =================================== */

@media screen and (max-width: 600px) {
  /* モバイルメニューコンテナの初期状態 */
  .wp-block-navigation.is-responsive .wp-block-navigation__responsive-container {
    background-color: var(--ivory-warm-gray) !important;
    /* 親テーマと同じ: 右側130%の位置から開始 */
    transform: translateX(130%) !important;
    /* 初期状態では非表示 */
    display: block !important;
    /* トランジションを無効化（親テーマと同じ） */
    transition-timing-function: ease-in !important;
    transition: 0s !important;
  }
  
  /* モバイルメニューを開いた状態 */
  .wp-block-navigation.is-responsive .wp-block-navigation__responsive-container.is-menu-open {
    background-color: var(--ivory-warm-gray) !important;
    /* 画面内に表示 */
    visibility: visible !important;
    transform: translateX(0) !important;
    top: 0 !important;
    /* 親テーマと同じ0.7秒のトランジション */
    transition-timing-function: ease-out !important;
    transition: 0.7s !important;
  }
  
  /* has-modal-openモード用のスタイル */
  .wp-block-navigation.is-responsive.has-modal-open .wp-block-navigation__responsive-container.is-menu-open {
    background-color: var(--ivory-warm-gray) !important;
  }
  
  /* オーバーレイがある場合の対応 */
  .wp-block-navigation__responsive-container-overlay {
    /* オーバーレイは親テーマのデフォルトスタイルを使用 */
  }
  
  /* モバイルメニューのリンク色を濃い色に変更 */
  .wp-block-navigation-item a {
    color: var(--ivory-text) !important;
  }
  
  /* クローズボタンの色を濃いチャコールに変更して視認性向上 */
  .wp-block-navigation__responsive-container-close {
    color: var(--ivory-charcoal) !important;
  }
  
  .wp-block-navigation__responsive-container-close svg {
    fill: var(--ivory-charcoal) !important;
    stroke: var(--ivory-charcoal) !important;
  }
  
  /* メニューアイコン（ハンバーガー）の色も調整 */
  .wp-block-navigation__responsive-container-open {
    color: var(--ivory-charcoal) !important;
  }
  
  .wp-block-navigation__responsive-container-open svg {
    fill: var(--ivory-charcoal) !important;
  }
}

/* ===================================
   フォント統一設定
   Safari と Chrome 系ブラウザでの表示を統一
   =================================== */

/* すべての要素にフォントファミリーを適用（アイコンフォントは除外） */
*:not(.dashicons):not([class*="fa-"]):not([class*="icon-"]),
*::before:not(.dashicons):not([class*="fa-"]):not([class*="icon-"]),
*::after:not(.dashicons):not([class*="fa-"]):not([class*="icon-"]) {
  font-family: var(--ivory-font-family) !important;
}

/* 継承によるフォント適用 */
html {
  font-family: var(--ivory-font-family) !important;
}

/* WordPress ブロックエディタ内のフォント統一 */
.wp-block,
.editor-styles-wrapper {
  font-family: var(--ivory-font-family) !important;
}

/* リストのフォント統一 */
ul, ol, li {
  font-family: var(--ivory-font-family) !important;
}

/* フッターのフォント統一 */
footer,
footer * {
  font-family: var(--ivory-font-family) !important;
}

/* ヘッダーのフォント統一 */
header,
header * {
  font-family: var(--ivory-font-family) !important;
}

/* WordPress管理バーはフォント変更の対象外 */
#wpadminbar,
#wpadminbar * {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
}

/* Dashicons（WordPressアイコンフォント）の保護 */
.dashicons,
.dashicons-before:before {
  font-family: dashicons !important;
}

/* Font Awesome アイコンの保護 */
[class*="fa-"],
.fa,
.fas,
.far,
.fal,
.fab {
  font-family: "Font Awesome 5 Free", "Font Awesome 5 Brands" !important;
}

