/* Mobile + media integrity — all phone viewports */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* 수강후기: 흰 카드 + 흰 글자 버그 방지 (번들 CSS보다 늦게 로드) */
@media (max-width: 719px) {
  .review-quote {
    background: #fff !important;
    color: #101c2c !important;
  }
  .review-quote p,
  .review-quote p:not(.stars) {
    color: #101c2c !important;
  }
  .review-quote .stars {
    color: #c98900 !important;
  }
  .review-quote .muted {
    color: #33475f !important;
  }
  .section-dark .review-quote {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
  }
  .section-dark .review-quote p {
    color: #fff !important;
  }
  .section-dark .review-quote .muted,
  .section-dark .muted {
    color: rgba(255, 255, 255, 0.88) !important;
  }
  .section-dark .section-head h2 {
    color: #fff !important;
  }
}
/* body overflow-x:clip 제거 — 모바일 fixed 플로팅 CTA 유지 (가로 넘침은 main에서 처리) */
body {
  overflow-x: visible;
}
main#main {
  overflow-x: clip;
  max-width: 100%;
}
img {
  max-width: 100%;
  height: auto;
}
.hero-bleed__media img,
.why-item__media img,
.method-panel img,
.teacher-photo img,
.course-card img,
.board-thumb img,
.post-thumb img,
.post-block__media img,
.post-hero-media img,
.card-media img,
.feature-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}
.hero-bleed__media img {
  object-position: center 30%;
}
.post-thumb img,
.teacher-photo img {
  height: 100%;
}

@media (max-width: 719px) {
  .container {
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }

  /* Hero: 첫 화면이 버튼 더미에 먹히지 않게 */
  .hero-bleed {
    min-height: auto !important;
    height: auto !important;
    margin-top: calc(-1 * (var(--header-h) + 24px));
    padding-top: calc(var(--header-h) + 28px);
    align-items: end;
  }
  .hero-bleed__media img {
    object-position: center 24%;
    transform: none !important;
    animation: none !important;
  }
  .hero-bleed__content {
    padding: 16px 0 20px;
    max-width: 100%;
  }
  /* 히어로 카피 오버레이는 mobile-read.css에서 숨김 */
  /* 문자·카톡 나란히 + 레벨테스트 한 줄 — 세로 3단 금지 */
  .hero-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    max-width: 100% !important;
  }
  .hero-actions .btn {
    min-height: 44px;
    width: 100%;
    font-size: 0.9rem;
    padding: 10px 8px;
  }
  .hero-actions .btn:nth-child(3) {
    grid-column: 1 / -1;
    min-height: 42px;
    font-size: 0.88rem;
  }

  /* Trust rail — no overflow clip */
  .trust-rail {
    margin-top: -18px !important;
    overflow: visible !important;
    border-radius: 16px;
  }
  .trust-rail__item {
    padding: 14px 10px !important;
    min-height: 72px;
    overflow: visible;
  }
  .trust-rail__item strong {
    font-size: clamp(1rem, 4vw, 1.2rem) !important;
  }
  .trust-rail__item span {
    font-size: 11.5px !important;
    line-height: 1.35 !important;
  }

  /* Wide cinematic crops → 16/10 on phones */
  .board-card--wide .board-thumb,
  .post-block--wide .post-block__media img,
  .post-block__media img,
  .post-hero-media img {
    aspect-ratio: 16 / 10 !important;
  }
  .board-thumb {
    aspect-ratio: 16 / 10;
  }
  .post-hero-media,
  .post-block__media {
    border-radius: 14px;
    overflow: hidden;
  }
  .post-hero-media img,
  .post-block__media img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: center;
  }

  .post-card {
    grid-template-columns: 80px 1fr !important;
    gap: 10px;
    padding: 10px;
  }
  .post-thumb {
    width: 80px !important;
    height: 60px !important;
  }
  .post-card h3 {
    font-size: 13.5px !important;
    -webkit-line-clamp: 2;
    word-break: keep-all;
  }

  .course-grid,
  .grid-2,
  .why-band,
  .teacher-grid,
  .post-grid,
  .method-split,
  .seo-related,
  .related-grid,
  .footer-grid,
  .level-track {
    grid-template-columns: 1fr !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .card,
  .course-card,
  .form-shell,
  .level-card,
  .post-card,
  .board-card {
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }
  .card-media,
  .course-card img,
  .card img {
    max-width: 100%;
  }
  main,
  .section,
  .section-tight {
    overflow-x: clip;
  }
  .stats {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px;
  }
  .method-panel img,
  .why-item__media img,
  .course-card img,
  .card-media img {
    aspect-ratio: 16 / 10;
    height: auto;
    object-fit: cover;
  }
  .teacher-photo {
    aspect-ratio: 1 / 1;
  }
  .teacher-photo img {
    object-position: center top;
  }

  .article {
    padding: 14px !important;
    overflow: hidden;
  }
  .article img {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 10px 0;
    border-radius: 12px;
    object-fit: cover;
  }

  .page-hero {
    padding: 24px 0 16px;
  }
  .page-hero h1 {
    font-size: clamp(1.35rem, 6.2vw, 1.85rem) !important;
    word-break: keep-all;
    line-height: 1.3;
  }
  .section {
    padding: 32px 0;
  }
  .section-head h2 {
    font-size: clamp(1.25rem, 5.5vw, 1.6rem) !important;
    word-break: keep-all;
  }
  .section-head p,
  .muted {
    word-break: keep-all;
  }

  .board-body h3 {
    font-size: 0.96rem;
    word-break: keep-all;
  }
  .board-summary {
    -webkit-line-clamp: 2;
  }

  .mobile-cta {
    gap: 6px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  }
  .mobile-cta a {
    min-height: 44px;
    font-size: 13.5px;
    border-radius: 12px;
  }
  /* float-side는 home-promo.css에서 모바일용으로 표시 */
  /* 하단 CTA에 본문 안 가리게 */
  body {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .final-cta,
  .region-cta,
  .consult-banner {
    margin-bottom: 4px;
  }
  .section {
    padding: 28px 0 !important;
  }
  .section-tight {
    padding: 22px 0 !important;
  }

  .nav-drawer {
    max-height: calc(100dvh - var(--header-h) - 48px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav-drawer a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .form-shell,
  .consult-banner,
  .final-cta,
  .region-cta {
    overflow: hidden;
  }
  .btn {
    word-break: keep-all;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .hero-bleed h1 {
    font-size: 1.45rem !important;
  }
  .hero-bleed .lead {
    font-size: 0.88rem !important;
    -webkit-line-clamp: 3;
  }
  .trust-rail__item {
    padding: 12px 8px !important;
  }
  .post-card {
    grid-template-columns: 68px 1fr !important;
  }
  .post-thumb {
    width: 68px !important;
    height: 51px !important;
  }
}

/* Short viewport (landscape phones / small height) */
@media (max-width: 719px) and (max-height: 640px) {
  .hero-bleed {
    padding-top: calc(var(--header-h) + 16px);
  }
  .hero-bleed__content {
    padding-bottom: 12px;
  }
  .hero-bleed .lead {
    display: none;
  }
  .hero-actions .btn {
    min-height: 40px;
    font-size: 0.86rem;
  }
}

/* 상담 배너 4버튼 — 모바일 2x2 */
@media (max-width: 719px) {
  .consult-banner .hero-actions,
  .final-cta .hero-actions,
  .enroll-aside .hero-actions,
  .region-cta .hero-actions {
    grid-template-columns: 1fr 1fr !important;
  }
  .consult-banner .hero-actions .btn:nth-child(3),
  .final-cta .hero-actions .btn:nth-child(3),
  .enroll-aside .hero-actions .btn:nth-child(3),
  .region-cta .hero-actions .btn:nth-child(3),
  .consult-banner .hero-actions .btn:nth-child(4),
  .final-cta .hero-actions .btn:nth-child(4),
  .enroll-aside .hero-actions .btn:nth-child(4),
  .region-cta .hero-actions .btn:nth-child(4) {
    grid-column: auto;
  }
}
