/* ===============================
   성공사례 공통 레이아웃 스타일
   (색상은 CSS 변수로, 테마는 success_cases_themes.css에서 제어)
   =============================== */

body {
  font-family: 'Noto Sans KR','Inter',sans-serif;
  margin-top: 3rem;
  background-color: var(--page-bg) !important;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-main);
}

/* 상단 헤더 전체 래핑 */
.case-header-wrap {
  max-width: 1180px;
  margin: 40px auto 0;
}

/* 타이틀 블록 */
.case-header-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.case-eyebrow {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.case-title-main {
  font-size: 30px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.case-subcopy {
  font-size: 18px;
  color: var(--text-sub);
}

.case-count-badge {
  font-size: 13px;
  color: var(--text-pager-muted);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--section-bg);
  white-space: nowrap;
}
.case-count-badge strong {
  font-weight: 700;
  color: var(--text-main);
}

/* 타이틀 아래 얇은 라인 */
.case-header-line {
  margin-top: 18px;
  height: 2px;
  background: linear-gradient(
    to right,
    var(--text-main),
    var(--text-main) 160px,
    var(--border-subtle) 160px,
    var(--border-subtle) 100%
  );
}

/* 카테고리 필터 영역 (오버라이드: 배경/패딩 제거, 좌측 정렬) */
.case-filter-shell {
  margin-top: 14px;
  padding: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.case-filter-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 4px;
  white-space: nowrap;
}

.case-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  font-weight: 800;
}

/* 필터 pill */
.case-filter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 10px 24px;
  background: var(--pill-bg);
  border: 1px solid transparent;
  color: var(--pill-text);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.case-filter-pill:hover {
  background-color: var(--pill-hover-bg);
  color: var(--pill-text-hover);
  transform: translateY(-1px);
  border-color: #9ca3af;
}

.case-filter-pill.is-active {
  border: 2px solid var(--border-strong);
  padding: 8px 20px;
  color: var(--text-main);
  font-weight: 700;
  background: #fdfdfd;
  box-shadow: 0 0 0 1px rgba(15,23,42,.04);
}

/* 리스트 컨테이너 폭 */
.case-list-wrap {
  max-width: 1180px;
  margin: 28px auto 64px;
}

/* 카드 */
.case-card {
  background: var(--card-bg);
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card-soft);
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-grow: 1;
  padding: 18px 18px 16px;
  text-decoration: none;
  color: inherit;
}

.case-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
}

.case-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* 태그 */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.card-tags .tag {
  background-color: var(--tag-bg);
  color: var(--tag-text);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

/* 카드 내부 레이아웃 */
.debt-card-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.chart-area {
  flex: 0 0 auto;
}

/* 도넛 차트 스타일 */
.card-blue-chart {
  --p: 0%;
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: conic-gradient(
    var(--m-col) 0%,
    var(--m-col-light) calc(var(--p, 0%) - 0.08%),
    var(--chart-rest-bg) calc(var(--p, 0%) + 0.08%) 100%
  );
  display: flex;
  justify-content: center;
  align-items: center;
  will-change: background;
}

.card-blue-chart::after {
  content: "";
  position: absolute;
  width: 94px;
  height: 94px;
  background: var(--card-bg);
  border-radius: 50%;
}

.card-blue-chart .inner-text {
  position: absolute;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
}

.card-blue-chart .inner-text .rate {
  color: var(--m-col);
  font-size: 30px !important;
  font-weight: 800;
}

.card-blue-chart .inner-text .label {
  color: var(--text-soft);
  font-size: 15px !important;
  font-weight: 600;
}

/* 우측 정보 영역 */
.info-blue {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.info-blue .top {
  text-align: center;
  margin-bottom: 4px;
}

.info-blue .top .ttl {
  display: block;
  font-size: 15px !important;
  color: #4B5563 !important;
  margin-bottom: 4px;
  font-weight: 600;
}

.info-blue .top .val {
  font-size: 22px !important;
  color: #191F28;
  font-weight: 800;
}

.info-blue .arrow-icon {
  margin: 2px 0 6px 0;
  color: #B0B8C1;
  display: flex;
  justify-content: center;
}

/* 월 변제금 카드 */
.pay-blue {
  position: relative;
  background: linear-gradient(135deg, var(--m-col), var(--m-col-light));
  width: 100%;
  border-radius: 12px;
  padding: 14px 0 12px;
  text-align: center;
  color: #ffffff;
  box-shadow: var(--shadow-pay);
}

.pay-blue .lb {
  font-size: 18px;
  opacity: 0.9;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.pay-blue .val {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.pay-blue .divider {
  height: 1px;
  background-color: rgba(255, 255, 255, 0.2);
  margin: 6px 16px 6px;
}

.pay-blue .sub {
  font-size: 16px;
  opacity: 0.9;
  font-weight: 400;
  color: yellow;
}

/* 데스크탑에서 카드 최소 높이 맞추기 */
@media (min-width: 768px) {
  .case-card {
    min-height: 260px;
  }
}

/* 모바일(<=768px)에서 헤더/필터, 카드 사이즈 조정 */
@media (max-width: 768px) {
  .case-header-wrap {
    margin-top: 24px;
  }
  .case-header-top {
    flex-direction: column;
    align-items: flex-start;
  }
  .case-title-main {
    font-size: 24px;
  }

  .case-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .case-filter-pill {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    font-weight: 800;
  }

  .case-card {
    padding: 16px 14px;
  }
  .card-blue-chart {
    width: 96px;
    height: 96px;
  }
  .card-blue-chart::after {
    width: 82px;
    height: 82px;
  }
  .card-blue-chart .inner-text .rate {
    font-size: 20px;
  }
  .debt-card-body {
    gap: 8px;
  }
}

/* 퀵메뉴 정렬 */
#quick ul li {
  text-align: center !important;
}
#quick ul li a {
  display: block !important;
  width: 100% !important;
  text-decoration: none;
}
#quick ul li a img,
#quick ul li a h3 {
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
#quick ul li a h3 {
  text-align: center !important;
}

/* 사이트맵 정렬 */
#sitemap .site_in {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#sitemap .site_close {
  display: inline-block;
  margin: 0 auto;
}

/* 전체 폭 확장 */
.case-header-wrap,
.case-list-wrap {
  max-width: 1350px;
  margin-left: auto;
  margin-right: auto;
}

/* px-4 때문에 들어간 좌우 패딩 제거 (Tailwind 사용 시) */
.case-header-wrap,
.case-list-wrap {
  padding-left: 0;
  padding-right: 0;
}

/* 페이저 */
.case-pager {
  margin-top: 40px;
  display: flex;
  justify-content: center;
}

.case-pager-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
}

.pager-link,
.pager-current,
.pager-arrow {
  min-width: 36px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--pager-border);
  background: var(--pager-bg);
  color: var(--text-pager-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  text-decoration: none;
  transition:
    background-color .16s ease,
    border-color .16s ease,
    color .16s ease,
    box-shadow .16s ease,
    transform .16s ease;
}

.pager-link:hover,
.pager-arrow:hover {
  border-color: var(--border-strong);
  color: var(--border-strong);
  box-shadow: var(--shadow-pager-hover);
  transform: translateY(-1px);
}

.pager-current {
  background: var(--pager-active-bg);
  border-color: var(--pager-active-bg);
  color: var(--pager-active-text);
  font-weight: 700;
  box-shadow: var(--shadow-pager-current);
  cursor: default;
  transform: none;
}

.pager-arrow {
  font-size: 13px;
  padding: 0 16px;
  gap: 4px;
}

.pager-arrow.is-disabled {
  background: var(--section-bg);
  color: var(--text-pager-disabled);
  border-color: var(--pager-border);
  cursor: default;
  box-shadow: none;
  pointer-events: none;
  transform: none;
}

/* 모바일에서 페이저 버튼 줄바꿈 */
@media (max-width: 640px) {
  .case-pager {
    padding: 0 12px;
  }

  .case-pager-list {
    gap: 4px;
    flex-wrap: wrap;
  }

  .pager-link,
  .pager-current,
  .pager-arrow {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    font-size: 12px;
  }
}

/* 페이저 안내 문구 */
.pager-notice {
  margin-top: 16px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--pager-notice-bg);
  color: var(--text-on-dark);
  font-size: 13px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.pager-notice strong {
  font-weight: 700;
  color: var(--pager-notice-accent);
}

/* 헤더 등장 애니메이션 */
.case-header-anim {
  animation: caseHeaderFade 0.6s ease-out;
  animation-fill-mode: both;
}

@keyframes caseHeaderFade {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================
   총 채무(강조) 색연필 사선 (좌상 → 우하)
   - 텍스트 뒤로(가독성)
   - 길이에 따라 각도 JS로 조절(--strike-deg)
========================= */

.info-blue .top .val.val-crayon{
  position: relative;
  display: inline-block;
  font-weight: 800;
  line-height: 1.15;
  color: #191F28;
  overflow: visible;
  z-index: 0;

  --strike-deg: 10deg;
}

.info-blue .top .val.val-crayon .crayon-bg{
  content: "";
  position: absolute;
  left: -6px;
  right: -6px;

  top: 50%;
  transform: translateY(-50%) rotate(calc(var(--strike-deg) * -1));
  transform-origin: center;

  height: 10px;
  border-radius: 999px;

  z-index: -1;
  pointer-events: none;

  background:
    repeating-linear-gradient(
      90deg,
      rgba(201, 37, 43, 0.34) 0px,
      rgba(201, 37, 43, 0.34) 2px,
      rgba(201, 37, 43, 0.20) 4px,
      rgba(201, 37, 43, 0.20) 7px
    ),
    rgba(201, 37, 43, 0.55);

  filter: blur(0px);
}

.info-blue .top .val.val-crayon .crayon-text{
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 0;
}

@media (max-width: 768px){
  .info-blue .top .val.val-crayon .crayon-bg{
    height: 8px;
    left: -4px;
    right: -4px;
  }
}

/* =========================
   모바일 body 상단 여백 정리
   - 768 이하: 일단 0
   - 680 이하: 헤더 높이(63px)로 고정
========================= */
@media (max-width: 768px){
  body{
    margin-top: 0 !important;
  }
}

@media (max-width: 680px){
  body{
    margin-top: 63px !important;
  }
}

/* =========================
   성공사례 페이지만: 하단 퀵메뉴 높이 줄이기
========================= */
@media (max-width: 680px){
  .success-cases-page #quick ul{
    padding: 6px 0 !important;
  }
  .success-cases-page #quick ul li a{
    padding: 6px 4px !important;
    gap: 0 6px !important;
  }
  .success-cases-page #quick ul li img{
    max-width: 20px !important;
    max-height: 20px !important;
  }
  .success-cases-page #quick ul li a h3{
    font-size: 12px !important;
    line-height: 1 !important;
  }

  .success-cases-page .footer{
    padding-bottom: 90px !important;
  }
}

/* =========================================================
  모바일: 성공사례 카드 "가운데 스냅" 가로 슬라이드 (스샷처럼)
  - 가운데 카드 + 옆 카드 살짝 노출
========================================================= */
@media (max-width: 768px){
  /* .case-list-wrap .grid{
    display: flex !important;
    flex-wrap: nowrap !important;

    overflow-x: auto !important;
    overflow-y: visible !important;

    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;

    gap: 16px !important;

    padding: 10px 20px 44px !important;
    margin-left: -20px !important;
    width: 100vw !important;
  } */

  .case-list-wrap .grid::-webkit-scrollbar{
    display: none;
  }

  .case-list-wrap .grid::before,
  .case-list-wrap .grid::after{
    content: "";
    flex: 0 0 20px;
  }

  /* .case-list-wrap a.case-card{
    flex: 0 0 auto !important;
    width: 75vw !important;
    min-width: 260px !important;
    max-width: 340px !important;

    scroll-snap-align: center;
  } */
}

@media (max-width: 380px){
  .case-list-wrap a.case-card{
    width: 82vw !important;
    max-width: 330px !important;
  }
}
/* =========================
   모바일: 필터 태그( pill )만 작게
========================= */
@media (max-width: 768px){

  .case-filter-row{
    gap: 6px 6px !important;   /* 간격 축소 */
  }

  .case-filter-pill{
    flex: 0 0 auto !important; /* 50% 강제(큰 버튼) 해제 */
    padding: 6px 10px !important;
    font-size: 12px !important;
    line-height: 1.1 !important;
    font-weight: 700 !important;
  }

  .case-filter-pill.is-active{
    padding: 5px 9px !important;  /* active도 동일하게 작게 */
  }
}

@media (max-width: 380px){
  .case-filter-pill{
    padding: 5px 8px !important;
    font-size: 11px !important;
  }
}
@media (max-width: 768px){
  /* 카드 세로 리스트 유지 + 가운데 정렬 */
  .case-list-wrap .grid{
    display: grid !important;
    grid-template-columns: 1fr !important;
    justify-items: center !important;  /* 카드 가운데 */
  }

  .case-list-wrap a.case-card{
    width: 100% !important;
    max-width: 360px !important;      /* 원하는 폭 (340~380 조절) */
    flex: none !important;            /* flex:0 0 auto 제거 */
    scroll-snap-align: unset !important;
  }

  /* 가로 스와이프용 before/after도 제거 */
  .case-list-wrap .grid::before,
  .case-list-wrap .grid::after{
    content: none !important;
  }
}

@media (max-width: 380px){
  .case-list-wrap a.case-card{
    max-width: 330px !important;
  }
}
