/* ===============================
   共通ヘッダー（PC基準・簡素版）
   - 横幅: 100%
   - 高さ: min-height で調整（--header-h）
   - ロゴ: 上下2段の中央揃え（縦横センター）
   - ナビ: 右寄せ + 右端から60pxスペース（横一列固定）
================================ */
:root {
  --brand-green: #009246; /* イタリア国旗 緑 */
  --brand-red:   #CE2B37; /* イタリア国旗 赤 */
  --ink: #333;
  --border: #DDD;
}

/* --------------------------------
   ヘッダー本体
-------------------------------- */
.siteHeader {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  width: 100%;
}

/* 高さ・中央揃え */
.headerInner {
  min-height: var(--header-h, 80px);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  align-content: center;
  row-gap: 0;
}

/* --------------------------------
   ロゴ（上下2段を中央揃え）
-------------------------------- */
.siteLogo {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  align-self: center;
  text-decoration: none; /* ← リンク下線を消す（黒い線防止） */
  line-height: 1.2;
  text-align: center;
  font-family: 'Raleway', 'Kosugi Maru', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin-left: 60px;
}
.siteLogo{
  display: inline-flex;      /* ← inline化でクリック当たりを箱に */
  flex-direction: column;    /* ★ 縦積みに戻す（これが抜けると横並び） */
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1000;
  isolation: isolate;
  padding: 6px 10px;
  text-decoration: none;
  margin-left: 60px;
}
.siteLogo::before{
  content:"";
  position:absolute;
  inset:0;                   /* クリック当たりを a 全体に */
}
/* 上段：ItalyTrip（アズーリ下線を追加） */
.logoLine1 {
  display: block;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--ink);
  margin: 0;
  text-decoration: underline;       /* ← 下線を追加 */
  text-decoration-color: #0097c0;   /* ← アズーリカラー */
  text-underline-offset: 2px;       /* ← 下線と文字の距離 */
}

/* カラー指定（変えずに維持） */
.logoItaly { color: var(--brand-green); }
.logoTrip  { color: var(--brand-red); }

/* 下段：イタリップ（下線はナシ） */
.logoLine2 {
  display: block;
  font-size: 13px;
  color: #555;
  margin-top: 2px;
  text-decoration: none;            /* ← 念のため明示で下線ナシ */
}

/* --------------------------------
   ナビゲーション
-------------------------------- */
.gnav {
  justify-self: end;
  padding-right: 60px;
  width: 100%;
  display: flex;
  justify-content: flex-end;
}

.gnavList {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.gnavLink {
  display: inline-block;
  white-space: nowrap;
  text-decoration: none;
  color: #222;
  font-size: 16px;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: border-color .2s ease, color .2s ease;
}

.gnavLink:hover {
  border-bottom-color: var(--ink);
}

.gnavLink.is-active {
  color: var(--ink);
  border-bottom-color: var(--brand-green);
}

/* --------------------------------
   区切り線
-------------------------------- */
.headerDivider {
  height: 1px;
  background: var(--border);
}

/* --------------------------------
   虫眼鏡アイコン
-------------------------------- */
.gnavLink img[src*="/images/header/lupeLogo.png"] {
  width: 16px;
  height: 16px;
  margin-top: 8px;
}

/* 下線なし（虫眼鏡専用） */
.gnav .gnavList .gnavItem > .gnavLink[aria-label="サイト内検索を開く"],
.gnav .gnavList .gnavItem > .gnavLink[aria-label="サイト内検索を開く"]:hover,
.gnav .gnavList .gnavItem > .gnavLink[aria-label="サイト内検索を開く"]:focus,
.gnav .gnavList .gnavItem > .gnavLink[aria-label="サイト内検索を開く"]:active {
  text-decoration: none;
  border-bottom: none;
  box-shadow: none;
}

/* ===============================
   検索モーダル（最終整理版）
================================ */
.searchModal {
  position: fixed;
  inset: 0;
  display: none;                /* ← 初期は非表示 */
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.5);  /* 背景の暗幕 */
  z-index: 9999;
  flex-direction: column;
}
.searchOverlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}
.searchModal.is-open {
  display: flex;
}

/* ダイアログ本体 */
.searchDialog {
  position: relative;
  z-index: 1001;
  background: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  padding: 20px 24px;
  width: 600px;
  max-width: 90%;
  margin-bottom: 12px;
}

/* 検索フォーム */
.searchForm {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  height: 46px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.searchForm:focus-within {
  border: 1px solid #009246;
  box-shadow: 0 0 0 2px rgba(0,146,70,0.2);
  border-radius: 3px; /* ←角を整えるときれい */
}



/* 入力フィールド */
.searchField {
  flex: 1;
  height: 46px;
  border: 1px solid #cfd4db;
  border-radius: 3px 0 0 3px;
  padding: 0 12px;
  font-size: 16px;
  outline: none;
}

.searchSubmit:hover {
  background: #0097c0; /* イタリア国旗の赤 */
  box-shadow: 0 0 0 2px rgba(206,43,55,0.2); /* 赤っぽい光 */
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.searchSubmit:hover img {
  filter: brightness(0) invert(1); /* アイコンを白反転で浮かせる */
}


.searchField:focus {
  border-color: #009246;
  box-shadow: 0 0 0 2px rgba(0,146,70,0.2);
}
/* 検索ボタン（イタリア国旗カラー） */
.searchSubmit {
  width: 48px;
  height: 46px;
  border: none;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, #009246 0%, #ffffff 50%, #CE2B37 100%);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.2s ease;
}
.searchSubmit:hover {
  opacity: 0.85;
}
.searchSubmit img {
  width: 26px;
  height: 26px;
  filter: contrast(150%);
}

/* 閉じるボタン（アイコン＋テキスト） */
.searchClose {
  position: relative;
  z-index: 1001;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 16px auto 0;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.15s ease;
}
.searchClose:hover {
  color: #CE2B37;
  transform: scale(1.05);
}
.searchClose img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
}
/* ===============================
   SP（縦積み）
================================ */
@media (max-width: 768px) {
  .headerInner {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 8px 16px;
    min-height: var(--header-h-sp, 72px);
  }

  .siteLogo {
    margin-left: 0;
  }

  .gnav {
    justify-self: center;
    padding-right: 0;
    width: auto;
  }

  .gnavList {
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .logoLine1 {
    font-size: 20px;
  }

  .logoLine2 {
    font-size: 10px;
  }

  .gnavLink {
    font-size: 10px;
  }

  .gnavLink img[src*="/images/header/lupeLogo.png"] {
    width: 12px;
    height: 12px;
    margin-bottom: 3px;
  }
}
