/* 모바일·태블릿 반응형 (PC 기준). PC 모양을 바꾸지 않도록 max-width 미디어쿼리 안에만 쓴다 */

/* ---------- 태블릿·모바일 공통 (1024px 이하) ---------- */
@media (max-width: 1024px) {
  html, body { overflow-x: hidden; }
  .rh, .rh h1, .rh h2, .rh h3, .rh p, .rh li, .rh dd, .rh dt, .rh span, .rh a, .rh button, .rh label { word-break: keep-all; overflow-wrap: break-word; }
  .rh img, .rh video, .rh svg { max-width: 100%; }
  .rh img { height: auto; }
  .rh-cta__symbol { object-fit: contain; }

  /* 버튼 위 글씨는 흰색 (라이트 파랑 / 다크 빨강 버튼) */
  .rh { --btn-text: #fff; }
  .rh-cmp--mine { --mine-text: #fff; --mine-line: #ffffff38; }
  .rh[data-theme=light] { --accent: #2348b8; }
  .hm-skip, .ct-submit { color: var(--btn-text__t, var(--btn-text)) !important; }

  /* 화면 밖(-9999px)으로 밀어 둔 요소는 제자리에서 잘라 숨긴다 (가로 넘침 방지) */
  .rh-skip, .hm-skip { left: 12px; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; padding: 0; }
  .rh-skip:focus, .hm-skip:focus { left: 12px; clip-path: none; width: auto; height: auto; overflow: visible; padding: 10px 16px; }
  .rh-hp { left: 0; clip-path: inset(50%); }

  /* ---------- 머리글: 햄버거 메뉴 ---------- */
  .rh-nav__in {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    column-gap: 8px;
    height: auto;
    min-height: 64px;
  }
  .rh-nav__links { display: contents; }
  .rh-logo { grid-row: 1; grid-column: 1; display: inline-flex; align-items: center; min-width: 0; }
  .rh-logo img { width: 116px; height: auto; }
  .rh-nav__links > .rh-theme { grid-row: 1; grid-column: 2; }
  .rh-nav__links > .rh-btn { grid-row: 1; grid-column: 3; white-space: nowrap; }
  .m-nav-btn {
    grid-row: 1; grid-column: 4;
    display: inline-flex !important;
    flex-direction: column; justify-content: center; align-items: center; gap: 5px;
    width: 44px; height: 44px;
    border: 1px solid var(--border); border-radius: 12px;
    background: var(--bg); color: var(--text__t, var(--text));
    cursor: pointer;
  }
  .m-nav-btn span { display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .2s, opacity .2s; }
  #m-nav:checked ~ .m-nav-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  #m-nav:checked ~ .m-nav-btn span:nth-child(2) { opacity: 0; }
  #m-nav:checked ~ .m-nav-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* 접힌 상태: PC 메뉴 항목은 숨김 → 체크되면 머리글 아래로 펼침 */
  .rh-nav__links > a.rh-hide-m { display: none !important; }
  #m-nav:checked ~ .rh-nav__links > a.rh-hide-m {
    display: flex !important;
    grid-column: 1 / -1;
    align-items: center;
    min-height: 52px;
    padding: 0 4px;
    border-top: 1px solid var(--border);
    color: var(--text__t, var(--text)) !important;
    font-size: 16px; font-weight: 600;
  }
  #m-nav:checked ~ .rh-nav__links > a.rh-hide-m:last-of-type { margin-bottom: 8px; }

  /* ---------- 공통 배치 ---------- */
  .rh-wrap { padding-inline: 20px; box-sizing: border-box; max-width: 100%; }
  .rh h1 { font-size: clamp(28px, 7.4vw, 44px); line-height: 1.3; }
  .rh h2 { font-size: clamp(22px, 5.8vw, 32px); line-height: 1.38; }
  .rh-sec-head--row { flex-direction: column; align-items: flex-start; gap: 16px; }
  .rh-shops__links { flex-wrap: wrap; }
  .rh-compare, .rh-pricing, .rh-principle, .rh-problem, .rh-cta, .rh-report-grid { grid-template-columns: 1fr; }
  .rh-kpis--six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rh-foot__in { flex-direction: column; gap: 24px; }
  .rh-foot__links { flex-wrap: wrap; }
}

@media (max-width: 1024px) and (prefers-color-scheme: light) {
  .rh:not([data-theme=dark]) { --accent: #2348b8; }
}
@media (max-width: 1024px) and (prefers-color-scheme: no-preference) {
  .rh:not([data-theme=dark]) { --accent: #2348b8; }
}

/* ---------- 모바일 (640px 이하) ---------- */
@media (max-width: 640px) {
  .rh-wrap { padding-inline: 16px; }
  .rh-hero__actions { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
  .rh-hero__actions .rh-btn { width: 100%; justify-content: center; }
  .rh-services, .rh-steps, .rh-steps--five, .rh-vows, .rh-shops, .dir-grid { grid-template-columns: 1fr; }
  .rh-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rh-phone { max-width: 340px; }
  .ct-grid, .ct-fields { grid-template-columns: 1fr; }
  .ct-times__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ct-hero__title { font-size: clamp(28px, 8vw, 40px); }
}

@media (max-width: 380px) {
  .rh-nav__links > .rh-btn { padding-inline: 12px; }
  .rh-logo img { width: 100px; }
}
