/* ============================================================
   새빛드론 – 모바일 최적화 (전 페이지 공통)
   style.css / pages.css 이후에 로드되어 모바일 규칙을 덮어씀
   ============================================================ */

/* ───────── 공통: 가로 넘침 원천 차단 ───────── */
html, body { max-width: 100%; overflow-x: hidden; }
img, video, iframe { max-width: 100%; }
/* grid/flex 자식이 내용 때문에 부모보다 커지는 것 방지 */
.course-detail-left, .course-detail-right,
.news-list-col, .news-sidebar,
.contact-grid > *, .map-layout > *, .ab-poster-row > *, .ab-facility-row > * { min-width: 0; }

@media (max-width: 768px) {

  /* ───────── 탭 터치 영역 / 폰트 ───────── */
  body { -webkit-text-size-adjust: 100%; }
  a, button { -webkit-tap-highlight-color: rgba(0,200,200,.15); }

  /* ───────── 서브페이지 히어로 ───────── */
  .page-hero { padding: 112px 0 44px; }            /* 공지 28 + 헤더 56 = 84 + 여백 */
  .page-hero-content h1 { font-size: 1.7rem; margin: 8px 0 10px; }
  .page-hero-content p { font-size: .92rem; line-height: 1.7; }
  .page-hero-content p br { display: none; }
  .page-breadcrumb { font-size: .78rem; }

  /* ───────── 교육과정: 스티키 탭 ───────── */
  .course-nav-bar { top: 84px; }
  .course-tabs {
    padding: 0 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    /* 더 있음을 암시하는 우측 페이드 */
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 36px), transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 36px), transparent 100%);
  }
  .course-tab { padding: 13px 14px; font-size: .82rem; scroll-snap-align: start; }

  /* ───────── 교육과정: 섹션 ───────── */
  .course-section { padding: 48px 0; }
  .course-detail-grid { gap: 28px; }
  .course-number { font-size: 2.4rem; }
  .course-detail-left h2 { font-size: 1.5rem; }
  .course-lead { font-size: .92rem; margin-bottom: 20px; }
  .course-lead br { display: none; }
  .course-highlights { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 24px; }
  .highlight-item { padding: 12px; gap: 10px; flex-direction: column; align-items: flex-start; }
  .highlight-item i { margin-top: 0; }
  .highlight-item strong { font-size: .74rem; }
  .highlight-item span { font-size: .82rem; line-height: 1.4; }

  /* 커리큘럼: 세로 타임라인으로 전환 (가로 스크롤 제거) */
  .curriculum-timeline {
    display: flex !important;
    flex-direction: column;
    gap: 0 !important;
    overflow: visible !important;
    padding: 0 0 0 4px;
    position: relative;
  }
  .curriculum-timeline::before {
    display: block !important;
    top: 8px; bottom: 8px; left: 27px; right: auto;
    width: 2px; height: auto;
    background: linear-gradient(180deg, var(--teal), rgba(0,200,200,.25));
  }
  .ct-item {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    gap: 14px;
    padding: 0 0 16px;
  }
  .ct-item:last-child { padding-bottom: 0; }
  .ct-step { width: 48px; height: 48px; font-size: .72rem; margin: 0; border-width: 3px; }
  .ct-content { padding: 12px 14px; }
  .ct-content strong { font-size: .88rem; }
  .ct-content span { font-size: .8rem; }

  /* 포스터: 과도하게 길지 않게 */
  .course-img-wrap.poster-figure { max-width: 340px; margin-left: auto; margin-right: auto; }
  .poster-figure .poster-zoom-hint { font-size: .68rem; padding: 5px 9px; }
  .course-info-card { padding: 20px; }
  .btn-enroll { width: 100%; justify-content: center; }

  /* ───────── 메인: 섹션 공통 ───────── */
  .section { padding: 56px 0; }
  .section-header { margin-bottom: 32px; }
  .section-title { font-size: 1.5rem !important; }
  .section-desc { font-size: .9rem !important; }
  .section-desc br { display: none; }

  /* 메인: 뉴스 스트립 */
  .home-news-strip { padding: 48px 0 56px; }
  .home-news-title { font-size: 1.5rem; }

  /* 메인: 교육 패널 */
  .edu-panel { min-height: 240px; }
  .edu-panel-content { padding: 22px 18px; }
  .edu-panel h3 { font-size: 1.2rem; }
  .edu-panel p { font-size: .82rem; }
  .edu-panel p br { display: none; }

  /* 메인: CTA */
  .cta-section { padding: 56px 0; }
  .cta-text h2 { font-size: 1.4rem; }
  .cta-text p { font-size: .92rem; }
  .cta-actions { width: 100%; flex-direction: column; gap: 10px; }
  .cta-actions a { width: 100%; justify-content: center; }

  /* 메인: 갤러리 미리보기 2열 */
  .gallery-preview-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }

  /* ───────── 푸터 ───────── */
  .site-footer { padding-top: 40px; }
  .footer-grid { gap: 22px; }
  .footer-links ul, .footer-contact ul { font-size: .9rem; }
  .footer-tags { gap: 5px 6px; }
  .footer-tags span { font-size: .68rem; padding: 3px 9px; }
  .footer-bottom { font-size: .76rem; }

  /* ───────── 챗봇 ───────── */
  .chatbot-box { width: calc(100vw - 24px); right: -4px; max-height: 70vh; }

  /* ───────── 상담문의 ───────── */
  .contact-info-card { padding: 22px 18px; }
  .quick-contact-btns { grid-template-columns: 1fr 1fr; gap: 8px; }
  .quick-contact-btn { font-size: .82rem; padding: 12px 8px; }
  .contact-form-card { padding: 24px 18px; }
  .si-form { padding: 24px 16px; }
  .si-type-bar { gap: 8px; }
  .si-type-item { min-width: calc(33.33% - 6px); padding: 12px 6px; font-size: .72rem; }
  .map-section-wrap { padding: 44px 0 52px; }
  .map-embed-wrap, .map-static-link, .map-static-img { min-height: 240px; }
  .map-static-caption { left: 10px; bottom: 10px; padding: 10px 12px; }
  .map-static-caption strong { font-size: .88rem; }
  .map-static-caption span { font-size: .74rem; }

  /* ───────── 새빛소식 ───────── */
  .news-hero { padding: 108px 0 36px; }
  .news-hero h1 { font-size: 1.7rem; }
  .news-hero::before { font-size: 5rem; }
  .news-main { padding: 32px 0 56px; }
  .pinned-card { grid-template-columns: 1fr; }
  .pinned-img { height: 180px; }
  .pinned-body { padding: 18px; }
  .pinned-title { font-size: 1.05rem; }
  .news-grid { grid-template-columns: 1fr; gap: 14px; }
  .news-sidebar { display: flex; flex-direction: column; gap: 14px; }
  .news-modal-box { max-height: 92vh; border-radius: 14px; }
  .news-modal-body { padding: 18px 16px 24px; }

  /* ───────── 교육원 소개 ───────── */
  .ab-poster-row { gap: 20px; padding-bottom: 28px; }
  .ab-poster-img { max-width: 320px; }
  .ab-facility-row { gap: 16px; padding: 22px 0; }
  .ab-facility-title { font-size: .98rem; }
  .ab-facility-desc { font-size: .86rem; }
  .instructor-cert-banner { flex-wrap: wrap; gap: 14px 0; padding: 20px 12px; }
  .cert-item { flex: 1 1 45%; }
  .cert-divider { display: none; }
  .cert-item strong { font-size: 1.3rem; }

  /* ───────── 용역업무 / 제품 ───────── */
  .service-grid { grid-template-columns: 1fr; }
  .dji-products-grid { grid-template-columns: 1fr 1fr; gap: 12px; }

  /* ───────── 라이트박스 ───────── */
  .poster-lightbox { padding: 12px; }
  .poster-lightbox-img { max-width: 100%; max-height: 82vh; border-radius: 8px; }
  .poster-lightbox-close { top: 10px; right: 10px; width: 38px; height: 38px; }
}

/* ───────── 메인 히어로(모바일 정지화면 모드) 통계 2×2 — 최종 우선순위 보장 ───────── */
@media (max-width: 768px) {
  .hero.hero-still .hero-stats {
    display: grid !important; grid-template-columns: 1fr 1fr !important;
    gap: 8px !important; width: 100%; max-width: 360px; justify-content: stretch;
  }
  .hero.hero-still .stat-divider { display: none !important; }
  .hero.hero-still .stat-item {
    display: grid !important; grid-template-columns: auto auto; grid-template-rows: auto auto;
    column-gap: 3px; justify-content: center; align-items: baseline;
    padding: 10px 6px !important; margin: 0 !important; flex: none !important;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 12px;
  }
  .hero.hero-still .stat-num { font-size: 1.6rem !important; line-height: 1; }
  .hero.hero-still .stat-unit { font-size: .9rem !important; }
  .hero.hero-still .stat-label { font-size: .74rem !important; margin-top: 4px; grid-column: 1 / -1; text-align: center; }
}

@media (max-width: 480px) {
  /* 갤러리: 1열 대신 2열 (스크롤 길이 절반) */
  .gallery-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }
  .course-highlights { grid-template-columns: 1fr; }
  .dji-products-grid { grid-template-columns: 1fr; }
  .quick-contact-btns { grid-template-columns: 1fr; }
  .si-type-item { min-width: calc(50% - 4px); }
  .cert-item { flex: 1 1 45%; }
  .page-hero-content h1 { font-size: 1.55rem; }
  .course-img-wrap.poster-figure { max-width: 100%; }
  .edu-panel { min-height: 220px; }
}

/* 가로 모드 폰 (높이가 낮은 경우) */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  .hero.has-video .hero-title { font-size: 1.6rem; margin-bottom: 8px; }
  .hero.has-video .hero-sub { font-size: .85rem; margin-bottom: 12px; }
  .hero.has-video .hero-cta { margin-bottom: 14px; }
  .hero.has-video .stat-num { font-size: 1.4rem; }
}
