/* =========================================
   구성원(Team) 서브페이지 전용 스타일 (team.css)
========================================= */

/* --- 1. 상단 서브 비주얼 영역 --- */
.sub-visual {
  width: 100%;
  height: 425px; /* 요청하신 높이 */
  position: relative;
  /* 임시 배경 (실제 배경 이미지 경로로 수정해주세요) */
  background: url('/assets/images/daegun/team1.png') no-repeat center/cover;
  background-color: #333; /* 이미지 없을 때 대비 기본 배경색 */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* 어두운 오버레이 깔기 */
.sub-visual::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
}

.sub-visual-text {
  position: relative;
  z-index: 10;
  color: #FFF;
  
  /* 피그마의 위(139px), 아래(139px) 대칭 구조를 완벽히 맞추기 위해 
     기존에 임의로 넣었던 margin-top을 제거하고 완벽한 중앙 정렬을 유지합니다. */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.sub-visual-text h2 {
  /* width: 231px; -> 글자 수에 따라 유동적으로 늘어나도록 고정하지 않습니다 */
  color: #FFF;
  text-align: center;
  font-family: 'Pretendard', sans-serif;
  font-size: 35px; /* 피그마 수치: 35px */
  font-style: normal;
  font-weight: 700;
  line-height: 1.4; /* 108.571% 완벽 반영 */
  
  /* 피그마 기준 h2(top 139px)와 p(top 179px)의 차이는 40px, 
     h2 높이가 약 38px이므로 두 줄 사이의 실제 여백은 2px입니다. */
  margin-bottom: 2px; 
}

.sub-visual-text p {
  /* width: 494px; -> 역시 유동적으로 늘어나도록 고정하지 않습니다 */
  color: #FFF;
  text-align: center;
  font-family: 'Pretendard', sans-serif;
  font-size: 25px; 
  font-style: normal;
  font-weight: 400;
  line-height: 1.4; /* 피그마 수치(height 38px) 완벽 반영 */
  margin: 0;
}

/* --- 2. 탭 메뉴 (변호사 | 법률사무원) --- */
.sub-tab-wrap {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 66px; /* 요청하신 탭 영역 높이 */
  background: rgba(49, 49, 49, 0.40); /* 요청하신 반투명 배경색 */
  z-index: 10;
}

.sub-tab-inner {
  width: 100%;
  max-width: 1240px; /* 요청하신 가로 사이즈 제한 */
  height: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 60px; /* 메뉴와 메뉴 사이 간격 */
}

.sub-tab-link {
  color: rgba(255, 255, 255, 0.6); /* 비활성화 상태는 약간 흐리게 */
  font-family: 'Pretendard', sans-serif;
  font-size: 18px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}

/* 현재 선택된 메뉴(활성화 상태) */
.sub-tab-link.active {
  color: #FFFFFF;
  font-weight: 600;
}

/* 가운데 세로 구분선 ( | ) */
.sub-tab-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.3);
}

/* --- 3. 구성원 본문 영역 --- */
.team-section {
  padding: 100px 0 120px;
  background: #FFFFFF; /* 변호사 페이지 전체 배경: 흰색 */
}

.team-header {
  text-align: center;
  margin-bottom: 50px;
}

.team-header h3 {
  color: #313131;
  font-family: 'Pretendard', sans-serif;
  font-size: 27px;
  font-weight: 700;
  line-height: 1.4; /* 140.741% */
  margin-bottom: 12px;
}

.team-header p {
  color: #313131;
  font-family: 'Pretendard', sans-serif;
  font-size: 18px;
  font-weight: 300;
  line-height: 1.4; /* 150% */
}

/* 카드들이 담길 가로 한정 영역 (요청하신 약 980px에 맞춤) */
.team-grid-wrap {
  width: 100%;
  max-width: 980px; 
  margin: 0 auto;
  padding: 0 20px; /* 모바일 안전 여백 */
}

/* 4칸 그리드 */
.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px; /* 카드 사이의 간격 */
}

/* --- 4. 개별 프로필 카드 --- */
.member-card {
  /* 👇 디자인 시안에 맞춘 밝은 회색으로 변경! (투명 사진 뒤로 이 색이 깔립니다) */
  background: #EFEFEF; /* 변호사 페이지 카드 배경: 회색 */
  border-radius: 4px;
  padding-top: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  text-align: left;
  
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.member-info {
  padding: 0 24px;
  margin-bottom: 15px;
  /* 카드 색이 변해도 정보 영역이 튀지 않게 배경 투명 처리 */
  background: transparent;
  min-height: 110px;
  margin-bottom: 0; /* 카드 하단 여백 제거 */
  padding: 0 15px 0 10px;
}

/* 이름과 직책을 한 줄에 배치 */
.member-name-wrap {
  display: flex;
  align-items: baseline; /* 글씨 아래쪽 라인을 맞춤 */
  gap: 8px; /* 이름과 직책 사이 간격 */
  margin-bottom: 5px;
}

.member-name {
  color: #313131;
  font-family: 'Pretendard', sans-serif;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.4; /* 180.952% */
}

.member-role {
  color: #313131;
  font-family: 'Pretendard', sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4; /* 253.333% */
}

/* 빨간색 한 줄 다짐 */
.member-quote {
  color: #B70000;
  font-family: 'Pretendard', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4; /* 271.429% */
}

/* 인물 이미지 영역 (사진이 하단에 딱 붙도록) */
.member-img {
  width: 100%;
  display: flex;
  align-items: flex-end; /* 이미지를 바닥에 붙임 */
  justify-content: center;

  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  /* 이미지 영역 자체도 배경색 없이 깨끗하게 */
  background: transparent;

  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
}

.member-img img {
  width: 100%;
  height: auto;
  display: block;
  width: 100%;
  height: auto;
  display: block;  
  /* 👇 [가장 중요★] 사진의 흰 배경을 투명하게 만들어 부모 카드 배경색과 합칩니다 */
  mix-blend-mode: multiply;   
  /* 비활성화 상태에서는 흰색 배경과 합쳐져 원래 사진처럼 보입니다 */
  width: 100%;
  height: auto;
  display: block;
}

/* =========================================
   5. 카드 클릭 액션 (다크모드 반전 효과)
========================================= */
/* --- 클릭 시 나타나는 약력 (기본은 숨김) --- */
.member-history {
  display: none; /* 평소엔 안 보임 */
  margin-top: 15px;
}

.member-history li {
  color: #EAEAEA; /* 다크 배경 위 밝은 회색 텍스트 */
  font-family: 'Pretendard', sans-serif;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.4;
  position: relative;
  padding-left: 10px;
  word-break: keep-all;
  color: #FFF;
font-family: Pretendard;
font-size: 11px;
font-style: normal;
font-weight: 400;
line-height: 18px; /* 163.636% */
}

/* 리스트 앞의 작은 점(·) 디자인 */
.member-history li::before {
  content: '·';
  position: absolute;
  left: 0;
  top: 0;
}

/* --- 클릭 시 나타나는 우측 하단 뱃지 (기본은 숨김) --- */
.member-img {
  position: relative; /* 뱃지의 기준점 역할 */
}

.member-badge {
  display: none; /* 평소엔 안 보임 */
  position: absolute;
  bottom: 20px;
  right: 15px;
  background: #B70000;
  color: #FFFFFF;
  font-family: 'Pretendard', sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 20px; /* 양옆이 둥근 알약 모양 */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); /* 입체감 그림자 */
  z-index: 10;
}

/* =========================================
   [반전 테마] 법률사무원 페이지 전용 (.theme-gray)
========================================= */
/* 전체 배경을 회색으로 반전 */
.team-section.theme-gray {
  background: #EFEFEF; 
}

/* 카드는 흰색으로 반전 (그림자를 살짝 넣어서 배경과 구분되게 함) */
.team-section.theme-gray .member-card {
  background: #FFFFFF;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03); 
}

/* =========================================
   [JS 연동] 카드가 활성화(is-active) 되었을 때의 변화
========================================= */

/* 1. 배경이 다크 그레이로 변경됨 */
.member-card.is-active {
  background-color: #313131CC; 
  background-color: #313131CC !important; /* !important를 넣어 어떤 테마에서든 최우선 적용되게 함 */
}

/* 2. 글씨들이 전부 하얀색으로 반전됨 */
.member-card.is-active .member-name,
.member-card.is-active .member-role,
.member-card.is-active .member-quote {
  color: #FFFFFF;
}

/* 3. 숨겨져 있던 약력과 뱃지가 나타남 */
.member-card.is-active .member-history {
  display: block;
  position: relative;
}
.member-card.is-active .member-badge {
  display: block;
}

.member-card.is-active .member-history::before {
    content: '';
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.00) 0%, #FFF 50%, rgba(255, 255, 255, 0.00) 100%);
}

/* =========================================
   모바일 반응형 (화면 가로 992px 이하일 때)
========================================= */
@media screen and (max-width: 992px) {
  /* 태블릿: 4칸을 2칸으로 쪼갬 */
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px 20px; 
  }
}

@media screen and (max-width: 576px) {
  /* 모바일: 비주얼 영역 축소 */
  .sub-visual { height: 258px; }
  .sub-visual-text {
        margin-top: 20px; 
        
        /* 만약 margin-top을 줬을 때 탭 메뉴(.sub-tab-wrap)까지 같이 밀려 내려간다면, 
           아래처럼 top 속성을 대신 사용해 보세요! (시각적인 위치만 내려줍니다) */
        /* top: 20px; */
    }
  .sub-visual-text h2 { font-size: 26px; line-height: 38px; 

    color: #FFF;
text-align: center;
font-family: Pretendard;
font-size: 26px;
font-style: normal;
font-weight: 700;
line-height: 1.4; /* 146.154% */

  }
  .sub-visual-text p { font-size: 16px; line-height: 38px; 
  color: #FFF;
text-align: center;
font-family: Pretendard;
font-size: 16px;
font-style: normal;
font-weight: 400;
line-height: 1.4; /* 237.5% */
}

.team-section {
  padding: 65px 35px 60px;
}

  /* 탭 간격 축소 */
  .sub-tab-wrap { height: 38px; }
  .sub-tab-inner { gap: 30px; }
  .sub-tab-link { font-size: 12px; line-height: 1.4; }

  .team-grid-wrap { 
    padding: 0;
  }

  .team-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 100%;
    gap: 17px 16px;
  }

  .member-card{
    padding-top: 13px;
  }
  
  /* 👇 여기부터 team-header 부분을 교체해 주세요! */
  .team-header { 
    padding: 0 20px; /* 모바일에서 좌우 20px 여백을 주어 숨통을 트이게 합니다 */
    margin-bottom: 40px; 
    margin-bottom: 20px; 
  }

  .team-header h3 { 
    font-size: 22px; 
    line-height: 1.4; 
    margin-bottom: 12px;
    word-break: keep-all; /* 단어 단위로 줄바꿈 되도록 설정 */

    color: #313131;
  text-align: center;
  font-family: Pretendard;
  font-size: 21px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.4; /* 109.524% */
  }
  
  .team-header p { 
    font-size: 15px; 
    line-height: 1.6; /* 행간을 살짝 더 넓혀서 읽기 편하게 */
    word-break: keep-all; /* 단어가 중간에 쪼개지지 않도록 설정 */
    color: #313131;
text-align: center;
font-family: Pretendard;
font-size: 13px;
font-style: normal;
font-weight: 300;
line-height: 1.4; /* 153.846% */
  }

  .member-info {
    padding: 0 10px;
    margin-bottom: 0;
    /* 활성화 시 약력이 표시될 공간을 미리 확보하여 카드 높이 변경 방지 */
    min-height: 95px;
  }
  .member-name{
    color: #313131;
font-family: Pretendard;
font-size: 16px;
font-style: normal;
font-weight: 700;
line-height: 1.4; /* 237.5% */
  }
  .member-role{
color: #313131;
font-family: Pretendard;
font-size: 12px;
font-style: normal;
font-weight: 500;
line-height: 1.4; /* 316.667% */
  }
  .member-quote{
  color: #B70000;
  font-family: Pretendard;
  font-size: 10px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.4
  }
  .member-history{
    position: relative;
    margin-top: 21px; /* 라인(1px)과 위아래 여백(각 10px)을 위한 공간 확보 */
  }
  /* 활성화 시 .member-history 위에 라인 추가 */
  .member-card.is-active .member-history::before {
    content: '';
    position: absolute;
    top: -11px; /* 위쪽 여백의 중간에 위치 */
    left: 50%;
    transform: translateX(-50%);
    width: 127.932px;
    height: 1px; /* 0.25px는 브라우저에서 안 보일 수 있어 1px로 처리합니다. */
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.00) 0%, #FFF 50%, rgba(255, 255, 255, 0.00) 100%);
  }
  .member-history li{
    color: #FFF;
font-family: Pretendard;
font-size: 9px;
font-style: normal;
font-weight: 400;
line-height: 1.4; /* 144.444% */
  }
  .member-badge{
    color: #FFF;
text-align: center;
font-family: Pretendard;
font-size: 11px;
font-style: normal;
font-weight: 600;
line-height: 1.4;
border-radius: 10px;
right: 10px;
bottom: 5px;padding: 4px 8px;
  }
}
