/**
 * 固定ページ FAQ（/faq/）。
 *
 * Shopify 時代に //mymoods.co.jp/cdn/shop/t/34/assets/section-faq-page.css として
 * 配信されていたものを自己ホストする。移行後は CDN 側が死んでおり、素の HTML が
 * 積み上がるだけの状態になっていた。
 *
 * 原典からの差分は3点。いずれもコメントで明示している。
 *   1. SP でカラムを縦積みにする指定を取り込んだ（原典では
 *      mymoods-common-menu-container.css が別ファイルで担っていた。FAQ が使うのは
 *      この1ルールだけなので、.common-menu-content 等の未使用ルールごと持ち込まず
 *      ここへ統合した）
 *   2. .faq-search-icon の `color: red` を落とした（原典では <img> に当たっており
 *      効果がなかった。現在はインライン SVG で、線色は SVG 側が #000 を持つ）
 *   3. summary のマーカー消去・絞り込み用の [hidden]・0 件表示を追加した
 */

.faq-flex-container {
  padding-bottom: 60px;
  width: 100%;
  display: flex;
  gap: 50px;
}

/* 原典では mymoods-common-menu-container.css 側の指定。 */
@media screen and (max-width: 768px) {
  .faq-flex-container {
    flex-direction: column;
    gap: 20px;
  }
}

/* ---------------- PC サイドメニュー ---------------- */
.faq-flex-container .side-menu {
  position: sticky;
  top: 50px;
  width: var(--mymoods-side-menu-width);
  background-color: #fff;
  box-shadow: 0 3px 6px #0000004d;
  border-radius: 10px;
  padding: 60px 40px;
  margin-right: 0;
  overflow: hidden;
  height: fit-content;
  pointer-events: none;
}

@media screen and (max-width: 768px) {
  .faq-flex-container .side-menu {
    display: none;
  }
}

.faq-flex-container .side-menu .side-menu-title {
  font-family: var(--mymoods-font-poppins), sans-serif;
  font-weight: var(--mymoods-font-weight-extrabold);
  font-size: 28px;
  color: var(--mymoods-darkgray);
}

.faq-flex-container .side-menu .side-menu-category-wrapper {
  pointer-events: auto;
  margin-top: 60px;
  gap: 16px;
}

.faq-flex-container .side-menu .side-menu-category-wrapper .side-menu-category {
  font-size: 16px;
  margin-bottom: 16px;
  color: #000;
}

.faq-flex-container .side-menu .side-menu-category-wrapper .side-menu-category .link {
  font-size: 16px;
  color: #000;
  text-decoration: none;
}

/* ---------------- 本体 ---------------- */
.faq-flex-container .faq-content {
  flex: 1;
}

.faq-flex-container .faq-content .faq-content-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 24px;
}

.faq-flex-container .faq-content .faq-content-top .faq-content-top__text {
  flex: 1;
  min-width: 400px;
}

@media screen and (max-width: 768px) {
  .faq-flex-container .faq-content .faq-content-top .faq-content-top__text {
    min-width: unset;
    width: 100%;
  }
}

.faq-flex-container .faq-content .faq-title {
  font-family: var(--mymoods-font-poppins), sans-serif;
  font-weight: var(--mymoods-font-weight-extrabold);
  font-size: 32px;
  color: var(--mymoods-blue);
  margin-bottom: 12px;
}

.faq-flex-container .faq-content .faq-description {
  font-size: 16px;
}

@media screen and (max-width: 768px) {
  .faq-flex-container .faq-content .faq-description {
    font-size: 14px;
  }
}

/* ---------------- 検索 ---------------- */
.faq-flex-container .faq-content .faq-search {
  align-self: flex-end;
  min-width: 400px;
  margin-left: auto;
}

@media screen and (max-width: 768px) {
  .faq-flex-container .faq-content .faq-search {
    min-width: unset;
    width: 100%;
  }
}

.faq-flex-container .faq-content .faq-search .faq-search-input-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 10px;
  height: 60px;
  padding-inline: 20px;
  background-color: #fff;
}

.faq-flex-container .faq-content .faq-search .faq-search-input-label .faq-search-input {
  font-size: 14px;
  border: none;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  width: 100%;
  height: 100%;
  font-family: var(--mymoods-font-poppins), sans-serif;
  font-weight: var(--mymoods-font-weight-extrabold);
  padding: 0;
  margin: 0;
  box-shadow: none;
}

.faq-flex-container .faq-content .faq-search .faq-search-input-label .faq-search-input::placeholder {
  color: var(--mymoods-placeholder-gray);
}

/* 原典は <img> 参照だったため CDN 消滅で虫食いになっていた。インライン SVG に
   置き換えたので、潰れないよう縮小だけ止める。 */
.faq-flex-container .faq-content .faq-search .faq-search-input-label .faq-search-icon {
  flex: none;
}

/* ---------------- SP メニュー ---------------- */
.faq-flex-container .faq-content .faq-sp-menu {
  display: none;
}

@media screen and (max-width: 768px) {
  .faq-flex-container .faq-content .faq-sp-menu {
    display: block;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 3px 6px #0000004d;
    border-radius: 10px;
    padding: 0 20px;
  }
}

.faq-flex-container .faq-content .faq-sp-menu .faq-sp-menu-title {
  font-family: var(--mymoods-font-poppins), sans-serif;
  font-weight: var(--mymoods-font-weight-extrabold);
  color: var(--mymoods-darkgray);
  padding: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 18px;
}

.faq-flex-container .faq-content .faq-sp-menu .faq-sp-menu-title .icon.icon-caret {
  position: relative;
  top: 0;
  right: 0;
  width: 18px;
  height: 10px;
  display: block;
}

.faq-flex-container .faq-content .faq-sp-menu .faq-sp-menu-category-wrapper {
  pointer-events: auto;
  gap: 16px;
}

.faq-flex-container .faq-content .faq-sp-menu .faq-sp-menu-category-wrapper .faq-sp-menu-category {
  font-size: 16px;
  margin-bottom: 16px;
  color: #000;
}

.faq-flex-container .faq-content .faq-sp-menu .faq-sp-menu-category-wrapper .faq-sp-menu-category .link {
  font-size: 16px;
  color: #000;
  text-decoration: none;
}

/* ---------------- カテゴリ見出し・各項目 ---------------- */
/* 追従ヘッダーにアンカー先が潜り込まないよう、負マージン + padding でオフセットを作る。 */
.faq-flex-container .faq-content .faq-category {
  font-size: 24px;
  margin: -170px 0 24px;
  padding-top: 200px;
}

@media screen and (max-width: 768px) {
  .faq-flex-container .faq-content .faq-category {
    font-size: 18px;
  }
}

.faq-flex-container .faq-content .faq-item {
  padding: 24px 40px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 3px 6px #0000004d;
  margin-bottom: 20px;
}

@media screen and (max-width: 768px) {
  .faq-flex-container .faq-content .faq-item {
    padding: 0 20px;
  }
}

.faq-flex-container .faq-content .faq-item .question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* summary 既定の三角マーカーを消す（意匠側は .angle-down の caret を使う）。 */
  cursor: pointer;
  list-style: none;
}

.faq-flex-container .faq-content .faq-item .question::-webkit-details-marker {
  display: none;
}

@media screen and (max-width: 768px) {
  .faq-flex-container .faq-content .faq-item .question {
    height: 60px;
  }
}

.faq-flex-container .faq-content .faq-item .question .question-text {
  font-size: 18px;
  margin: 0;
}

@media screen and (max-width: 768px) {
  .faq-flex-container .faq-content .faq-item .question .question-text {
    font-size: 14px;
  }
}

.faq-flex-container .faq-content .faq-item .question .angle-down {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

@media screen and (max-width: 768px) {
  .faq-flex-container .faq-content .faq-item .question .angle-down {
    width: 16px;
  }
}

.faq-flex-container .faq-content .faq-item .question .angle-down .caret-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  right: 0;
  top: 0;
}

.faq-flex-container .faq-content .faq-item[open] .question .angle-down {
  transform: rotate(180deg);
}

.faq-flex-container .faq-content .faq-item .answer {
  font-size: 16px;
  color: #666;
}

@media screen and (max-width: 768px) {
  .faq-flex-container .faq-content .faq-item .answer {
    font-size: 14px;
    padding-bottom: 16px;
  }
}

/* ---------------- 絞り込み（原典に無い追加分） ---------------- */
/* Shopify 由来の base CSS が details/h2 に display を当てているため、
   [hidden] を効かせるには明示が要る。 */
.faq-flex-container .faq-content .faq-category[hidden],
.faq-flex-container .faq-content .faq-item[hidden] {
  display: none;
}

.faq-flex-container .faq-content .faq-empty {
  font-size: 16px;
  color: #666;
  padding: 24px 0;
}

.faq-flex-container .faq-content .faq-empty[hidden] {
  display: none;
}
