/* ==========================================================================
   導入事例 検索（c-caseSearch）
   導入事例一覧（archive-casestudies.php）でのみ読み込み
   ========================================================================== */
.c-caseSearch {
  background: rgba(var(--background-accent-rgb), 0.6);
  border: 0.1rem solid rgba(var(--color-base-rgb), 0.2);
  display: grid;
  margin-bottom: 3.2rem;
  padding: 1.6rem;
  row-gap: 1.6rem;
}
.c-caseSearch__fields {
  display: grid;
  gap: 1.2rem 1.6rem;
}
.c-caseSearch__field {
  border: 0;
  display: grid;
  min-width: 0;
  row-gap: 0.8rem;
}
/* 項目間の区切り（検索結果との区切り＝実線と区別するため点線） */
.c-caseSearch__field + .c-caseSearch__field {
  border-top: 0.1rem dashed rgba(var(--color-base-rgb), 0.2);
  padding-top: 1.2rem;
}
.c-caseSearch__label {
  align-items: center;
  display: flex;
  font-size: 1.3rem;
  gap: 0.8rem;
  line-height: 1;
}
.c-caseSearch__label::after {
  background: linear-gradient(133.26deg, #E7336E 1.42%, #EB6153 43.37%, #F9C158 85.31%);
  border-radius: 50%;
  content: "";
  display: inline-block;
  height: 0.6rem;
  opacity: 0;
  transition: opacity var(--transition);
  width: 0.6rem;
}
.c-caseSearch__field.is-active .c-caseSearch__label::after {
  opacity: 1;
}

/* チェックボックス */
.c-caseSearch__checkList {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.c-caseSearch__check {
  position: relative;
}
.c-caseSearch__checkInput {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  height: 100%;
  inset: 0;
  margin: 0;
  opacity: 0;
  position: absolute;
  width: 100%;
}
.c-caseSearch__checkLabel {
  align-items: center;
  background: var(--background-base);
  border: 0.1rem solid rgba(var(--color-base-rgb), 0.2);
  display: inline-flex;
  font-size: 1.4rem;
  gap: 0.8rem;
  line-height: 1.2;
  padding: 0.9rem 1.2rem;
  pointer-events: none;
  position: relative;
  transition: border-color var(--transition), opacity var(--transition);
}
/* チェック枠 */
.c-caseSearch__checkLabel::before {
  border: 0.1rem solid var(--color-sub);
  border-radius: 0.2rem;
  content: "";
  flex-shrink: 0;
  height: 1.4rem;
  transition: background var(--transition), border-color var(--transition);
  width: 1.4rem;
}
/* チェックマーク */
.c-caseSearch__checkLabel::after {
  border-bottom: 0.2rem solid var(--color-base);
  border-right: 0.2rem solid var(--color-base);
  content: "";
  height: 0.8rem;
  left: 1.7rem;
  opacity: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-65%) rotate(45deg);
  width: 0.45rem;
}
.c-caseSearch__checkCount {
  color: var(--color-sub);
  font-family: var(--fontFamily-accent);
  font-size: 1.2rem;
  font-weight: 400;
}
.c-caseSearch__checkInput:hover + .c-caseSearch__checkLabel {
  border-color: rgba(var(--color-base-rgb), 0.5);
}
.c-caseSearch__checkInput:focus {
  outline: none;
}
.c-caseSearch__checkInput:focus-visible + .c-caseSearch__checkLabel {
  border-color: var(--color-base);
}
/* 選択中：グラデーションボーダー */
.c-caseSearch__checkInput:checked + .c-caseSearch__checkLabel {
  background:
    linear-gradient(var(--background-base), var(--background-base)) padding-box,
    linear-gradient(133.26deg, #E7336E 1.42%, #EB6153 43.37%, #F9C158 85.31%) border-box;
  border-color: transparent;
  font-weight: 700;
}
.c-caseSearch__checkInput:checked + .c-caseSearch__checkLabel::before {
  background: linear-gradient(133.26deg, #E7336E 1.42%, #EB6153 43.37%, #F9C158 85.31%);
  border-color: transparent;
}
.c-caseSearch__checkInput:checked + .c-caseSearch__checkLabel::after {
  opacity: 1;
}
/* 0件で選択不可 */
.c-caseSearch__checkInput:disabled {
  cursor: not-allowed;
}
.c-caseSearch__checkInput:disabled + .c-caseSearch__checkLabel {
  opacity: 0.35;
}

.c-caseSearch__submit {
  background: linear-gradient(0deg, rgba(51, 51, 51, 0.2), rgba(51, 51, 51, 0.2)), linear-gradient(133.26deg, #E7336E 1.42%, #EB6153 43.37%, #F9C158 85.31%);
  border: 0;
  color: var(--color-base);
  font-size: 1.6rem;
  font-weight: 700;
  justify-self: start;
  padding: 0.8rem 3.2rem;
}
/* JS有効時は即時検索なので検索ボタン不要 */
.c-caseSearch.is-js .c-caseSearch__submit {
  display: none;
}

/* 検索状態 */
.c-caseSearch__status {
  align-items: center;
  border-top: 0.1rem solid rgba(var(--color-base-rgb), 0.2);
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.6rem;
  padding-top: 1.2rem;
}
.c-caseSearch__result {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  font-size: 1.4rem;
  gap: 0 0.4rem;
  line-height: 1.4;
  min-height: 3rem; /* 条件タグと同じ高さにして未検索時と検索時で縦位置を揃える */
}
.c-caseSearch__resultNum {
  font-family: var(--fontFamily-accent);
  font-size: 2.2rem;
  font-weight: 500;
  line-height: 1;
}
.c-caseSearch__resultTotal {
  color: var(--color-sub);
  font-size: 1.2rem;
}
.c-caseSearch__conditionList {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.c-caseSearch__condition {
  align-items: center;
  background:
    linear-gradient(rgba(var(--background-accent-rgb), 1), rgba(var(--background-accent-rgb), 1)) padding-box,
    linear-gradient(133.26deg, #E7336E 1.42%, #EB6153 43.37%, #F9C158 85.31%) border-box;
  border: 0.1rem solid transparent;
  display: inline-flex;
  font-size: 1.3rem;
  gap: 0.6rem;
  height: 3rem;
  line-height: 1;
  padding: 0 0.2rem 0 1rem;
}
.c-caseSearch__conditionKey {
  color: var(--color-sub);
  font-size: 1.2rem;
}
.c-caseSearch__conditionValue {
  font-weight: 700;
}
.c-caseSearch__conditionRemove {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--color-sub);
  display: inline-flex;
  font-size: 1.8rem;
  justify-content: center;
  padding: 0.2rem;
  transition: color var(--transition);
}
.c-caseSearch__conditionRemove:hover {
  color: var(--color-base);
}
.c-caseSearch__reset {
  background: transparent;
  border: 0;
  color: var(--color-sub);
  font-size: 1.3rem;
  margin-left: auto;
  text-decoration: underline;
  text-underline-offset: 0.3em;
  transition: color var(--transition);
}
.c-caseSearch__reset:hover {
  color: var(--color-base);
}
.c-caseSearch__reset[hidden] {
  display: none;
}

/* 該当なし */
.c-caseSearch__empty {
  border: 0.1rem solid rgba(var(--color-base-rgb), 0.2);
  display: grid;
  justify-items: center;
  padding: 6.4rem 2.4rem;
  row-gap: 2.4rem;
  text-align: center;
}
.c-caseSearch__empty[hidden] {
  display: none;
}
.c-caseSearch__emptyText {
  font-size: 1.6rem;
  line-height: var(--lineHeight-loose);
}
.c-caseSearch__emptyText small {
  color: var(--color-sub);
  display: block;
  font-size: 1.4rem;
}
.c-caseSearch__emptyButton {
  border: 0;
  min-width: 24rem;
}

/* カード内：検索条件に一致したタグ・業種を強調 */
.c-cardItem__tagItem.is-match {
  color: var(--color-accent);
  font-weight: 700;
}
.c-cardList.is-industryActive .c-cardItem__category {
  border-color: var(--color-accent);
}
.c-cardList__item[hidden] {
  display: none;
}
@media (prefers-reduced-motion: no-preference) {
  .c-cardList__item.is-enter {
    opacity: 0;
    translate: 0 2.4rem;
  }
  .c-cardList__item.is-entered {
    transition: opacity var(--transition), translate var(--transition);
  }
}

@media screen and (min-width: 768px) {
  .c-caseSearch {
    padding: 2rem 2.4rem;
  }
  .c-caseSearch__field {
    align-items: start;
    column-gap: 2.4rem;
    grid-template-columns: 10rem minmax(0, 1fr);
  }
  .c-caseSearch__label {
    min-height: 3.6rem; /* チェックボックス1行目と縦中央を揃える */
  }
}
.c-cardList[hidden] {
  display: none;
}
