/* 전문가 찾기·추천 회원·공개 목록 공용: 가로형 사진 명함.
   한국 명함 90:50(9/5) 앞면 한 장. 왼쪽 글, 오른쪽 3:4 증명사진.
   platform.html과 people.html에서 마지막에 불러온다. 옛 명함 변형은 이 클래스에 적용하지 않는다.
   design-tokens.css가 button/p/h3 글자 크기를 !important로 고정하므로 같은 속성만 !important로 맞선다. */

/* 열: 1440 이상 3열, 768~1439 2열, 767 이하 1열 */
.platform-body #memberGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}
@media (min-width: 1440px) {
  .platform-body #memberGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .platform-body #memberGrid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}

/* 카드 본체: 미색 종이 */
.bc-directory-card {
  position: relative;
  display: flex;
  box-sizing: border-box;
  aspect-ratio: 9 / 5;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d9d6cf;
  border-radius: 6px;
  background: #fdfcf9;
  box-shadow: none;
  transform: none;
  transition: border-color .15s ease, transform .15s ease;
}
.bc-directory-card:hover {
  border-color: #b9471d;
  box-shadow: none;
  transform: translateY(-2px);
}
.bc-directory-card:has(.member-preview-button:focus-visible) {
  outline: 3px solid #b9471d;
  outline-offset: 3px;
}

/* 왼쪽 글 칸: 오른쪽 사진(폭 31.67% + 오른쪽 여백 6.67%) 자리를 비운다 */
.bc-directory-card .bc-directory-main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  padding: var(--bc-top, 14px) calc(38.34% + var(--bc-gap, 10px)) var(--bc-bottom, 12px) var(--bc-left, 18px);
}

/* 카드 전체가 하나의 버튼: 글 칸 버튼의 ::after가 카드를 덮는다(태그·북마크는 그 위) */
.bc-directory-card .member-preview-button {
  position: static;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  height: auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
  margin: 0;
  gap: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #1f1d1a;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.bc-directory-card .member-preview-button::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 5px;
}
.bc-directory-card .member-preview-button:focus-visible {
  outline: none;
}

/* 위: 분야 · 예시 */
.bc-directory-card .bc-directory-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.bc-directory-card .bc-directory-field {
  display: block;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #b9471d;
  font-size: .8125rem !important;
  font-weight: 600;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bc-directory-card .bc-directory-demo {
  position: static;
  flex: none;
  padding: 0;
  background: none;
  color: #8a857b;
  font-size: .8125rem !important;
  font-weight: 500;
  line-height: 1.4;
}

/* 가운데: 이름 · 소속과 직함 */
.bc-directory-card .bc-directory-copy {
  display: block;
  min-width: 0;
  margin: auto 0;
  padding: 4px 0;
}
.bc-directory-card.bc-directory-card .bc-directory-copy h3 {
  margin: 0;
  overflow: hidden;
  color: #1f1d1a;
  font-size: 1.25rem !important;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.3 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bc-directory-card.bc-directory-card .bc-directory-copy p {
  min-height: 0;
  margin: 2px 0 0;
  overflow: hidden;
  color: #57534b;
  font-size: .8125rem !important;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 아래: 구분선 · 한 줄 소개 · 태그 */
.bc-directory-card.bc-directory-card .bc-directory-offer {
  display: block;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-height: 0;
  margin: 0;
  padding: 7px 0 0;
  overflow: hidden;
  border-top: 1px solid #e3dfd6;
  color: #3a3731;
  font-size: .8125rem !important;
  font-weight: 400;
  line-height: 1.45;
}
.bc-directory-card .bc-directory-tags {
  display: block;
  margin: 3px 0 0;
  padding: 0;
  overflow: hidden;
  color: #8a857b;
  font-size: .8125rem !important;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bc-directory-card .bc-directory-tag-chip {
  position: relative;
  z-index: 2;
  display: inline;
  width: auto;
  height: auto;
  min-height: 0 !important;
  margin: 0 8px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: #8a857b;
  font-size: .8125rem !important;
  font-weight: 400;
  line-height: 1.5;
  cursor: pointer;
}
.bc-directory-card .bc-directory-tag-chip:hover {
  color: #b9471d;
  background: none;
  text-decoration: underline;
}
.bc-directory-card .bc-directory-tag-chip:focus-visible {
  outline: 3px solid #b9471d;
  outline-offset: 3px;
}

/* 오른쪽: 증명사진 3:4, 카드 높이의 76%, 위·아래·오른쪽 여백이 같다 */
.bc-directory-card .bc-directory-photo {
  position: absolute;
  top: 12%;
  right: 6.67%;
  box-sizing: border-box;
  width: 31.67%;
  aspect-ratio: 3 / 4;
  margin: 0;
  overflow: hidden;
  border: 1px solid #d9d6cf;
  border-radius: 2px;
  background: #ecebe6;
}
/* The invisible 44px bookmark target reaches the photo edge. */
.bc-directory-card .bc-directory-photo:has(.member-home-bookmark) { overflow: visible; }
.bc-directory-card .bc-directory-photo:has(.member-home-bookmark) > .member-avatar-image { border-radius: inherit; }
.bc-directory-card .bc-directory-photo .member-avatar-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 0;
  object-fit: cover;
  object-position: center 25%;
}
/* 사진이 없으면 같은 틀 안에 이름 첫 글자 */
.bc-directory-card .bc-directory-photo .abstract-member-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: #ecebe6;
  color: #8a857b;
}
.bc-directory-card .bc-directory-photo .abstract-member-avatar::before,
.bc-directory-card .bc-directory-photo .abstract-member-avatar::after {
  display: none;
}
.bc-directory-card .bc-directory-photo .abstract-member-avatar > span {
  display: block;
  width: auto;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: #8a857b;
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1;
}

/* 관심 저장: 사진 오른쪽 위 모서리의 작은 원형 버튼 */
.bc-directory-card .member-home-bookmark {
  position: absolute;
  top: 5px; /* The photo's 1px border completes the 6px inset. */
  right: 5px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  margin: 0;
  padding: 0;
  border: 1px solid #d9d6cf;
  border-radius: 50%;
  background: rgb(255 255 255 / .92);
  box-shadow: none;
  color: #57534b;
  line-height: 1;
  cursor: pointer;
}
.bc-directory-card .member-home-bookmark::after {
  content: '';
  position: absolute;
  width: 44px;
  height: 44px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.bc-directory-card .member-home-bookmark > span[aria-hidden] { display: none; }
.bc-directory-card .member-home-bookmark .directory-bookmark-icon { display: block; width: 16px; height: 16px; }
.bc-directory-card .member-home-bookmark:hover { border-color: #b9471d; color: #b9471d; }
.bc-directory-card .member-home-bookmark.is-saved {
  border-color: #b9471d;
  background: rgb(255 255 255 / .92);
  color: #b9471d;
}
.bc-directory-card .member-home-bookmark.is-saved .directory-bookmark-icon { fill: currentColor; }
.bc-directory-card .member-home-bookmark:focus-visible {
  outline: 3px solid #b9471d;
  outline-offset: 3px;
}

/* 좁은 화면(360px 안팎): 글자만 조금 줄여 이름과 사진이 잘리지 않게 한다 */
@media (max-width: 420px) {
  .bc-directory-card { --bc-top: 12px; --bc-gap: 8px; --bc-bottom: 10px; --bc-left: 14px; }
  .bc-directory-card.bc-directory-card .bc-directory-copy h3 { font-size: 1.0625rem !important; letter-spacing: .03em; }
  .bc-directory-card.bc-directory-card .bc-directory-copy p,
  .bc-directory-card.bc-directory-card .bc-directory-offer { font-size: .8125rem !important; }
  .bc-directory-card .bc-directory-photo .abstract-member-avatar > span { font-size: 1.875rem; }
}

@media (prefers-reduced-motion: reduce) {
  .bc-directory-card { transition: none; }
  .bc-directory-card:hover { transform: none; }
}

/* 컨테이너는 열 배치만 정하고, 명함 자체는 공용 클래스가 정한다. */
#peopleResults { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
#dashboardRecommendations { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
#dashboardRecommendations .bc-recommendation { display: grid; gap: 8px; min-width: 0; container-type: inline-size; }
@media (min-width: 1440px) { #peopleResults { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) { #peopleResults { grid-template-columns: minmax(0, 1fr); gap: 12px; } }
.bc-directory-card { color: #1f1d1a; text-decoration: none; }
.bc-directory-card:focus-visible { outline: 3px solid #b9471d; outline-offset: 3px; }
.bc-directory-card .bc-directory-tag-chip[aria-pressed="true"] { color: #b9471d; text-decoration: underline; }
.bc-directory-card .bc-directory-tags { flex: none; min-height: 1.5em; }
.bc-directory-card .bc-directory-photo .member-avatar-image { position: absolute; inset: 0; }
@container (max-width: 420px) {
  .bc-directory-card { --bc-top: 12px; --bc-gap: 8px; --bc-bottom: 10px; --bc-left: 14px; }
  .bc-directory-card.bc-directory-card .bc-directory-copy h3 { font-size: 1.0625rem !important; letter-spacing: .03em; }
}

/* 전문가 찾기: 검색창의 #토큰에만 표시되는 태그 후보 목록 */
.platform-body .member-tag-combobox {
  position: relative;
  width: 100%;
  min-width: 0;
}
.platform-body .member-tag-combobox .ecb-explore-search { min-width: 0; }
.platform-body .member-tag-combobox input { min-width: 0; }
.platform-body .member-tag-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  box-shadow: 0 2px 6px rgb(0 0 0 / 6%);
  font-size: 15px;
  font-weight: 400;
}
.platform-body .member-tag-suggestions[hidden] { display: none; }
.platform-body .member-tag-option,
.platform-body .member-tag-empty {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 10px 14px;
  line-height: 20px;
}
.platform-body .member-tag-option { cursor: pointer; }
.platform-body .member-tag-option:hover,
.platform-body .member-tag-option[aria-selected="true"] { background: #f3f4f6; }
.platform-body .member-tag-label { min-width: 0; overflow-wrap: anywhere; }
.platform-body .member-tag-count {
  flex-shrink: 0;
  margin-left: auto;
  color: #6b7280;
  font-size: 13px;
}

/* 검색창 포커스: 둥근 검색 상자 전체에 테두리를 그리고 안쪽 입력칸의 네모 윤곽선은 숨긴다. */
.platform-body .ecb-explore-search #searchInput:focus,
.platform-body .ecb-explore-search #searchInput:focus-visible { outline: none !important; box-shadow: none !important; }
.platform-body .ecb-explore-search:focus-within { outline: 3px solid #b9471d; outline-offset: 3px; box-shadow: none !important; }

/* 추천 회원: 명함 묶음 사이 간격(회원 홈 공통 display:block 규칙을 이김), 제안하기는 테두리 버튼으로 가볍게 */
html body.platform-body #memberDashboard #dashboardRecommendations { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
html body.platform-body #memberDashboard #dashboardRecommendations .bc-recommendation-propose { background: #fff !important; color: #b9471d !important; border: 1px solid #b9471d !important; font-weight: 700; }
html body.platform-body #memberDashboard #dashboardRecommendations .bc-recommendation-propose:hover { background: #fff1ea !important; }

/* 글자 크기를 키워도 소개·태그가 짜부라지거나 잘리지 않게: 줄 요소는 줄어들지 않고 명함이 내용만큼 자란다
   (9:5 는 기본 글자 크기에서의 최소 비율). overflow:clip 은 스크롤 컨테이너가 아니라 비율 상자의 자동 최소 높이가 살아 있다. */
.bc-directory-card { min-height: auto; overflow: clip; }
.bc-directory-card .bc-directory-main > *,
.bc-directory-card .member-preview-button > * { flex-shrink: 0; }
