/*--------------------------------
   カスタム検索エリア（Mobile-first）
--------------------------------*/
.c_search {
  display: flex;
  align-items: center;
  justify-content: flex-end; /* 右寄せ */
  margin: 0.5em 0.1em 0.7em 0;
  padding: 0;
}

.g_wrap {
  /* オリジナルでは 265px。必要に応じて変更 */
  width: 265px;
}

/* GCSEウィジェットの入力ボックス関連 */
.c_search .gsc-input-box {
  height: 100%;
  padding: 0;
}

.c_search * {
  box-sizing: border-box;
  margin: 0 !important;
}

.c_search .gsc-control-cse {
  background: none;
  border: none;
  padding: 0;
}

.c_search table.gsc-input {
  height: 100%;
}

.c_search td.gsc-input {
  height: 100%;
  padding-right: 0 !important;
}

.c_search .gsib_a {
  height: 100%;
  padding: 3.4px 10px;
}

.c_search input.gsc-input {
  display: block;
  font-size: 16px;
  height: 100% !important;
  -webkit-appearance: none;
  appearance: none;
}

.c_search .gsib_b,
.c_search .gsst_b {
  height: 100%;
  padding: 0;
}

.c_search .gsst_a {
  display: block;
  height: 100%;
  padding: 0;
  text-decoration: none;
}

/* 検索ボタンの設定 */
.c_search .gscb_a {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  height: 100%;
  width: 29px;
  line-height: 1;
}

.c_search td.gsc-search-button {
  height: 100%;
}

.c_search .gsc-search-button-v2 {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 0 6px 6px 0;
  margin-left: 0;
  width: 31px;
  height: 100%;
  padding: 7px;
  background: #75bc58;
}

.c_search .gsc-search-button-v2:hover {
  opacity: 0.5;
  background: #75bc58;
}

.c_search .gsc-search-button-v2:focus {
  outline: none;
  box-shadow: none;
}


/* ダークモードの入力フィールドスタイル */
html.dark-mode .c_search {
  filter: brightness(0.8) contrast(1.1); /* ダークモード時のフィルター */
}

/* ホバー時にフィルターを解除 */
html.dark-mode .c_search:hover {
  filter: none; /* フィルター解除で明るく表示 */
}

html.dark-mode .c_search .gsc-search-button-v2:hover {
  opacity: 1;
}



/* -------------------------------------------
   ダークモード時のGoogle カスタム検索オーバーレイ対応
------------------------------------------- */

html.dark-mode .gsc-modal-background-image-visible {
  background-color: rgba(0, 0, 0, 0.8) !important;
  }


/* ▼ 検索結果全体のラッパー */
html.dark-mode .gsc-results-wrapper-overlay {
  background-color: #2D2D2D !important; 
  color: #fff !important;
}


/* ▼ 実際の検索結果領域（背景・文字色） */
html.dark-mode .gsc-results-wrapper {
  background-color: #1e1e1e !important;
  color: #fff !important;
}

/* ▼ タイトルやスニペット、URLなど検索結果テキストの色上書き */

html.dark-mode .gsc-webResult .gs-snippet {
  color: #fff !important;
}


/* =======================================
   ダークモード時の「No results」メッセージ
======================================= */

html.dark-mode .gs-no-results-result .gs-snippet,
html.dark-mode .gs-error-result .gs-snippet {
  color: #333 !important;
}

/* =======================================
   ダークモード時の右上の閉じるボタン
======================================= */

html.dark-mode .gsc-selected-option-container {
  background-color: #333 !important; /* ダークモード用の背景色 */
  color: #fff !important;            /* 文字色を白に */
  border: 1px solid #666 !important;
}

html.dark-mode .gsc-option-menu-item, html.dark-mode .gsc-control-cse .gsc-option-menu{
  background-color: #333 !important; /* ダークモード用の背景色 */
  color: #fff !important;            /* ダークモード用の文字色 */
}

html.dark-mode .gsc-control-cse .gsc-option-menu{
  border: 1px solid #666 !important;
}

html.dark-mode .gsc-option-menu-item-highlighted{
  background-color: #555 !important;
  border-color: #eee !important;
}

html.dark-mode .gsc-orderby-label{
  color: #fff !important;            
}

html.dark-mode .gcsc-find-more-on-google-magnifier{
  fill: #fff !important;            
}

html.dark-mode .gcsc-find-more-on-google{
  color: #fff !important;            
}

html.dark-mode .gsc-result-info{
  color: #fff !important;            
}


html.dark-mode .gs-result .gs-title *, .gsc-cursor-page, .gs-spelling a{
  color: #00cc66 !important;
}

html.dark-mode .gs-promotion .gs-visibleUrl, .gs-webResult .gs-visibleUrl{
  color: #3399ff !important;
}

html.dark-mode .gsc-webResult.gsc-result {
  border: 1px solid #2D2D2D;
}
