/*
 * ヘッダー専用CSS (モバイルファースト対応版)
 * こえのわプロジェクト
 */

/* ===========================================
   ヘッダー全体（ベース：スマホ表示）
   =========================================== */
.site-header {
    width: 100%;
    background-color: transparent;
    box-shadow: none;
    z-index: 1000;
}

.header-container {
    display: flex;
    flex-direction: column; /* モバイルは縦並び（ロゴの下にコピー） */
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0 auto;
    padding: 20px 4vw 0; /* スマホ用の左右padding */
    width: 100%;
/*     max-width: 1200px; */
}
body.home .header-container {
	display: flex;
	flex-direction: column; /* モバイルは縦並びに統一 */
	align-items: center;    /* ロゴ・コピーを中央寄せ */
	justify-content: center;
	position: relative;
	margin: 0 auto;
	padding: 30px 15px 0; /* スマホ用の左右padding */
	width: 100%;
	max-width: 1000px;
	aspect-ratio: 50/7.4;
}

/* ===========================================
   ロゴエリア（ベース：スマホ表示）
   =========================================== */
.site-branding {
    padding-right: 1em;
    width: 62%;
    max-width: 320px;
}

body.home .site-branding {
    max-width: 390px;
}

.site-logo {
    display: flex;
    align-items: center;
    line-height: 0;
}

.site-logo img {
    display: block;
    width: 100%;
    height: auto;
    transition: none;
}
.site-title {
    margin: 0;
    font-size: 1.8rem;
    font-weight: bold;
    line-height: 1.2;
}

.site-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-title a:hover {
    color: #555;
}

/* サイトタイトル・説明文を非表示（ロゴのみ表示） */
.site-title,
.site-description {
    display: none;
}

/* サイトコピー（モバイルはロゴ下の横書き） */
.site-copy {
    order: 2; /* ロゴの下に配置 */
    margin: 1em 0 0;
    color: #333;
    font-size: 1.2rem;
    font-weight: 500;
    font-family: var(--noto-heading-font);
    line-height: 1;
}

/* ロゴがない場合のみサイトタイトルを表示 */
.site-branding:not(:has(.site-logo)) .site-title {
    display: block;
}

/* ===========================================
   ナビゲーションメニューパネル
   =========================================== */
.main-navigation { /* use CSS var so PHP can set via inline style on body */
	display: flex;
	align-items: center;
	justify-content: center;
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background-color: var(--page-bg, #c9f5e7); /* default fallback */
	backdrop-filter: blur(10px);
	/* フェード表示（開くときは遅延なし） */
	opacity: 0;
	transition: opacity .12s ease 0s;
	overflow-y: auto;
	visibility: hidden;
	z-index: 2000;
}

.main-navigation.toggled {
    /* 閉じるときは背景フェードを少し遅らせる */
    opacity: 1;
    transition: opacity .12s ease .04s;
    visibility: visible;
}

.nav-menu-inner {
    padding: 20px;
    width: 100%;
    max-width: 600px;
    text-align: center;
    /* 中身：閉じる時は即時（transitionなし） */
    opacity: 0;
    /* ロゴは動かさないため、ここでは横移動させない */
    transition: none;
}

.main-navigation.toggled .nav-menu-inner {
    opacity: 1;
    /* 開く時のみフェードイン */
    transition: opacity .16s ease .08s;
}

/* メニュー本体とSNSのみ左30px→0でスライド */
.nav-menu,
.mobile-sns-links {
    transform: translateX(-30px);
    transition: none;
}

.main-navigation.toggled .nav-menu,
.main-navigation.toggled .mobile-sns-links {
    transform: translateX(0);
    transition: transform .28s ease .08s;
}

.menu-header-logo { margin-bottom: .5rem;}

.menu-header-logo .custom-logo {
    width: 70%;
    max-width: 400px;
    height: auto;
}

.close-menu-button {
    position: fixed;
    top: 20px;
    right: 15px; /* スマホ用に調整 */
    padding: 10px;
    color: #333;
    line-height: 1;
    text-align: center;
    background: none;
    border: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
    z-index: 2002;
}

.close-menu-button span {
    display: block;
    transition: color 0.25s;
}

.close-menu-button:hover span {
    color: var(--koenowa-primary);
}

.close-menu-text-en {
    margin-bottom: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.close-menu-text-ja {
    font-size: 0.8rem;
    font-weight: 400;
}


.main-navigation.toggled .close-menu-button {
    opacity: 1;
}

/* モバイルで閉じるボタンとUIが重ならないよう、ナビ中身に上マージンを確保 */
.main-navigation.toggled .nav-menu-inner { margin-top: 0; }

/* モバイル時はパネル全体を上寄せ + セーフエリア対応 */
@media (max-width: 768px) {
  .main-navigation { align-items: flex-start; padding-top: calc(3em + env(safe-area-inset-top, 0px)); }
  .main-navigation .nav-menu-inner { margin-top: 0; }
}

/* 画面高が低い端末向けに縦のギャップと検索余白を詰める */
@media (max-height: 700px) and (max-width: 768px) {
  .nav-menu ul { gap: 1.6rem; }
  .mobile-search { margin: .8rem 0 2rem; }
}

.nav-menu ul {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    margin: 0;
    padding: 1.5em 0 0.3em;
    list-style: none;
}
.nav-menu li { border-bottom: none;}

.nav-menu a {
    position: relative;
    padding: 8px 15px; /* スマホ用のpadding */
    color: #333;
    font-size: 2.25rem; /* スマホ用のフォントサイズ */
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: color 0.25s;
}

/* 英語ラベルのスタイル */
.nav-menu a::after {
    display: block;
    content: attr(data-en);
    margin-top: .45em;
    margin-bottom: 0.5rem;
    color: #888;
    font-size: 1.15rem;
    font-weight: 500;
    font-family: var(--noto-heading-font);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    transition: color 0.25s;
}

.nav-menu a:hover,
.nav-menu a:hover::after {
    color: var(--koenowa-primary);
}

/* ドロップダウンメニューは全画面表示では不要なため非表示に */
.nav-menu ul ul {
    display: none;
}

/* ===========================================
   ハンバーガーメニューボタン
   =========================================== */
.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: auto;                 /* モバイルは右下配置 */
    right: 5vmin;
    bottom: 5vmin;
    gap: 6px;
    padding: 8px 0;            /* 円内の上下余白 */
    width: 85px;              /* 円の直径（大きめ） */
    height: 85px;
		min-width: auto;
    border: none;
    border-radius: 50%;        /* 丸背景 */
    background: var(--page-bg, #fff); /* ページ背景色に同期 */
    box-shadow: 0px 0px 4px rgba(0,0,0,0.1);
/*     transition: all 0.1s ease; */
    transition: opacity 0.3s ease, box-shadow .2s ease;
    cursor: pointer;
    z-index: 2003;             /* ナビパネルより上に配置 */
}

/* ナビ表示時もメニューボタンは常に表示・操作可 */
.main-navigation.toggled ~ #page .menu-toggle {
    opacity: 1;
    pointer-events: auto;
}

.menu-toggle:hover { box-shadow: none; }
.menu-text {
    display: block;
    margin: 0;                 
    color: #333;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: lowercase;
    transition: color .3s ease; /* 追加: テキストのトランジション */
}

.menu-icon-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 37px;               /* アイコン自体の幅 */
    height: 30px;
    background: none;          /* 背景は.menu-toggleに集約 */
    border-radius: 0;
    box-shadow: none;
}

.menu-icon {
    position: relative;
    width: 37px;               /* 背景内で中央 */
    height: 1px;
    background-color: #333;
    transition: background-color .3s ease, transform .3s ease; /* 変更: transformも追加 */
}

.menu-icon::before,
.menu-icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #333;
    transition: background-color .25s ease, transform .25s ease; /* 変更: transformも追加 */
}

.menu-icon::before { top: -9px; }
.menu-icon::after  { bottom: -9px; }

/* ホバー時：テキストと3本線を白に */
/* .menu-toggle:hover .menu-text { color: #fff; } 
.menu-toggle:hover .menu-icon,
.menu-toggle:hover .menu-icon::before,
.menu-toggle:hover .menu-icon::after { background-color: #fff; }*/

/* 開いた状態：3本線をXに変形 */
.main-navigation.toggled ~ #page .menu-icon {
    background-color: transparent; /* 中央線を消す */
}
.main-navigation.toggled ~ #page .menu-icon::before {
    top: 0;                       /* 中央へ */
    transform: rotate(45deg);
}
.main-navigation.toggled ~ #page .menu-icon::after {
    bottom: auto;                 /* bottom指定を解除して */
    top: 0;                       /* 中央へ */
    transform: rotate(-45deg);
}
/* ラベルは完全に非表示にし、隙間をなくす */
.main-navigation.toggled ~ #page .menu-text { display: none; }
.main-navigation.toggled ~ #page .menu-toggle { gap: 0; }

.toggled .menu-icon {
    opacity: 1;
}

/* ===========================================
   モバイル用SNSリンク
   =========================================== */
.mobile-sns-links {
    display: flex;
    justify-content: center;
    gap: 10px; /* スマホ用にgapを調整 */
}

.mobile-sns-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.mobile-sns-links a:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.mobile-sns-links .sns-x { color: var(--koenowa-dark-gray); }
.mobile-sns-links .sns-x:hover { background-color: var(--koenowa-dark-gray); color: #fff; border-color: var(--koenowa-dark-gray); }
.mobile-sns-links .sns-instagram { color: var(--koenowa-dark-gray); }
.mobile-sns-links .sns-instagram:hover { background-color: #e4405f; color: #fff; border-color: #e4405f; }
.mobile-sns-links .sns-facebook { color: var(--koenowa-dark-gray); }
.mobile-sns-links .sns-facebook:hover { background-color: #1877F2; color: #fff; border-color: #1877F2; }

/* 検索フォーム（メニュー内） */
.mobile-search {
	display: flex;
	justify-content: center;
	margin: 1.2rem auto 3.5rem;
	padding: 0 1rem;
}
/* サイドバーと統一した見た目（ピル型＋虫眼鏡アイコン） */
.mobile-search form.search-form {
	position: relative;
	display: block;
	width: 80%;
	max-width: 300px;
}
.mobile-search .search-field {
    box-sizing: border-box;           /* ボックス */
    padding: .6rem 3.2rem .6rem 1.2rem; /* 右にアイコン分の余白 */
    width: 100%;                      /* ボックス */
    height: 3.6rem;                   /* ボックス */
    color: #555;                      /* タイポ */
    font-size: 1.45rem;               /* タイポ */
    line-height: 1.6;                 /* タイポ */
    border: 1px solid #333;           /* 装飾 */
    border-radius: 999px;             /* 装飾 */
    background: none;                 /* 背景 */
    -webkit-appearance: none;         /* その他 */
            appearance: none;         /* その他 */
    transition: all .25s ease;        /* その他 */
    box-shadow: inset 0 0 0 1px rgba(51,51,51,.85) !important; /* その他 */
}
.mobile-search .search-field::placeholder { color: #777; font-size: 1.35rem; font-weight: 500; }
.mobile-search .search-field::-webkit-search-decoration { -webkit-appearance: none; }

.mobile-search .search-submit {
    position: absolute;               /* レイアウト */
    right: .35rem;                    /* レイアウト */
    top: 50%;                         /* レイアウト */
    transform: translateY(-50%);      /* アニメーション・その他 */
    width: 2.4rem;                    /* ボックス */
    height: 2.4rem;                   /* ボックス */
    cursor: pointer;                  /* その他 */
    background: transparent url("../images/icon-search.svg") center / 1.65rem no-repeat; /* 背景 */
    border: 0 !important;             /* 装飾 */
    transition: background-color .2s ease, border-color .2s ease, color .2s ease; /* その他 */
    text-indent: -9999px;             /* その他 */
    opacity: .6;                      /* その他 */
}
.mobile-search .search-submit:hover { opacity: 1; }

.mobile-search .search-form:focus-within .search-field { box-shadow: inset 0 0 0 1px rgba(51,51,51,.85) !important; background-color: #fff; outline: none; }

/* ブラウザのネイティブ検証ポップアップのトーンを弱める（対応ブラウザのみ） */
input:invalid,
input:required:invalid {
  --koe-tooltip-bg: #d9c0fd;
  --koe-tooltip-fg: #000;
}
/* Chromeなどのツールチップ（絵文字のような強い紫を緩和） -> 疑似要素は提供されないため、色変換はできる範囲に限定 */
/* フィールド内メッセージ用（edge cases） */
::-webkit-validation-bubble-message {
  background-color: var(--koe-tooltip-bg) !important;
  color: var(--koe-tooltip-fg) !important;
}

/* 共通: カスタムエラーチップ */
.search-form { position: relative; }
.koe-error-tip {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  padding: 8px 12px;
  border-radius: 8px;
  background: #d9c0fd;
  color: #000;
  font-size: 0.9rem;
  line-height: 1.3;
  box-shadow: 0 8px 22px rgba(0,0,0,0.12);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 10;
}
.koe-error-tip.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.search-form .search-submit.is-disabled { opacity: .6; }

/* ===========================================
   デフォルトメニュー
   =========================================== */
.default-menu {
    display: none; /* スマホではハンバーガーがあるので非表示 */
}

/* 別のクローズボタンは非表示（メニューボタンを兼用） */
.close-menu-button { display: none; }

@media (min-width: 480px) {
/* ===========================================
   ロゴエリア（ベース：スマホ表示）
   =========================================== */
	 .site-branding { padding-right: 0;}
	 body.home .site-branding { padding-right: 0;}
}




/* 950px以上でページの2カラムに収まるようヘッダー幅も調整 */
@media (min-width: 950px) {

/* PCではメニュー内検索を非表示（サイドバーに一本化） */
  .mobile-search { display: none; }

/* ===========================================
   ヘッダー全体（ベース：スマホ表示）
   =========================================== */
.header-container {
    display: flex;
    flex-direction: row; /* PCは横並び */
    align-items:flex-end;
    justify-content: flex-start;
    position: relative;
    margin: 0 auto;
    padding: 60px 60px 0; /* コンテンツと同じ左右padding */
    width: 100%;
    max-width: 1200px; /* .container に合わせる */
}
.site-branding {
	width: 20.1vw;
	min-width: 180px;
	max-width: 220px;
}
.menu-toggle {
	top: 38px;/* PCは右上に戻す */
	right: 40px;
	bottom: auto;
	box-shadow: none;
}
.close-menu-button { display: none;}

    .mobile-sns-links {
        gap: 30px; /* PC用にgapを戻す */
    }

    .default-menu {
        display: flex; /* PCでは表示 */
        gap: 30px;
        margin: 0;
        padding: 0;
        list-style: none;
    }
    
    .default-menu a {
        padding: 15px 0;
        color: var(--koenowa-dark-gray);
        font-weight: 500;
        text-decoration: none;
        transition: color 0.3s ease;
    }
    
    .default-menu a:hover {
        color: var(--koenowa-primary);
    }

/* PC/タブレット: 左端に縦書き固定 */
.site-copy {
	position: fixed;
	top: 70px;
	left: clamp(1.5rem, 2.1vw, 3vw);
	margin: 0;
	padding: 0;
	color: #333;
	font-size: clamp(1.05rem, 1.1vw, 1.25rem);
	font-weight: 500;
	line-height: 1.6;
	writing-mode: vertical-rl;
	text-orientation: mixed;
	letter-spacing: 0.1em;
	z-index: 1001;
}
}

@media (hover: hover) and (pointer: fine) {
/* ===========================================
   ハンバーガー：ホバー演出（枠・影の強調 + 線のスライド）
   =========================================== */
	.menu-toggle:hover {
		background: #fff;
	  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
	  border: none;
	}
	
	.menu-toggle:hover .menu-icon::before {
	    transform: translateY(-2px);
	}
	.menu-toggle:hover .menu-icon::after {
	    transform: translateY(2px);
	}
}

