/* Yoowon LDS — mobile / responsive overrides */

@media (max-width: 1280px) {
  .header-inner { width: 90%; gap: 18px; }
  .primary-nav .menu { gap: 50px; }
  .primary-nav .menu > li > a { padding: 12px 6px; font-size: 17px; }
}
@media (max-width: 1100px) {
  .header-inner { width: 94%; gap: 12px; }
  .primary-nav .menu { gap: 42px; }
  .primary-nav .menu > li > a { padding: 12px 4px; font-size: 16px; }
  .hero-inner.two-col { gap: 36px; }
  .news-grid { grid-template-columns: 1fr 1fr; }
  .news-quick { grid-column: span 2; }
  .timeline { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

@media (max-width: 980px) {
  :root { --header-h: 62px; }

  /* 로고는 좌측, 나머지(언어·CTA·햄버거)는 모두 우측, 햄버거는 맨 오른쪽 끝 */
  .header-inner { grid-template-columns: auto 1fr auto; gap: 8px; padding: 0 14px; }
  .brand-sub { display: none; }
  .brand-main { font-size: 16px; }
  .brand { justify-self: start; }
  .header-actions { justify-self: end; gap: 6px; }
  .header-actions .lang-switcher  { order: 1; }
  .header-actions .header-cta     { order: 2; }
  .header-actions .sitemap-trigger{ order: 3; margin-left: 2px; }
  /* 한·중·일 단어 단위 줄바꿈 — 어절 보존, 영문/숫자는 anywhere */
  body, .site-main, .hero-slide, .yw-section, .bento-cell, .post-body,
  .footer, .sm-row, .nv-card, .ind-card, .why-item {
    word-break: keep-all;
    overflow-wrap: anywhere;
    line-break: strict;
  }
  /* 표·코드 영역은 단어 단위 보존이 깨지면 안 되므로 제외 */
  pre, code, table, .board-table { word-break: normal; overflow-wrap: normal; }

  .primary-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    background: #fff; padding: 24px 24px 48px;
    transform: translateX(110%);
    transition: transform .3s var(--ease-out);
    overflow-y: auto;
    border-top: 1px solid var(--line);
    z-index: 150;
  }
  .primary-nav.open { transform: translateX(0); }
  .primary-nav .menu { flex-direction: column; gap: 0; }
  .primary-nav .menu > li { border-bottom: 1px solid var(--line-2); }
  .primary-nav .menu > li > a { padding: 18px 8px; font-size: 17px; font-weight: 600; color: var(--navy); }
  .primary-nav .menu > li > a::after { display: none; }
  .primary-nav .submenu {
    position: static; opacity: 1; visibility: visible; transform: none;
    min-width: 0; box-shadow: none; border: 0;
    padding: 0 0 12px 12px; margin-top: -8px;
  }
  .primary-nav .submenu li a { padding: 8px 8px; font-size: 14px; }
  /* Mobile: nested submenu also static (accordion-style), indented further */
  .primary-nav .submenu-2 {
    position: static; opacity: 1; visibility: visible; transform: none;
    min-width: 0; box-shadow: none; border: 0;
    padding: 0 0 6px 16px; margin: 0;
    background: transparent;
  }
  .primary-nav .submenu-2 li a {
    padding: 6px 8px; font-size: 13px;
    color: var(--fg-2);
  }
  .primary-nav .has-sub-2 > a .caret { display: none; }
  .primary-nav .has-sub-2 > a {
    font-weight: 600; color: var(--navy);
  }

  .header-cta span { display: none; }
  .header-cta { padding: 10px 12px; }
  .nav-toggle { display: flex; }

  /* Sitemap panel mobile — full width, side column on top */
  .sitemap-panel {
    width: 100vw;
    grid-template-columns: 1fr;
    grid-template-rows: 64px 1fr;
  }
  .sitemap-main {
    order: 2;
    padding: 32px 20px;
  }
  .sitemap-head { margin-bottom: 28px; gap: 16px; }
  .sitemap-logo { height: 32px; }
  .sitemap-title { font-size: 32px; }
  .sitemap-side {
    order: 1;
    flex-direction: row;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,.1);
  }
  .sitemap-side-foot { display: none; }
  .sitemap-close { padding: 10px; margin-left: auto; }
  .sm-row { grid-template-columns: 1fr; gap: 12px; padding: 20px 0; }
  .sm-cat { font-size: 18px; padding-top: 0; }
  .sm-items { font-size: 14px; }
  .sm-items a { padding: 5px 10px; }
  .sitemap-foot { font-size: 12px; gap: 10px; }

  /* Hero carousel mobile: stack — top photo, bottom content */
  .hero-carousel { min-height: 0; }
  .hero-slides { min-height: 0; }
  .hero-slide { grid-template-columns: 1fr; grid-template-rows: 240px auto; position: relative; }
  .hero-slide:not(.is-active) { position: absolute; inset: 0; }
  .hs-left::after { display: none; }
  .hs-overlay { background: linear-gradient(180deg, rgba(8,26,61,.95) 0%, rgba(15,42,94,.98) 100%); }
  .hs-content { padding: 36px 20px 64px; }
  .hs-title { font-size: 26px; }
  .hs-desc { font-size: 14px; margin-bottom: 24px; }
  .hs-cta { margin-bottom: 28px; }
  .hs-kpi { grid-template-columns: repeat(2, 1fr); gap: 12px 4px; padding-top: 18px; }
  .hs-kpi li { padding: 4px 4px; }
  .hs-kpi .n { font-size: 24px; }
  .hs-kpi .l { font-size: 11px; }
  .hero-dots { bottom: 16px; }
  .hd-dot { width: 24px; }
  .hd-dot.is-active { width: 42px; }
  .oem-strip { padding: 16px 18px; gap: 12px; }
  .oem-label { font-size: 10px; }
  .oem-logo { font-size: 13px; }
  .oem-divider { display: none; }
  .timeline { grid-template-columns: repeat(2, 1fr); gap: 18px; padding: 22px 18px; }

  .cl-inner { width: 92%; grid-template-columns: 1fr; gap: 12px; padding: 18px 0; }
  .cl-label { font-size: 10px; }
  .cl-logo { font-size: 17px; }
  .cl-s { font-size: 10px; }
  .cl-set { gap: 28px; padding-right: 28px; }
  .cl-track { animation-duration: 32s; }

  .yw-section { padding: 64px 0; }
  .yw-section#products > .container { width: 92%; padding: 0; }
  .yw-section#products .sec-desc { white-space: normal; }
  .yw-why { padding: 64px 0; }
  .yw-why > .container { width: 92%; padding: 0; }
  .sec-head { margin-bottom: 40px; }

  .bento { grid-template-columns: 1fr; grid-template-rows: auto; gap: 14px; }
  .bento-cell { padding: 24px; }
  .bento-lg { grid-row: auto; min-height: 360px; }
  .bento-wide { grid-column: auto; min-height: 240px; }
  .bento-name { font-size: 22px; }
  .bento-lg .bento-name { font-size: 26px; }
  .bento-sub { font-size: 15px; }
  .bento-list li { font-size: 14px; padding: 7px 0; }
  .card-meta-row { font-size: 14px; gap: 12px; padding: 8px 0; }
  .card-meta-row:first-of-type { padding-top: 14px; margin-top: 12px; }
  .cm-label { width: 64px; font-size: 11px; }

  .why-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .why-item { padding: 24px 20px; }
  .why-icon { width: 44px; height: 44px; }
  .why-icon svg { width: 22px; height: 22px; }
  .why-h { font-size: 16px; }
  .why-p { font-size: 14px; }

  .yw-section#industries > .container { width: 92%; padding: 0; }
  .ind-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .ind-card { padding: 28px 20px 22px; }
  .ind-num-bg { font-size: 88px; right: 8px; top: -12px; }
  .ind-ico { width: 46px; height: 46px; }
  .ind-ico svg { width: 22px; height: 22px; }
  .ind-name { font-size: 17px; }
  .ind-desc { font-size: 14px; }
  .ind-row { gap: 12px; margin-bottom: 14px; }
  .ind-grad-line { margin-bottom: 12px; }

  /* AI Search Era mobile */
  .yw-ai-era { padding: 64px 0; }
  .yw-ai-era > .container { width: 92%; padding: 0; }
  .aie-grid { grid-template-columns: 1fr; gap: 48px; }
  .phone-frame { width: 280px; height: 560px; padding: 11px; border-radius: 36px; }
  .phone-notch { width: 90px; height: 22px; top: 11px; }
  .phone-screen { border-radius: 26px; }
  .chat-head { padding: 32px 14px 12px; }
  .ai-bubble { font-size: 12px; padding: 7px 12px; }
  .ai-bubble-tl, .ai-bubble-bl { left: -16px; }
  .ai-bubble-tr, .ai-bubble-br { right: -16px; }
  .aie-h { font-size: 32px; line-height: 1.2; }
  .aie-p { font-size: 15px; }
  .aie-key { padding: 22px 22px; gap: 14px; }
  .aie-key-mark { width: 44px; height: 44px; border-radius: 11px; }
  .aie-key-mark svg { width: 24px; height: 24px; }
  .aie-key-text { font-size: 17px; }
  .aie-logos { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .ai-logo { padding: 18px 12px; }
  .ai-logo-mark { width: 44px; height: 44px; }
  .ai-logo-name { font-size: 13px; }

  .yw-news-v2 { padding: 64px 0; }
  .yw-news-v2 > .container { width: 92%; padding: 0; }
  .news-v2-grid { grid-template-columns: 1fr; gap: 18px; }
  .nv-card { padding: 28px 24px; }
  .nv-tag { font-size: 19px; }
  .nv-board-list a { font-size: 14px; }
  .nv-act { padding: 18px 20px; gap: 14px; }
  .nv-act-ico-wrap { width: 42px; height: 42px; }
  .nv-act-title { font-size: 16px; }
  .nv-act-sub { font-size: 12px; }

  .footer-cta { padding: 40px 20px; }
  .footer-cta .container { flex-direction: column; align-items: flex-start; }
  .fc-q { font-size: 18px; }

  .footer-grid { grid-template-columns: 1fr; gap: 36px; padding-bottom: 36px; }
  .footer-cols { grid-template-columns: repeat(4, 1fr); gap: 16px; }

  .board-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .board-title { font-size: 24px; }
  .board-tools { flex-direction: column; align-items: stretch; }
  .search { width: 100%; }
  .search input { flex: 1; }
  .board-table .meta-col:nth-child(n+5) { display: none; }
  .board-table th, .board-table td { font-size: 13px; padding: 10px 6px; }

  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .calendar td { min-height: 70px; height: 70px; padding: 4px; }
  .calendar td .d { font-size: 12px; }
  .cal-event { font-size: 10px; padding: 1px 4px; }

  /* 모바일에서는 80% → 92%로 넓혀 여백이 과하지 않게 */
  .board-page, .post-view, .post-write { width: 92%; max-width: none; }
  .post-view { padding: 32px 0 64px; }
  .board-page { padding: 28px 0 64px; }
  .post-write { padding: 32px 0 64px; }
  .post-head h1 { font-size: 24px; }
  .post-body { font-size: 15px; padding: 18px 0; }

  .write-form .row { grid-template-columns: 1fr; }

  .popup-stack { left: 16px !important; right: 16px !important; top: 50% !important; transform: translateY(-50%) !important; align-items: center; }
  .popup { width: calc(100vw - 32px) !important; max-width: 480px; margin: 0 auto; }
  .popup img { width: 100%; height: auto; }
}

@media (max-width: 640px) {
  .hero-h1 { font-size: clamp(24px, 7vw, 32px); }
  .hero-kpi { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .kpi { border-right: 0; padding-right: 0; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.1); }
  .kpi:nth-last-child(-n+2) { border-bottom: 0; }
  .why-grid { grid-template-columns: 1fr; }
  .ind-grid { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 20px; }
  .quick-tiles { grid-template-columns: repeat(2, 1fr); }
  .photo-grid { grid-template-columns: 1fr; }
}

/* ===========================================================
   Universal mobile hardening — Galaxy(360~412) / iPhone(375~430)
   가로 스크롤 방지 · 안전영역 · 터치영역 · 클램핑
   =========================================================== */

/* 1) 가로 오버플로우 차단 — 모든 디바이스 공통 */
html, body { max-width: 100vw; overflow-x: hidden; }
img, svg, video, iframe, table { max-width: 100%; }
.container, .yw-section, .post-view, .board-page, .post-write,
.hero-carousel, .footer-grid, .bento { max-width: 100%; }

/* 2) iOS 노치/다이내믹아일랜드/하단 홈바 안전영역 */
@supports (padding: env(safe-area-inset-top)) {
  .site-header { padding-top: env(safe-area-inset-top); }
  .site-header .header-inner { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  body { padding-bottom: env(safe-area-inset-bottom); }
  .sitemap-panel { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
}

/* 3) iOS 입력박스 자동 확대(16px 미만) 방지 */
input, select, textarea, button { font-size: 16px; }

/* 4) 최소 터치영역 44×44 (Apple HIG / Material 가이드라인) */
@media (max-width: 980px) {
  .lang-btn, .sitemap-trigger, .header-cta,
  .hd-dot, .btn, .btn-primary, .file-clear,
  .primary-nav .menu > li > a, .lang-menu li a,
  .submenu li a, .board-table a, .pagination a,
  .nv-board-list a, .nv-act, .footer a {
    min-height: 44px;
  }
  .lang-btn, .sitemap-trigger { min-width: 44px; }
}

/* 5) 480px 이하 — iPhone SE / iPhone 12 mini 가로(landscape) */
@media (max-width: 480px) {
  :root { --header-h: 58px; }
  .header-inner { padding: 0 12px; gap: 6px; }
  .header-cta { padding: 8px 10px; }
  .lang-btn { padding: 6px 10px; }

  .hs-content { padding: 28px 18px 56px; }
  .hs-title { font-size: clamp(22px, 6.8vw, 28px); }
  .hs-desc { font-size: 14px; line-height: 1.65; margin-bottom: 22px; }
  .hs-cta .btn-primary, .hs-cta .btn { padding: 12px 16px; font-size: 14px; }
  .hs-kpi { grid-template-columns: repeat(2, 1fr); gap: 14px 8px; }
  .hs-kpi .n { font-size: 22px; }
  .hs-kpi .l { font-size: 10.5px; }

  .sec-h, .sec-head h2 { font-size: clamp(22px, 6.8vw, 28px); }
  .sec-desc { font-size: 14px; }
  .bento-cell { padding: 20px 18px; }
  .bento-name { font-size: 20px; }
  .bento-lg .bento-name { font-size: 22px; }
  .bento-sub, .bento-list li { font-size: 13px; }
  .why-grid { grid-template-columns: 1fr; }
  .ind-grid { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr; gap: 20px; }
  .ai-bubble { font-size: 11px; padding: 6px 10px; }
  .phone-frame { width: 240px; height: 480px; }

  .timeline { grid-template-columns: 1fr; padding: 18px 14px; }
  .yw-section { padding: 48px 0; }

  /* 보드 리스트 — 좌우 padding 정리 + 폰트 축소 */
  .board-page, .post-view, .post-write { width: calc(100% - 24px); margin: 0 auto; }
  .board-head { gap: 10px; }
  .board-title { font-size: 22px; }
  .board-table th, .board-table td { font-size: 12px; padding: 8px 4px; }
  .board-table .meta-col:nth-child(n+4) { display: none; }
  .post-head h1 { font-size: 22px; }
  .post-body { font-size: 14.5px; }
  .post-body img { height: auto; }

  /* 팝업: 화면 가로 100% 거의 채움 */
  .popup { width: calc(100vw - 24px) !important; max-width: 360px; }
  .popup-stack { left: 12px !important; right: 12px !important; }

  /* AI 시대 섹션 텍스트 줄간격·크기 정리 */
  .aie-h { font-size: clamp(24px, 7vw, 30px); }
  .aie-p  { font-size: 14px; line-height: 1.7; }
  .aie-key { padding: 18px; gap: 12px; }
  .aie-key-text { font-size: 15px; }

  /* 헤더 CTA의 화살표 아이콘만 표시 (텍스트는 mobile.css 980px에서 숨김) */
  .header-cta svg { width: 14px; height: 14px; }
}

/* 6) 380px 이하 — Galaxy S22 / Fold 외부화면 / 아이폰 mini 세로 */
@media (max-width: 380px) {
  .header-inner { padding: 0 10px; gap: 4px; }
  .header-cta { padding: 7px 9px; border-radius: 999px; }
  .lang-btn { padding: 5px 8px; font-size: 11px; }
  .lang-btn svg:last-of-type { display: none; }
  .sitemap-trigger { padding: 8px; }
  .brand-logo { height: 32px; }

  .hs-title { font-size: clamp(20px, 6.5vw, 24px); }
  .hs-kpi .n { font-size: 19px; }
  .hs-kpi .l { font-size: 10px; }
  .bento-cell { padding: 18px 14px; }
  .bento-name { font-size: 18px; }
  .sec-h, .sec-head h2 { font-size: 22px; }

  /* 푸터: 카피라이트 한줄넘침 방지 */
  .footer { font-size: 12px; }
  .footer-cols { gap: 16px; }
}

/* 7) 가로(Landscape) 짧은 높이 — 헤더 슬림화 */
@media (max-width: 980px) and (orientation: landscape) and (max-height: 500px) {
  :root { --header-h: 52px; }
  .brand-logo { height: 28px; }
  .hero-slide { grid-template-rows: 180px auto; }
  .hs-content { padding: 24px 18px 32px; }
  .hs-kpi { padding-top: 14px; }
}

/* 8) 태블릿(768px 이하) — 헤더 햄버거 노출 시점 직전 grid 정리 */
@media (max-width: 768px) {
  .yw-section { padding: 56px 0; }
  .news-grid { grid-template-columns: 1fr; }
  .news-quick { grid-column: auto; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* 9) Google Maps iframe 모바일 비율 조정 */
@media (max-width: 980px) {
  iframe[src*="google.com/maps"], iframe[src*="maps.google"] {
    width: 100%;
    height: clamp(240px, 50vw, 360px);
    border: 0;
  }
}

/* 10) 폴더블 큰 화면(가로 800~1100px) — 사이트맵 그리드 1열로 정리 */
@media (min-width: 600px) and (max-width: 980px) {
  .sm-row { grid-template-columns: 140px 1fr; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
}

@supports (padding: env(safe-area-inset-bottom)) {
  body { padding-bottom: env(safe-area-inset-bottom); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* Hide PC-only line breaks on mobile */
@media (max-width: 980px) {
  .pc-br { display: none; }
}
