/* ============================================================
   주식회사놀이동무토왕성 — 모바일 공통 스타일
   - .mobile-page: 모바일 전용 파일의 공통 헤더·메뉴·푸터
   - @media: 기존 PC 페이지를 좁은 화면에서 볼 때의 공통 보정
   ============================================================ */

/* ── 모바일 전용 파일 기본값 ── */
.mobile-page,
.mobile-page * ,
.mobile-page *::before,
.mobile-page *::after {
  box-sizing: border-box;
}

.mobile-page {
  width: 100%;
  margin: 0;
  overflow-x: hidden;
  background: #fff;
  color: #2F312B;
  font-family: "Noto Sans KR", sans-serif;
}

.mobile-page.menu-open {
  overflow: hidden;
}

.mobile-page a {
  color: inherit;
  text-decoration: none;
}

.mobile-page img {
  display: block;
  max-width: 100%;
}

/* ── 모바일 전용 헤더 / 메뉴 ── */
.m-header {
  position: sticky;
  top: 0;
  z-index: 1100;
  background: rgba(255,255,255,.98);
  border-bottom: 1px solid #E3E7DF;
  backdrop-filter: blur(10px);
}

.m-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  padding: 0 16px;
  gap: 12px;
}

.m-logo {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.m-logo img {
  width: 92px;
  height: auto;
  max-height: 34px;
  object-fit: contain;
}

.m-menu-button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  flex-direction: column;
  width: 42px;
  height: 42px;
  margin-left: auto;
  padding: 0;
  gap: 3px;
  border: 1.5px solid #111;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.m-menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  background: #1F241F;
  line-height: 0;
}

body.menu-open .m-menu-button {
  background: #F7F7F5;
}

.m-dim {
  position: fixed;
  inset: 60px 0 0;
  z-index: 1098;
  display: none;
  background: rgba(24,33,27,.28);
}

body.menu-open .m-dim {
  display: block;
}

.m-menu {
  position: fixed;
  top: 68px;
  left: 12px;
  right: 12px;
  z-index: 1099;
  display: none;
  max-height: calc(100svh - 92px);
  padding: 10px;
  overflow-y: auto;
  border: 1px solid #E3E8E1;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(35,53,42,.20);
}

body.menu-open .m-menu {
  display: block;
}

.m-menu[aria-hidden="false"] {
  display: block;
}

.m-menu a {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: 13px;
  color: #2F3C33;
  font-size: 15px;
  font-weight: 800;
}

.m-menu a.active,
.m-menu a:hover,
.m-menu a:focus {
  background: #EEF6EE;
  color: #356F43;
}

.m-menu-quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid #EDF0EB;
}

.m-menu-quick a {
  justify-content: center;
  min-height: 42px;
  padding: 10px;
  background: #F6F8F2;
  font-size: 13px;
}

@media (max-width: 360px) {
  .m-nav { padding-inline: 14px; }
  .m-logo img { width: 84px; max-height: 32px; }
  .m-menu-button { width: 40px; height: 40px; flex-basis: 40px; }
}

/* ── 모바일 전용 푸터 ── */
.mobile-footer {
  padding: 42px 20px 28px;
  background: #26342B;
  color: rgba(255,255,255,.76);
}

.mobile-footer .footer-inner {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 0;
}

.mobile-footer .footer-brand {
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255,255,255,.13);
}

.mobile-footer .footer-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 11px;
  color: #D5F1CC;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

.mobile-footer .footer-label::before {
  content: "";
  width: 18px;
  height: 2px;
  background: currentColor;
}

.mobile-footer strong {
  display: block;
  margin: 0;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -.02em;
}

.mobile-footer .footer-tagline {
  margin: 8px 0 0;
  color: rgba(255,255,255,.67);
  font-size: 12px;
  line-height: 1.7;
  word-break: keep-all;
}

.mobile-footer .footer-info {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  background: rgba(255,255,255,.045);
}

.mobile-footer .footer-info-row {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  align-items: start;
}

.mobile-footer .footer-info dt {
  color: rgba(255,255,255,.52);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
}

.mobile-footer .footer-info dd {
  margin: 0;
  color: rgba(255,255,255,.88);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  word-break: break-word;
}

.mobile-footer .footer-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.mobile-footer .footer-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 8px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 11px;
  background: rgba(255,255,255,.035);
  color: rgba(255,255,255,.88);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  word-break: keep-all;
}

.mobile-footer .footer-links a:hover,
.mobile-footer .footer-links a:focus {
  border-color: rgba(213,241,204,.55);
  background: rgba(213,241,204,.10);
  color: #fff;
}

.mobile-footer .footer-copy {
  margin: 20px 0 0;
  color: rgba(255,255,255,.42);
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}

/* ── 기존 PC 페이지의 모바일 공통 보정 ── */
@media (max-width: 700px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  .header {
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  .nav-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 68px;
    height: auto;
    padding: 0 18px;
    gap: 12px;
  }

  .nav-logo {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    margin: 0;
  }

  .nav-logo img {
    width: auto;
    height: 40px !important;
    max-width: none;
    object-fit: contain;
  }

  .nav-utils {
    display: none !important;
  }

  .nav-hamburger {
    display: inline-grid !important;
    place-items: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    margin-left: auto;
    padding: 0;
    border: 1px solid #E2DED5;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(31,49,37,.05);
  }

  .nav-hamburger svg {
    width: 22px !important;
    height: 16px !important;
    transform: scaleY(.72) !important;
    transform-origin: center center !important;
  }

  .nav-hamburger svg rect:nth-child(1) {
    transform: translateY(3px) !important;
  }

  .nav-hamburger svg rect:nth-child(3) {
    transform: translateY(-3px) !important;
  }

  .nav-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 14px;
    right: 14px;
    z-index: 1001;
    display: none;
    flex-direction: column;
    width: auto;
    max-height: calc(100vh - 100px);
    margin: 0;
    padding: 10px;
    gap: 0;
    overflow-y: auto;
    list-style: none;
    border: 1px solid #E3E8E3;
    border-radius: 16px;
    background: rgba(255,255,255,.98);
    box-shadow: 0 18px 40px rgba(27,49,37,.16);
    backdrop-filter: blur(10px);
  }

  .nav-menu.menu-open {
    display: flex;
  }

  .nav-menu li {
    width: 100%;
  }

  .nav-menu a {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
  }

  .footer {
    padding: 0;
  }

  .footer-inner {
    padding: 32px 20px;
  }

  .footer-top {
    display: grid;
    grid-template-columns: 1fr;
    gap: 26px;
    margin-bottom: 22px;
    padding-bottom: 26px;
  }

  .footer-nav-group ul {
    gap: 9px;
  }

  .footer-bottom {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: flex-start;
  }

  .footer-info {
    font-size: 12px;
    line-height: 1.75;
    word-break: keep-all;
  }

  .footer-links {
    gap: 16px;
  }

  h1,
  h2,
  h3,
  h4,
  p,
  span,
  a,
  li,
  dd,
  dt {
    word-break: keep-all;
    overflow-wrap: break-word;
  }

  /* index.php를 좁은 화면에서 강제로 볼 때 */
  .top-slide {
    height: 400px;
    min-height: 400px;
    max-height: 400px;
  }

  .top-slide-content {
    align-items: center;
    padding-top: 0;
  }

  .top-slide-copy {
    width: calc(100% - 36px);
  }

  .top-slide-kicker {
    margin-bottom: 8px;
    font-size: 10px;
    line-height: 1.4;
    letter-spacing: .08em;
  }

  .top-slide-title {
    max-width: 320px;
    margin-bottom: 10px;
    font-size: clamp(24px, 7vw, 30px);
    line-height: 1.3;
    letter-spacing: -.05em;
  }

  .top-slide-title span {
    display: block;
  }

  .top-slide-text {
    max-width: 300px;
    font-size: 13px;
    line-height: 1.6;
  }

  .top-slide-link {
    min-height: 40px;
    margin-top: 14px;
    padding: 9px 14px;
    font-size: 12px;
  }

  .top-slide-prev,
  .top-slide-next {
    display: none;
  }

  .top-slide-dots {
    bottom: 15px;
    gap: 8px;
  }

  .top-slide-dot {
    width: 9px;
    height: 9px;
    border-width: 1.5px;
  }

  .intro-section,
  .program-section,
  .rights-section,
  .main-cta {
    padding: 60px 20px;
  }

  .intro-inner,
  .rights-inner {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .program-head {
    display: block;
  }

  .program-head .section-desc {
    margin-top: 12px;
  }

  .program-grid {
    grid-template-columns: 1fr;
  }

  .main-cta p br {
    display: none;
  }

  .site-popup {
    padding: 16px;
  }

  .site-popup-dialog {
    max-height: calc(100svh - 32px);
    overflow-y: auto;
  }

  .site-popup-image,
  .site-popup-fallback {
    min-height: 180px;
    max-height: 260px;
  }

  .site-popup-body {
    padding: 22px 21px 18px;
  }

  .site-popup-footer {
    padding: 14px 21px;
  }
}

@media (max-width: 380px) {
  .top-slide {
    height: 340px;
    min-height: 340px;
    max-height: 340px;
  }

  .top-slide-title {
    font-size: 22px;
  }

  .top-slide-text {
    font-size: 12px;
  }
}

@media (max-width: 360px) {
  .mobile-footer {
    padding-inline: 16px;
  }

  .mobile-footer .footer-links {
    grid-template-columns: 1fr;
  }

  .mobile-footer .footer-links a {
    min-height: 40px;
  }
}
