/*
 * 상담사 추천 이유 라벨 — 웹닥터 추천 A/B C 그룹 이유 한 줄 (SPEC-20261116-03). 리스트형 화면 상담사 카드의 이름 줄 바로 아래.
 * 마크업은 page/js/template/algo_label.js, 이 파일은 page/list_module_importmap.php 가 불러온다.
 * 목록 API 가 rec_reason 을 준 카드(C 그룹 추천 상담사)에만 붙는다.
 *
 * 크기는 모두 rem 이라 mob.css 가 화면 폭마다 바꾸는 html 기준 글자 크기를 따라
 * 함께 커지고 작아진다. 카드 폭보다 길면 줄바꿈된다.
 */

.algo_label {
  max-width: 100%;
  border-radius: 0.375rem;
  background: #ffeef0;
  color: #e3343f;
  font-weight: 600;
  word-break: keep-all;
}

/* 웹 카드 — 이름 줄(.tit)과 평점·통화수(.info) 사이. 크기는 분류 배지(.cate)에 맞춤 */
.list_wrap .item .txtbox > .algo_label {
  display: inline-block;
  align-self: flex-start;
  padding: 0.35rem 0.5rem;
  margin: 0 0 0.813rem;
  font-size: 0.813rem;
  line-height: 1.3;
}

/* 모바일 카드 — 이름 줄(.title)과 소개 문구(.desc) 사이. 크기는 소개 문구에 맞춤 */
.list_wrap .item .mob_txtbox > .algo_label {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.6rem;
  margin: 0 0 0.6rem;
  border-radius: 0.4rem;
  font-size: 1.1rem;
  line-height: 1.2;
}

/*
 * 웹 화면 버튼 높이 맞춤 — 라벨이 붙은 카드는 한 줄만큼 길어진다. 같은 줄 카드들은
 * 리스트(flex)가 이미 가장 긴 카드 높이로 늘여 두므로, 카드 안을 세로로 쌓고
 * 상담 버튼(본문의 마지막 요소)을 바닥에 붙여 라벨 유무와 상관없이 버튼 높이를 맞춘다.
 * 라벨 없는 카드는 평가 태그와 버튼 사이가 벌어진다. 모바일 카드(1080px 이하)는 한 줄에
 * 하나라 해당 없음.
 */
@media screen and (min-width: 1081px) {
  .list_wrap .listbox > .item {
    display: flex;
    flex-direction: column;
  }
  .list_wrap .listbox > .item > .top {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
  }
  .list_wrap .listbox > .item > .top > .txtbox {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
  }
  .list_wrap .listbox > .item > .top > .txtbox > :last-child {
    margin-top: auto;
  }
}
