/* =========================================================
   회원 접근 공통 컴포넌트
   → /css/style.css 맨 아래에 붙여 넣기
   ① 항목 잠금 B : 값 잠금 (.lock-value)
      ※ 영역 잠금(A)은 새로 만들지 않고 기존 .locked-overlay 를 그대로 사용
        (blog-analysis-detail.css "등급 제한 오버레이" 블록)
   ②-b 안내 배너 (.info-banner)
   ③ 토스트 (.toast)
   ⑤-a 남은 횟수 표시 (.quota)
   ⑥ 권한 없는 페이지 : 랜딩 카드 (.landing-card) + 샘플 화면 (.sample-shot)
   ========================================================= */


/* ---------------------------------------------------------
   ① 항목 잠금 B : 값 잠금 (표 안의 값 자리에 넣는 칩)
   --------------------------------------------------------- */
.lock-value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #F1F1F1;
  color: #999999;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.lock-value svg {
  flex: none;
  width: 11px;
  height: 11px;
}


/* ---------------------------------------------------------
   ②-b 안내 배너 : 페이지 첫 부분(제목 위) 한 줄 상태 안내 (한 번에 하나만)
   .info-banner--trial 체험 중 / --warn 만료 임박 / --danger 결제 실패 / --free 무료회원
   · 체험 · 만료 임박은 닫기 있음, 결제 실패 · 무료회원은 닫기 없이 고정
   --------------------------------------------------------- */
.info-banner {
  container-type: inline-size; /* 배너 폭 기준으로 줄바꿈 (아래 @container) */
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 12px 18px;
  border: 1px solid #E5E5E5;
  border-radius: 10px;
  background: #FFFFFF;
  color: #1F2420;
  font-size: 13px;
  line-height: 1.5;
  word-break: keep-all;
}

.info-banner + .info-banner {
  margin-top: 10px;
}

/* 서브페이지 첫 부분 : 제목 위 자리 */
.page-hero .info-banner {
  margin-bottom: 24px;
}

.info-banner__tag {
  flex: none;
  padding: 3px 9px;
  border-radius: 999px;
  background: #F1F1F1;
  color: #555555;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.info-banner__text {
  flex: 1 1 0;
  min-width: 0;
}

.info-banner__text strong {
  font-weight: 700;
}

.info-banner__link {
  flex: none;
  color: #218A4C;
  font-weight: 700;
  white-space: nowrap;
}

.info-banner__link:hover {
  text-decoration: underline;
}

.info-banner__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  color: #AAAAAA;
}

.info-banner__close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #555555;
}

.info-banner__close svg {
  width: 12px;
  height: 12px;
}

/* 무료체험 중 */
.info-banner--trial {
  border-color: #DDF0E4;
  background: #F3FAF6;
}

.info-banner--trial .info-banner__tag {
  background: #42BC74;
  color: #FFFFFF;
}

/* 만료 임박 (D-3부터) */
.info-banner--warn {
  border-color: #F5DDAE;
  background: #FFF6E5;
  color: #6B4A0E;
}

.info-banner--warn .info-banner__tag {
  background: #F0B429;
  color: #FFFFFF;
}

.info-banner--warn .info-banner__link {
  color: #6B4A0E;
  text-decoration: underline;
}

/* 결제 실패 (정기결제 · 해결될 때까지 고정) */
.info-banner--danger {
  border-color: #F6CFCF;
  background: #FDF4F4;
}

.info-banner--danger .info-banner__tag {
  background: #FCE9E9;
  color: #C23434;
}

.info-banner--danger .info-banner__link {
  color: #C23434;
}


/* ---------------------------------------------------------
   ③ 토스트 : 화면 아래 가운데, .show 가 붙으면 보임
   (키챌 플래너의 .toast 와 같은 모양 · 같은 동작. 아이콘 · 링크만 추가)
   --------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 300;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 40px);
  padding: 10px 16px;
  border-radius: 10px;
  background: #1F2420;
  color: #FFFFFF;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
}

.toast__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #42BC74;
}

.toast__icon svg {
  width: 10px;
  height: 10px;
}

.toast--error .toast__icon {
  background: #E06666;
}

.toast__link {
  flex: none;
  margin-left: 4px;
  color: #8FE0B0;
  font-weight: 700;
  white-space: nowrap;
}


/* ---------------------------------------------------------
   ⑤-a 남은 횟수 표시 : 검색창(.search-box-sub) 바로 아래
   .quota--empty 오늘 횟수를 모두 씀 (뒤에 .quota__note 로 충전 안내)
   · 오른쪽 링크는 모두 '횟수 늘리기 ›' (멤버십 페이지)
   --------------------------------------------------------- */
.quota {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 10px;
  color: #6B6B6B;
  font-size: 12px;
  line-height: 1.5;
}

.quota__dots {
  display: inline-flex;
  gap: 3px;
}

/* 칸 하나 = 1회. 남은 횟수만큼 .is-on */
.quota__dots i {
  width: 14px;
  height: 5px;
  border-radius: 3px;
  background: #E4E7E2;
}

.quota__dots i.is-on {
  background: #42BC74;
}

.quota__count {
  color: #218A4C;
  font-weight: 700;
}

.quota--empty .quota__count {
  color: #C23434;
}

.quota__note {
  color: #6B6B6B;
}

.quota__link {
  margin-left: auto;
  color: #218A4C;
  font-weight: 700;
  white-space: nowrap;
}

.quota__link:hover {
  text-decoration: underline;
}


/* ---------------------------------------------------------
   안내 배너 : 배너 폭이 좁을 때 (모바일 · 좁은 본문 영역 모두)
   · 1줄 : 태그 + 닫기 / 2줄 : 문구 한 줄 전체 / 3줄 : 링크
   · 화면 폭이 아니라 배너 폭 기준이라 PC에서 영역이 좁아도 문구가 찌그러지지 않음
   --------------------------------------------------------- */
@container (max-width: 640px) {
  .info-banner__text {
    order: 3;
    flex: 1 1 100%;
  }

  .info-banner__link {
    order: 4;
  }

  .info-banner__close {
    order: 2;
    margin-left: auto;
  }
}


/* ---------------------------------------------------------
   반응형
   --------------------------------------------------------- */
@media (max-width: 768px) {
  .info-banner {
    padding: 12px 14px;
  }

  .toast {
    width: max-content;
  }

  .quota__link {
    margin-left: 0;
  }
}


/* ---------------------------------------------------------
   ⑥ 권한 없는 페이지 : 랜딩 카드 (.landing-card) + 샘플 화면 (.sample-shot)
   · 기준 : 피그마 '랜딩 샘플 (권한 없는 페이지) · 세병헌 시안' landing-card
   · 위치 : 페이지 히어로(제목 · 검색창) 바로 아래, 샘플 화면 위
   · 카드 = 태그(.landing-card__tag) + 제목 + 설명 + 오른쪽 버튼(.landing-card__cta)
     태그 : 회원가입 / 베이직 멤버십 / 스탠다드 멤버십 / 준비 중 (준비 중은 버튼 없음)
   · 샘플 이미지 = 현행 페이지 본문 캡처 + 대각선 '샘플 화면 입니다' 패턴이 이미 들어 있음
     (/images/sample/sample-{페이지}.png · 패턴 원본 /images/sample/sample-pattern.svg 820×1240 반복)
   --------------------------------------------------------- */
.landing-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  padding: 28px 32px;
  border: 1px solid #E5E5E5;
  border-radius: 12px;
  background: #FFFFFF;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  color: #1F2420;
  word-break: keep-all;
}

.landing-card__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.landing-card__tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: #E6F4EA;
  color: #218A4C;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.landing-card__title {
  margin: 0;
  padding: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.landing-card__desc {
  margin: 0;
  color: #555555;
  font-size: 14px;
  line-height: 1.2;
}

.landing-card__cta {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 12px 28px;
  border-radius: 999px;
  background: #333333;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
}

.landing-card__cta:hover {
  background: #1F2420;
  text-decoration: none;
}

.sample-shot {
  margin: -8px -12px 0;
  border-radius: 16px;
  overflow: hidden;
  user-select: none;
}

.sample-shot img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
}

@media (max-width: 768px) {
  /* 권한 없는 페이지 : 랜딩 카드는 위아래로, 버튼은 한 줄 전체 */
  .landing-card {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 22px 20px;
  }

  .landing-card__title {
    font-size: 18px;
    line-height: 1.4;
  }

  .landing-card__desc {
    line-height: 1.5;
  }

  .landing-card__cta {
    justify-content: center;
  }

  .sample-shot {
    margin: 0;
    border-radius: 12px;
  }
}
