/* ==========================================
   메인(main) 페이지
   ========================================== */
/* ==========================================
   섹션 제목 공통 (타이포 스케일 적용)
   ========================================== */
.quick-title,
.today-title,
.best-title,
.news-title,
.miss-title,
.donation-title {
  font-size: var(--font-h2);
  font-weight: 700;
  color: var(--color-text-strong);
  text-align: left;
}
/* ==========================================
   상단 배너
   ========================================== */
/* 배너: 사진(좌) + 텍스트 패널(우) 분리 구조.
   기존엔 문구가 이미지에 박혀 있어 모바일에서 잘렸음 → 실제 HTML 텍스트로 분리 */
.banner-container {
  display: flex;
  max-width: var(--container-max);
  margin: 0 auto var(--space-xl) auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}
/* aspect-ratio 를 원본 크롭 비율(920:600)과 맞춰서 background-size:cover 여도
   상하가 잘리지 않고 n꽉 차게 함. 배너 높이는 이 사진 높이를 따라감 */
.banner-photo {
  /*grow(1): 남는 공간 나눠 가질 비율, shrink(1): 부족할 떄 줄어들 비율, basis(58%): 기본크기*/
  flex: 1 1 58%;
  aspect-ratio: 920 / 600;
  background: url("../images/banner-left.jpg") center / cover no-repeat;
}
.banner-content {
  flex: 1 1 42%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 40px 36px;
  background-color: #b5622a;
  color: #fff;
}
/* 폰트: 기본은 --font-* 토큰, 일부 히어로/특수 자리만 px 직접 지정 */
.banner-eyebrow {
  font-size: var(--font-sm);
  opacity: 0.9;
}
.banner-title {
  font-size: var(--font-hero);
  font-weight: 800;
  line-height: 1.25;
}
.banner-desc {
  font-size: var(--font-body);
  opacity: 0.95;
}
.banner-cta {
  margin-top: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  background: var(--color-bg);
  color: #8a3d15;
  font-weight: 700;
  font-size: var(--font-sm);
  transition: opacity 0.2s ease;
}
.banner-cta:hover {
  opacity: 0.9;
}
/* ==========================================
   퀵 메뉴바
   ========================================== */
.quick-menu {
  max-width: var(--container-max);
  padding: 0 20px;
  margin: 0 auto var(--space-xl) auto; /* 섹션 여백 확보 */
}
.quick-title {
  margin-bottom: 25px;
}
.quick-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px 44px;
  padding: 0;
}
.quick-list li {
  width: 84px;
}
.quick-list a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  color: var(--color-text);
  transition:
    transform 0.2s ease,
    color 0.2s ease;
}
.quick-list svg {
  width: 46px;
  height: 46px;
  padding: 11px;
  border-radius: 50%;
  background: var(--color-bg-soft);
  color: var(--color-primary);
  transition: background 0.2s ease;
}
.quick-list a span {
  line-height: 1.3;
  word-break: keep-all;
  font-size: var(--font-sm);
}
.quick-list a:hover {
  transform: translateY(-4px);
  color: var(--color-primary);
}
.quick-list a:hover svg {
  background: var(--color-primary-soft);
}
/* ==========================================
   오늘의 추천동물
   ========================================== */
.today-animal {
  max-width: var(--container-max);
  margin: 0 auto var(--space-xl) auto; /* 섹션 간격 넓게 수정 */
  padding: 0 20px;
  text-align: left;
}
.today-title {
  margin-bottom: 30px;
}
.today-header {
  display: flex;
  justify-content: space-between; /* 제목과 버튼(더보기)를 양쪽 끝으로 밀어냄 */
  align-items: baseline; /* 제목과 버튼의 하단 라인을 맞춤 */
  margin-bottom: 25px; /* 리스트와 간격 */
}
/* 더보기 버튼 스타일은 공통 .btn .btn--ghost 로 통일 (common.css) */
/* ==========================================
   지역 필터
   ========================================== */
.region-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 20px;
  margin: 20px 0 32px;
}
/* ==========================================
   오늘의 추천동물 카드 리스트(그리드)
   ========================================== */
.card-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-md); /* 카드 사이의 간격 */
  padding: 0;
  margin-top: 20px;
  width: 100%;
}
/* 개별 카드 디자인 */
.card-list li {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md); /* 모서리 둥글게 */
  overflow: hidden;
  transition: transform 0.3s; /* 마우스 올렸을 때 애니메이션 */
  background: var(--color-bg);
}
.card-list li:hover {
  transform: translateY(-5px); /* 마우스 올리면 살짝 위로 이동 */
  box-shadow: var(--shadow-card);
}
/* 카드 내부 링크 및 텍스트 정렬 */
.card-list li a {
  display: flex;
  flex-direction: column; /* 세로 정렬 */
  padding: 11px;
  text-align: center;
  color: var(--color-text);
}
.card-list li img {
  width: 100%; /* 세트로 사용 가로는 부모 너비에 맞춤 */
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}
/* 카드 텍스트 (추천동물 / 실종 · 제보 공용 */
.card-list li .card-species,
.miss-list li .card-species {
  font-size: var(--font-sm);
  font-weight: 700;
  color: var(--color-text-strong);
}
.card-list li .card-meta,
.miss-list li .card-meta {
  margin-top: 3px;
  font-size: var(--font-xs);
  color: var(--color-text-sub);
}
/* ==========================================
   베스트 입양후기 영역
   ========================================== */
.best-animal {
  max-width: var(--container-max);
  margin: 0 auto var(--space-xl); /* 섹션 간격 넓게 수정 */
  padding: 0 20px;
  text-align: left;
}
.best-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 25px;
}
/* 베스트 입양후기 카드 리스트 그리드 */
.best-cardlist {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  padding: 0;
}
.best-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 11px;
  text-align: center;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.best-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-card);
}
.best-thumb {
  /*badge가 absolute 가장 가까운 조상기준으로 배치 thumb에 relative줘서 badge기준점으로 고정*/
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 10px;
}
.best-thumb img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.best-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: var(--font-xs);
  font-weight: 700;
  color: #fff;
  background: var(--color-state-done); /* 입양 후 =초록*/
}
.best-badge.is-before {
  background: var(--color-text-muted); /*입양 전 = 회색*/
}
.best-name {
  font-size: var(--font-body);
  font-weight: 700;
  color: var(--color-text-strong);
}
/* ==========================================
   포인핸드 소식 슬라이더
   ========================================== */
.ph-news {
  max-width: var(--container-max);
  margin: 0 auto var(--space-xl); /* 섹션 간격 넓게 수정 */
  padding: 0 20px;
  text-align: left;
}
.news-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
}
.news-slider {
  position: relative;
  max-width: var(--container-max);
  margin: 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden; /* 100%로 한 장만 보이게 (창문 역할) */
}
.news-track {
  display: flex;
  /* 이동 시 애니메이션*/
  transition: transform 0.4s ease;
}
.news-slide {
  flex: 0 0 100%;
  min-width: 0;
}
.news-slide img {
  width: 100%;
  height: auto;
  display: block;
}
.news-nav {
  /* nav-btn 배너 상단50% 배치*/
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--color-text);
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}
.news-nav svg {
  width: 20px;
  height: 20px;
}
.news-nav:hover {
  background: var(--color-bg);
  transform: translateY(-50%) scale(1.08);
}
.news-prev {
  left: 14px;
}
.news-next {
  right: 14px;
}
/* ==========================================
   실종/제보 동물
   ========================================== */
.missing-report {
  max-width: var(--container-max);
  margin: 0 auto var(--space-xl); /* 섹션 간격 넓게 수정 */
  padding: 0 20px;
  text-align: left;
}
.miss-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
}
/* 실종/제보 동물 카드 리스트 그리드 */
.miss-cardgrid {
  width: 100%;
}
.miss-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-md);
  padding: 0;
  margin-top: 0;
}
/* 개별 카드 디자인 */
.miss-list li {
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.3s;
}
.miss-list li:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-card);
}
.miss-list li .miss-card {
  display: flex;
  flex-direction: column;
  padding: 11px;
  text-align: center;
  color: var(--color-text);
}
/* 이미지를 감싸는 영역 */
.miss-img-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  position: relative; /* 뱃지 위치 조정을 위한 기준점 */
}
.miss-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* 사진 위에 얹어질 실종/제보 뱃지 스타일 */
/* .카드 { position: relative; }  /* 자리 그대로, 기준점만 제공 */
/*.뱃지 { position: absolute; top: 8px; left: 8px; }  /* 부모 모서리에 콕 */
.miss-img-wrap .badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  font-size: var(--font-xs);
  font-weight: bold;
  color: #fff;
  border-radius: 5px;
  background-color: rgba(0, 0, 0, 0.6); /* 기본 반투명 배경 */
}
/* 실종 / 제보에 따라 뱃지 색상을 다르게 */
.miss-img-wrap .missing-badge {
  background-color: #ff5252; /* 실종: 붉은계열 */
}
.miss-img-wrap .report-badge {
  background-color: #448aff; /* 제보: 푸른계열 */
}
/* ==========================================
   기부 챌린지 영역
   ========================================== */
.donation-challenge {
  max-width: var(--container-max);
  width: 100%;
  margin: 0 auto 90px; /* 마지막 섹션은 통계 바 위에 걸치지 않도록 더 넉넉하게 */
  padding: 0 20px;
  background-color: var(--color-bg);
}
.donation-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
}
.donation-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}
.donation-card {
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.3s;
}
.donation-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-card);
}
.donation-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.donation-info {
  padding: 16px;
}
.donation-info h3 {
  font-size: var(--font-body);
  margin-bottom: 6px;
}
.donation-info p {
  font-size: var(--font-sm);
  color: var(--color-text-muted);
  margin-bottom: 12px;
}
.progress-bar {
  /* 트랙 */
  width: 100%;
  height: 8px;
  background: var(--color-border-light);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 4px;
}
.donation-meta {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-sm);
  color: var(--color-text-sub);
}
.donation-meta .percent {
  font-weight: 700;
  color: var(--color-primary);
}
/* ==========================================
   유기동물 처리 현황 (본문 하단 미니 대시보드)
   ========================================== */
.stats-section {
  position: relative;
  max-width: var(--container-max);
  margin: 0 auto var(--space-xl);
  padding: 28px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--color-bg-soft);
  transition: border-color 0.2s ease;
}
.stats-section:hover {
  border-color: var(--color-primary);
}
.stats-section__link {
  position: absolute;
  /* 상 우 하 좌 모든 방향 0 꽉 채움*/
  inset: 0;
  border-radius: var(--radius-md);
}
.stats-section__link span {
  position: absolute;
  right: 28px;
  bottom: 28px;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--color-primary);
}
.stats-section:hover .stats-section__link span {
  text-decoration: underline;
}
.stats-header {
  margin-bottom: 20px;
}
#stats-date {
  margin-bottom: 4px;
}
.stats-sub {
  font-size: var(--font-xs);
  color: var(--color-text-sub);
}
/* 핵심 수치 타일 3개 */
/*스코프 변수 + 폴백*/
.stats-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: 24px;
}
.stats-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  /* var(--tile-color) 폴백 첫 번째 var()가 없으면 두번쨰로 넘김*/
  /* js로치면 삼항연산자 const color = tileColor ? tileColor : colorBorder*/
  border-top: 3px solid var(--tile-color, var(--color-border));
  border-radius: var(--radius-md);
}
.stats-tile-label {
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--color-text-sub);
}
.stats-tile-value strong {
  font-size: var(--font-h1);
  font-weight: 800;
  color: var(--tile-color, var(--color-text-strong));
}
.stats-tile-value em {
  margin-left: 4px;
  font-style: normal;
  font-size: var(--font-xs);
  color: var(--color-text-sub);
}
.stat-care {
  --tile-color: #28a745; /* 이 카드만 초록*/
}
.stat-adopt {
  --tile-color: #007bff; /* 이 카드만 파랑*/
}
.stat-eol {
  --tile-color: #fd7e14; /* 이 카드만 주황*/
}
/* 보호 종료 결과 스택 바 */
.stats-breakdown-title {
  margin-bottom: 8px;
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--color-text-sub);
}
.stats-bar {
  display: flex;
  height: 14px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: #e9e9e9;
}
.stats-bar .seg {
  height: 100%;
  min-width: 2px;
  transition: width 0.8s ease;
}
.stats-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 12px;
  padding: 0;
}
.stats-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-xs);
  color: var(--color-text-sub);
}
.stats-legend .dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  flex-shrink: 0;
}
.stats-legend strong {
  color: var(--color-text);
  font-weight: 700;
}
/* ==========================================
   메인 페이지 반응형 (1024px or 769px)
   ========================================== */
/* 태블릿 화면 (너비 1024 이하일때) */
@media screen and (max-width: 1024px) {
  .main-container {
    flex-direction: column;
    gap: 12px;
    padding: 12px 15px;
    align-items: center;
  }
}
/* 태블릿 이하: 배너 문구 크기 축소 + 카드 그리드 열 수 축소 */
@media screen and (max-width: 1024px) {
  .banner-title {
    font-size: var(--font-h1);
  }
  .banner-content {
    padding: 32px;
  }
  .card-list,
  .miss-list {
    grid-template-columns: repeat(3, 1fr);
  }
  .best-cardlist {
    grid-template-columns: repeat(2, 1fr);
  }
}
/* 모바일 화면 (너비 768 이하 일떄) */
@media screen and (max-width: 768px) {
  .card-list,
  .best-cardlist,
  .miss-list {
    grid-template-columns: repeat(2, 1fr);
  }
  /* 배너: 사진 위 / 텍스트 아래로 세로 배치 */
  .banner-container {
    flex-direction: column;
    min-height: 0;
  }
  .banner-photo {
    flex: none;
    min-height: 170px;
  }
  .banner-content {
    flex: none;
    padding: 26px 20px;
    gap: 8px;
  }
  .banner-title {
    font-size: var(--font-h2);
  }
  .quick-list {
    gap: 18px 28px;
  }
  /* 통계 영역: 타일 세로로 쌓기 */
  .stats-section {
    padding: 20px;
  }
  .stats-tiles {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }
  .stats-tile {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
  }
  .stats-tile-value strong {
    font-size: var(--font-h2);
  }
  .donation-list {
    grid-template-columns: repeat(2, 1fr);
  }
}
