/*
Theme Name: CURE Child【chat】
Template: cure_tcd082
Version: 1.0.0
*/

/* ============================================================
   Header search
   ============================================================ */

#header {
  position: relative;
}

#global_menu {
  margin-right: 30px;
}

#menu_button {
  position: absolute;
  right: 48px;
  top: 50%;
  transform: translateY(-50%);
}

#header_search_wrap {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  z-index: 1000;
}

#header_search_button {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,0.6);
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease;
  padding: 0;
  flex-shrink: 0;
}
#header_search_button:hover {
  background: rgba(255,255,255,0.15);
  border-color: #fff;
}

#header_search_button .search_icon {
  display: block;
  width: 13px;
  height: 13px;
  border: 2px solid #fff;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-60%, -60%);
}
#header_search_button .search_icon::after {
  content: "";
  width: 6px;
  height: 2px;
  background: #fff;
  position: absolute;
  right: -6px;
  bottom: -4px;
  transform: rotate(45deg);
  border-radius: 2px;
}

/* ドロップダウン：PCはゆったり、SPは画面幅に収まる幅 */
#header_search_form {
  position: absolute;
  top: calc(100% + 16px);
  right: 0;
  width: 380px;
  background: #fff;
  border: 1px solid #dce9e1;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  padding: 14px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  z-index: 99999;
}
#header_search_form.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#header_search_form form {
  display: flex;
  gap: 8px;
  margin: 0;
}
#header_search_form input[type="search"] {
  flex: 1;
  height: 44px;
  border: 1px solid #cfded5;
  border-radius: 999px;
  padding: 0 16px;
  font-size: 14px;
  color: #333;
  background: #fff;
  outline: none;
  -webkit-appearance: none;
  min-width: 0;
}
#header_search_form input[type="search"]:focus {
  border-color: #7aa38d;
}
#header_search_form button[type="submit"] {
  height: 44px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  background: #4f6f61;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
#header_search_form button[type="submit"]:hover {
  opacity: 0.88;
}

/* ============================================================
   レスポンシブ
   ============================================================ */
@media screen and (max-width: 1250px) {
  #global_menu {
    margin-right: 0;
  }
  #menu_button {
    position: static;
    transform: none;
  }
  #header_search_wrap {
    right: 56px;
  }
  /* SP：検索窓を画面右端から虫眼鏡位置に合わせてコンパクトに */
  #header_search_form {
    width: calc(100vw - 80px);
    max-width: 300px;
    right: 0;
    padding: 10px;
  }
  #header_search_form input[type="search"] {
    height: 38px;
    font-size: 13px;
    padding: 0 12px;
  }
  #header_search_form button[type="submit"] {
    height: 38px;
    padding: 0 12px;
    font-size: 13px;
  }
    /* ↓ここに追記 */
  #header_logo {
    top: 50%;  /* 数値を変えて調整 */
  }
  #header_search_wrap {
    top: 50%;  /* 数値を変えて調整 */
  }
  #menu_button {
  position: absolute;
  top: 10%;  /* 数値を小さくすると上がる、大きくすると下がる */
  right: 48px;
  }
  #header {
  height: 80px !important ;  /* 数値を大きくすると縦幅が広がる */
  }
}


/* ============================================================
   虫眼鏡の色切り替え：白背景時は黒に
   ============================================================ */

/* トップページ：スクロール後（active付与時） */
#header.active #header_search_button,
/* トップページ以外：常に白背景 */
#header:not(.animate) #header_search_button {
  border-color: rgba(0,0,0,0.25);
}

#header.active #header_search_button .search_icon,
#header:not(.animate) #header_search_button .search_icon {
  border-color: #333;
}

#header.active #header_search_button .search_icon::after,
#header:not(.animate) #header_search_button .search_icon::after {
  background: #333;
}

#header.active #header_search_button:hover,
#header:not(.animate) #header_search_button:hover {
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.4);
}

/* =========================
   Futaba Chat Widget
========================= */

#futaba-chat-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99999;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

#futaba-chat-fab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 64px;
  height: 64px;
  padding: 0 18px;
  border: none;
  border-radius: 9999px;
  background: linear-gradient(135deg, #2f8f6b 0%, #4fae8b 100%);
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#futaba-chat-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.futaba-chat-fab__icon {
  font-size: 22px;
  line-height: 1;
}

.futaba-chat-fab__label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

#futaba-chat-panel {
  position: absolute;
  right: 0;
  bottom: 78px;
  width: 380px;
  height: 620px;
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.20);
  border: 1px solid rgba(47, 143, 107, 0.12);
  display: flex;
  flex-direction: column;
}

#futaba-chat-panel.is-hidden {
  display: none;
}

.futaba-chat-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 16px 14px;
  background: linear-gradient(135deg, #2f8f6b 0%, #58b796 100%);
  color: #fff;
}

.futaba-chat-panel__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.futaba-chat-panel__subtitle {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  opacity: 0.92;
}

.futaba-chat-panel__close {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  margin-left: 12px;
}

.futaba-chat-messages {
  flex: 1;
  overflow-y: auto;
  background: #f7fbf9;
  padding: 16px;
}

.futaba-chat-message {
  display: flex;
  margin-bottom: 12px;
}

.futaba-chat-message.is-user {
  justify-content: flex-end;
}

.futaba-chat-message.is-bot {
  justify-content: flex-start;
}

.futaba-chat-bubble {
  max-width: 82%;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.futaba-chat-message.is-user .futaba-chat-bubble {
  background: #2f8f6b;
  color: #fff;
  border-bottom-right-radius: 6px;
}

.futaba-chat-message.is-bot .futaba-chat-bubble {
  background: #fff;
  color: #333;
  border: 1px solid #e3efe9;
  border-bottom-left-radius: 6px;
}

.futaba-chat-message.is-loading .futaba-chat-bubble {
  color: #678;
}

.futaba-chat-quick {
  display: flex;
  gap: 8px;
  padding: 12px 12px 0;
  background: #fff;
  overflow-x: auto;
}

.futaba-chat-quick__item {
  flex: 0 0 auto;
  border: 1px solid #cfe5db;
  background: #f8fcfa;
  color: #2f8f6b;
  border-radius: 9999px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.futaba-chat-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px;
  background: #fff;
  border-top: 1px solid #eef4f1;
}

.futaba-chat-input {
  flex: 1;
  min-height: 46px;
  max-height: 120px;
  resize: none;
  border: 1px solid #d8e7df;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  background: #fff;
  color: #333;
  outline: none;
}

.futaba-chat-input:focus {
  border-color: #58b796;
  box-shadow: 0 0 0 3px rgba(88, 183, 150, 0.12);
}

.futaba-chat-submit {
  flex: 0 0 auto;
  height: 46px;
  padding: 0 16px;
  border: none;
  border-radius: 14px;
  background: #2f8f6b;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.futaba-chat-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media screen and (max-width: 767px) {
  #futaba-chat-widget {
    right: 12px;
    bottom: 12px;
  }

  #futaba-chat-fab {
    height: 58px;
    min-width: 58px;
    padding: 0 16px;
  }

  #futaba-chat-panel {
    width: calc(100vw - 24px);
    max-width: 380px;
    height: min(72vh, 620px);
    bottom: 72px;
  }

  .futaba-chat-bubble {
    max-width: 88%;
  }
}
/* ============================================================
   ロゴ表示修正
   ============================================================ */
@media screen and (min-width: 1051px) {
  #header_logo .pc_logo_image { display:block !important; }
  #header_logo .mobile_logo_image { display:none !important; }
}

@media screen and (max-width: 1050px) {
  #header_logo .pc_logo_image { display:none !important; }
  #header_logo .mobile_logo_image { display:block !important; }
}

/* ============================================================
   トップページのロゴ opacity 修正
   ============================================================ */
body.home #header_logo {
  opacity: 1 !important;
  animation: none !important;
  -webkit-animation: none !important;
}
/* チャット内のリンクスタイル */
.futaba-chat-link {
  color: #0066cc;          /* リンクらしい青色 */
  text-decoration: underline; /* 下線を表示 */
  word-break: break-all;    /* 長いURLがはみ出さないように改行 */
  transition: opacity 0.2s;
}

/* ホバー（マウスを乗せた時）の反応 */
.futaba-chat-link:hover {
  opacity: 0.7;
  text-decoration: none;    /* ホバー時にあえて下線を消すとおしゃれです（お好みで） */
}

/* ボット側の吹き出し内のリンク色が背景で見にくい場合はここで調整 */
.is-bot .futaba-chat-link {
  color: #0044aa; 
}