/* =========================================================
   모바일 가독성 최대화 — 모든 화면 공통 (≤719px)
   액정 폭 기준으로 타이포·여백·터치·대비·이미지 비율 통일
   ========================================================= */

@media (max-width: 719px) {
  :root {
    --m-pad: max(16px, env(safe-area-inset-left));
    --m-pad-r: max(16px, env(safe-area-inset-right));
    --m-text: 17px;
    --m-lead: 1.65;
    --m-ink: #0e1a2b;
    --m-muted: #2f4258;
    --m-touch: 48px;
  }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    font-size: var(--m-text) !important;
    line-height: var(--m-lead) !important;
    color: var(--m-ink) !important;
    /* overflow-x:clip 은 iOS에서 position:fixed CTA를 스크롤에 묶어 버림 → main에만 적용 */
    overflow-x: visible !important;
    word-break: keep-all;
    overflow-wrap: anywhere;
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    padding-right: 0;
  }
  main#main {
    overflow-x: clip;
    max-width: 100%;
  }

  .container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: var(--m-pad) !important;
    padding-right: var(--m-pad-r) !important;
    box-sizing: border-box;
  }

  /* ——— 타이포 ——— */
  h1,
  .page-hero h1,
  .hero-bleed h1 {
    font-size: clamp(1.55rem, 7.2vw, 2.05rem) !important;
    line-height: 1.28 !important;
    letter-spacing: -0.02em;
    color: inherit;
    word-break: keep-all;
  }

  h2,
  .section-head h2 {
    font-size: clamp(1.35rem, 6vw, 1.7rem) !important;
    line-height: 1.32 !important;
    word-break: keep-all;
  }

  h3,
  .card h3,
  .level-card h3,
  .teacher-card h3,
  .step h3,
  .method-panel h3,
  .post-card h3,
  .board-body h3 {
    font-size: 1.12rem !important;
    line-height: 1.35 !important;
    word-break: keep-all;
  }

  p,
  li,
  .muted,
  .lead,
  .section-head p,
  .faq-item p,
  .article p,
  .review-quote p {
    font-size: 1.02rem !important;
    line-height: 1.65 !important;
    word-break: keep-all;
  }

  .muted {
    color: var(--m-muted) !important;
  }

  .review-marquee-band .section-head h2,
  .review-marquee-band h2 {
    color: #ffffff !important;
  }
  .review-marquee-band .section-head .muted,
  .review-marquee-band .section-head p,
  .review-marquee-band .muted {
    color: rgba(255, 255, 255, 0.92) !important;
  }
  .review-marquee-band .eyebrow,
  .review-marquee-band .section-head .eyebrow {
    color: #f0d78c !important;
  }

  .eyebrow {
    font-size: 0.78rem !important;
    letter-spacing: 0.08em;
  }

  .topbar {
    font-size: 12.5px !important;
    line-height: 1.45 !important;
    padding: 8px 12px !important;
  }

  /* ——— 섹션 리듬 ——— */
  .section {
    padding: 34px 0 !important;
  }
  .section-tight {
    padding: 24px 0 !important;
  }
  .page-hero {
    padding: 22px 0 14px !important;
  }
  .section-head {
    margin-bottom: 18px !important;
    max-width: 100% !important;
  }
  .section-head.center {
    text-align: left !important; /* 모바일: 좌측 정렬이 읽기 쉬움 */
  }

  /* ——— 그리드 전부 1열 ——— */
  .course-grid,
  .grid-2,
  .why-band,
  .teacher-grid,
  .post-grid,
  .method-split,
  .seo-related,
  .related-grid,
  .footer-grid,
  .level-track,
  .steps,
  .price-grid,
  .faq-list {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .stats,
  .trust-rail {
    grid-template-columns: 1fr 1fr !important;
  }

  /* ——— 카드·본문 ——— */
  .card,
  .course-card,
  .level-card,
  .teacher-card,
  .post-card,
  .board-card,
  .review-quote,
  .faq-item,
  .form-shell,
  .step,
  .method-panel,
  .article,
  .final-cta,
  .consult-banner,
  .region-cta,
  .promo-shot,
  .curric-shot {
    max-width: 100% !important;
    width: 100%;
    box-sizing: border-box;
  }

  .card,
  .level-card,
  .teacher-card,
  .step,
  .review-quote,
  .faq-item,
  .method-panel {
    border-radius: 16px !important;
  }

  .card h3 + .muted,
  .level-card__body .muted,
  .step .muted {
    font-size: 0.98rem !important;
    color: var(--m-muted) !important;
  }
  /* 다크 패널 본문은 흰 글자 유지 (네이비 배경에 진한 글자 금지) */
  .method-panel .muted,
  .method-panel--home .muted {
    font-size: 0.98rem !important;
    color: rgba(255, 255, 255, 0.92) !important;
  }
  .ev-banner--form,
  .ev-banner--form .ev-banner__title {
    color: #fff !important;
  }
  .ev-banner--form .ev-banner__lead {
    color: rgba(255, 255, 255, 0.92) !important;
  }
  .ev-banner--form .ev-banner__lead strong {
    color: #f0d78c !important;
  }
  .ev-banner--form .ev-banner__points li {
    color: rgba(255, 255, 255, 0.92) !important;
  }
  .ev-banner--form .ev-banner__warn {
    color: #fff8e6 !important;
  }
  .ev-banner--form .ev-banner__note {
    color: rgba(255, 255, 255, 0.9) !important;
    opacity: 1 !important;
  }

  .review-quote {
    background: #fff !important;
    color: var(--m-ink) !important;
    padding: 18px 16px !important;
  }
  .review-quote p {
    color: var(--m-ink) !important;
  }
  .review-quote .stars {
    color: #c98900 !important;
    font-size: 1.05rem !important;
  }
  .review-quote .muted {
    color: var(--m-muted) !important;
  }

  .section-dark {
    color: #fff !important;
  }
  .section-dark .section-head h2,
  .section-dark h2 {
    color: #fff !important;
  }
  .section-dark .muted {
    color: rgba(255, 255, 255, 0.9) !important;
  }
  .section-dark .review-quote {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
  }
  .section-dark .review-quote p {
    color: #fff !important;
  }
  .section-dark .review-quote .muted {
    color: rgba(255, 255, 255, 0.88) !important;
  }

  /* ——— FAQ ——— */
  .faq-item summary {
    font-size: 1.05rem !important;
    line-height: 1.45 !important;
    min-height: var(--m-touch);
    padding: 14px 12px !important;
    word-break: keep-all;
  }
  .faq-item p {
    padding: 0 12px 14px !important;
    color: var(--m-ink) !important;
  }

  /* ——— 버튼·터치 ——— */
  .btn,
  .mobile-cta a,
  .cta-stack .btn,
  .final-cta__actions .btn {
    min-height: var(--m-touch) !important;
    font-size: 1rem !important;
    padding: 12px 14px !important;
    border-radius: 14px !important;
    word-break: keep-all;
  }

  /* 히어로 위 CTA는 모바일에서 숨김 — efficiency-pass와 동일 */
  .hero-bleed .hero-actions,
  .page-hero .hero-actions {
    display: none !important;
  }

  .final-cta__actions,
  .consult-banner .hero-actions,
  .region-cta .hero-actions,
  .enroll-aside .hero-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  .final-cta__actions .btn:nth-child(n + 3),
  .consult-banner .hero-actions .btn:nth-child(n + 3),
  .region-cta .hero-actions .btn:nth-child(n + 3) {
    grid-column: auto;
  }

  .cta-stack {
    gap: 10px !important;
  }
  .cta-stack .btn,
  .btn-block {
    width: 100% !important;
  }

  /* ——— 이미지 비율 (폰 액정) ——— */
  .card-media,
  .card-media img,
  .course-card img,
  .method-panel img,
  .why-item__media img,
  .level-card__media,
  .level-card__media img,
  .promo-shot__media,
  .board-thumb,
  .post-block__media img,
  .post-hero-media img,
  .feature-media img {
    aspect-ratio: 16 / 10 !important;
    width: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
  }

  .teacher-photo,
  .teacher-photo img {
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    object-position: center top !important;
  }

  .curric-shot img {
    aspect-ratio: 16 / 10 !important;
    object-fit: cover !important;
  }

  .promo-shot {
    grid-template-columns: 1fr !important;
  }
  .promo-shot__body {
    padding: 16px !important;
  }
  .promo-shot__body h3 {
    font-size: 1.25rem !important;
    color: #fff !important;
  }
  .promo-shot__body p {
    color: rgba(255, 255, 255, 0.88) !important;
    font-size: 0.98rem !important;
  }

  /* ——— 히어로: 모바일은 사진+버튼만 (글자 오버레이 제거) ——— */
  .hero-bleed {
    min-height: min(72dvh, 560px) !important;
    height: auto !important;
  }
  .hero-bleed__shade {
    background: linear-gradient(
      180deg,
      rgba(4, 10, 20, 0.2) 0%,
      rgba(4, 10, 20, 0.08) 40%,
      rgba(4, 10, 20, 0.72) 100%
    ) !important;
  }
  .hero-bleed__content {
    padding: 0 0 18px !important;
    display: flex !important;
    flex-direction: column;
    justify-content: flex-end;
    min-height: min(72dvh, 560px);
  }
  .hero-bleed .brand-signal,
  .hero-bleed .lead {
    display: none !important;
  }
  /* SEO·접근성용 h1은 남기고 화면에서만 숨김 */
  .hero-bleed h1 {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    font-size: 1px !important;
    color: transparent !important;
  }

  /* ——— 신뢰 레일 ——— */
  .trust-rail {
    margin-top: -14px !important;
    border-radius: 16px !important;
  }
  .trust-rail__item {
    padding: 14px 10px !important;
    min-height: 76px;
  }
  .trust-rail__item strong {
    font-size: 1.05rem !important;
    line-height: 1.3 !important;
  }
  .trust-rail__item span {
    font-size: 12.5px !important;
    line-height: 1.4 !important;
    color: var(--m-muted) !important;
  }

  /* ——— 강사 ——— */
  .teacher-card {
    grid-template-columns: 96px 1fr !important;
    gap: 12px !important;
    padding: 12px !important;
    align-items: center;
  }
  .teacher-photo {
    width: 96px !important;
    height: 96px !important;
  }
  .teacher-meta {
    font-size: 13px !important;
    gap: 6px !important;
    flex-wrap: wrap;
  }
  .teacher-tags .tag,
  .tag {
    font-size: 12px !important;
    padding: 4px 8px !important;
  }

  /* ——— 게시글/지역 ——— */
  .post-card {
    grid-template-columns: 88px 1fr !important;
    gap: 12px !important;
    padding: 12px !important;
  }
  .post-thumb {
    width: 88px !important;
    height: 66px !important;
  }
  .post-card h3 {
    font-size: 1rem !important;
    -webkit-line-clamp: 2;
  }
  .article {
    padding: 16px !important;
  }
  .article img {
    width: 100% !important;
    height: auto !important;
    border-radius: 12px;
    margin: 12px 0;
  }

  /* ——— 폼 ——— */
  input,
  select,
  textarea,
  .form-shell input,
  .form-shell select,
  .form-shell textarea {
    font-size: 16px !important; /* iOS 줌 방지 */
    min-height: var(--m-touch);
    line-height: 1.4;
  }
  label {
    font-size: 0.98rem !important;
  }

  /* ——— 헤더·메뉴 ——— */
  .site-header .brand strong {
    font-size: 1.05rem !important;
  }
  .menu-btn {
    min-height: 40px;
    min-width: 64px;
    font-size: 0.95rem !important;
  }
  .nav-drawer a {
    min-height: var(--m-touch) !important;
    font-size: 1.05rem !important;
    padding: 12px 4px !important;
  }

  /* ——— 하단 CTA ——— */
  .mobile-cta {
    gap: 8px !important;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .mobile-cta a {
    min-height: 50px !important;
    font-size: 15px !important;
    font-weight: 800;
  }

  /* 플로팅은 float-cta.css 우선 */
  main {
    padding-right: 0;
  }

  /* ——— 다크 CTA 영역 대비 ——— */
  .final-cta,
  .region-cta,
  .method-panel {
    word-break: keep-all;
  }
  .final-cta h2,
  .region-cta h2 {
    font-size: clamp(1.3rem, 5.8vw, 1.65rem) !important;
    color: #fff !important;
  }
  .final-cta .muted,
  .region-cta .muted,
  .method-panel .muted {
    color: rgba(255, 255, 255, 0.9) !important;
  }

  /* ——— 레벨 카드 ——— */
  .level-card__body {
    padding: 14px 14px 16px !important;
  }
  .level-card__id {
    font-size: 0.95rem !important;
  }

  /* ——— 푸터 ——— */
  .site-footer {
    padding: 32px 0 24px !important;
    font-size: 0.98rem !important;
  }
  .footer-links a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    font-size: 1rem !important;
  }

  /* 가로 넘침 차단 */
  img,
  video,
  iframe,
  svg {
    max-width: 100% !important;
  }
  .card,
  .level-card,
  .teacher-card,
  .post-card,
  .board-card,
  .article,
  .form-shell,
  .promo-shot,
  .final-cta,
  .method-panel {
    overflow-x: clip;
  }
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* 아주 작은 폰 */
@media (max-width: 380px) {
  body {
    font-size: 16.5px !important;
  }
  h1,
  .page-hero h1,
  .hero-bleed h1 {
    font-size: 1.45rem !important;
  }
  .mobile-cta a {
    font-size: 13.5px !important;
  }
  .teacher-card {
    grid-template-columns: 80px 1fr !important;
  }
  .teacher-photo {
    width: 80px !important;
    height: 80px !important;
  }
}

/* 짧은 높이(가로 모드) */
@media (max-width: 719px) and (max-height: 520px) {
  .hero-bleed .lead {
    display: none !important;
  }
  .section {
    padding: 20px 0 !important;
  }
}
