/* ════════════════════════════════════════
   RESPONSIVE — 미디어 쿼리 전체
   ════════════════════════════════════════ */

/* why-section 로고 워터마크: 카드 그리드와 겹치지 않는 넓은 화면에서만 노출 */
@media (max-width: 1600px) {
  .why-watermark { display: none; }
}

@media (max-width: 1024px) {
  nav {
    padding: 0 24px;
    background: var(--cream);
    border-bottom: 1px solid rgba(139, 111, 71, 0.1);
  }

  /* 모바일: 스크롤 전에도 로고 텍스트 갈색 고정 */
  nav.nav-sub:not(.scrolled) .logo {
    color: var(--brown-deep);
  }
  .nav-links { display: none; } /* 모바일에서는 메뉴 버튼을 통한 진입으로 대체 */

  .btn-reserve { display: none; } /* 모바일에서 예약하기 버튼 숨김 */

  .btn-menu { display: flex; } /* 모바일 버전에서만 다시 노출 */
  
  .btn-menu span { background: var(--brown-deep); } /* 햄버거 버튼 색상 지정 */

  .nav-links.mobile-active {
    display: flex;
    position: absolute; /* fixed 대신 absolute 사용 */
    top: 72px; /* 헤더 높이만큼 띄움 */
    left: 0;
    width: 100%;
    min-height: calc(100vh - 72px); /* 화면 전체 높이 확보 */
    background: var(--brown-deep);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* 가독성 향상: 위쪽 정렬 */
    padding-top: 50px;
    gap: 20px;
    z-index: 9999;
    margin: 0;
    overflow-y: auto; /* 메뉴가 길 경우 스크롤 허용 */
  }
  
  .nav-links.mobile-active a {
    color: var(--white); /* 가독성을 위해 텍스트 흰색으로 변경 */
  }

  /* 요청2: 메뉴 펼쳐졌을 때 처음부터 다 펼쳐짐 */
  .nav-links.mobile-active .submenu {
    display: block !important;
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 10px 0 10px 20px !important;
  }
  .nav-links.mobile-active .has-submenu > a::after {
    display: none; /* 서브메뉴 화살표 숨김 */
  }
  .nav-links.mobile-active .submenu li a {
    color: rgba(255,255,255,0.7) !important;
  }

  .hero {
    grid-template-columns: 1fr;
    height: auto;
    min-height: auto;
  }

  .hero-sidebar {
    padding: 60px 24px 40px; /* 패딩을 줄여 텍스트 영역 압축 */
    order: 2;
    align-items: center;    /* 모바일에서는 중앙 정렬 */
    text-align: center;
  }

  .scroll-indicator { display: none; } /* 모바일에서 스크롤 인디게이터 숨김 */

  .hero-title-block {
    margin: 0 auto 28px;    /* 모바일 중앙 정렬 */
  }

  .hero:not(.hero-immersive) .hero-video-wrap {
    height: 35vh; /* 비디오 높이를 50vh에서 35vh로 줄여 아래 콘텐츠 노출 유도 */
    order: 1;
    margin-top: 72px; /* 모바일 nav가 불투명이라 영상 상단이 가려지지 않도록 nav 높이만큼 아래로 이동 */
  }

  /* 태블릿·모바일에서는 16:9 전용 영상으로 전환 */
  .hero:not(.hero-immersive) .hero-video-pc { display: none; }
  .hero:not(.hero-immersive) .hero-video-mobile { display: block; }

  .hero-video-text {
    right: 24px;
    text-align: left;
  }

  .play-btn-wrap {
    right: 24px;
    bottom: 40px;
  }

  .btn-link {
    display: inline-flex; /* 모바일·태블릿에서는 버튼을 눌러 카드를 펼치는 방식이므로 노출 */
  }

  .cards-overlap {
    grid-template-columns: 1fr;
    margin-top: 0;
    padding: 0 24px 60px;
    gap: 20px;
    display: none; /* 버튼을 누르기 전까지는 숨김 */
  }

  .cards-overlap.expanded {
    display: grid;
    animation: cardsExpand 0.4s ease;
  }

  @keyframes cardsExpand {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .cards-spacer { display: none; }
  .treatment-card { margin-top: 0 !important; }

  .about {
    grid-template-columns: 1fr;
    padding: 80px 24px;
    gap: 60px;
  }

  .about-visual { height: 420px; }

  .process-section { 
    height: auto; 
    padding-bottom: 40px; 
    background: var(--brown-deep); 
    color: var(--white);           
  }
  .video-overlay-content {
    position: static;
    transform: none;
    padding: 60px 24px 40px;
    max-width: none;
  }
  .section-eyebrow {
    font-weight: bold;
  }

  .career-list li::before {
    display: none;
  }
  .career-list li {
    padding-left: 0;
  }
  .career-list li span {
    font-size: 13.5px !important;
  }

  .process-section .section-body {
    display: none;
  }

  .mobile-process-video {
    display: block;
    width: 100%;
    height: 50vh;
    margin: 5px 0; /* 기존 20px에서 10px로 축소 */
    position: relative;
    overflow: hidden;
    line-height: 0;
    font-size: 0;
  }
  .mobile-process-video iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    min-width: 178vh;
    min-height: 56.25vw;
    object-fit: cover;
    transform: translate(-50%, -50%);
    pointer-events: none;
    border: none; /* 테두리 제거 */
    display: block; /* 여백 발생 방지 */
  }

  .desktop-only { display: none; }
  .mobile-only { display: block; }

  .video-float-card {
    position: relative; 
    margin-top: -40px; 
    width: calc(100% - 48px);
    margin-left: auto;
    margin-right: auto;
    left: 0;
    right: 0;
    
    /* 글래스모피즘 스타일 */
    background: rgba(253, 250, 246, 0.7) !important; /* 약간 더 불투명하게 조정 */
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
    
    color: var(--brown-deep) !important;
    padding: 24px !important; 
    z-index: 20; 
  }

  .float-card-title, 
  .float-card-items p {
    color: var(--brown-deep) !important;
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
  }

  .programs { padding: 80px 24px; aspect-ratio: auto; }
  .programs-header { flex-direction: column; align-items: flex-start; gap: 20px; }
  .programs-grid { grid-template-columns: 1fr; }
  .testimonial-grid { grid-template-columns: 1fr; }

  .location-cta { grid-template-columns: 1fr; }
  .location-map { height: clamp(220px, 30vw, 320px); }
  .location-info { padding: 60px 24px; }
  .info-grid { grid-template-columns: 1fr; }
  .info-label { font-family: 'Noto Serif KR', serif; }

  footer .en {
    font-weight: bold;
  }

  footer {
    flex-direction: column;
    gap: 32px;
    text-align: center;
    padding: 60px 24px;
  }
  .footer-links { flex-wrap: wrap; justify-content: center; gap: 16px 24px; }
}

@media (max-width: 600px) {
  /* ── 섹션 여백 축소 ── */
  .clinic-section {
    padding: 52px 20px;
  }

  /* ── 섹션 상단 골드 구분선 ── */
  .clinic-section {
    border-top: 1px solid rgba(139,111,71,0.25);
  }
  .clinic-section-dark {
    border-top: 1px solid rgba(191,160,100,0.3);
  }
  .clinic-section:first-of-type {
    border-top: none;
  }

  /* ── 섹션 번호 강조 ── */
  .clinic-section-number {
    font-size: 11px;
    letter-spacing: 0.35em;
    margin-bottom: 14px;
  }
  .clinic-section-number::after {
    width: 60px;
  }

  /* ── clinic-section-alt 제목 크기 축소 ── */
  .clinic-section-alt .clinic-section-title {
    font-size: clamp(22px, 4.5vw, 28px);
  }

  /* ── process-layout 모바일 비율 ── */
  .process-video-wrap {
    display: none;
  }
  .process-steps,
  .process-steps.steps-3 {
    grid-template-columns: 1fr;
    gap: 36px 0;
  }
  .process-steps::before,
  .process-steps.steps-3::before {
    display: none;
  }
  .process-step {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    text-align: left;
    padding: 0;
  }
  .step-dot-wrap {
    flex-shrink: 0;
    margin-bottom: 0;
  }
  .step-dot {
    width: 64px;
    height: 64px;
  }
  .step-dot-num {
    font-size: 8px;
  }
  .step-dot-label {
    font-size: 12px;
  }
  .step-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .step-title {
    font-size: 14px;
    margin-bottom: 0;
    margin-top: 0;
  }
  .step-desc {
    font-size: 12px;
    line-height: 1.6;
  }
  /* 모바일 텍스트 전환 */
  .desc-pc { display: none; }
  .desc-mobile { display: block; text-align: center; }
  .recommend-item .desc-mobile { text-align: left; }
  .process-step .desc-mobile { text-align: left; }

  /* growth.html — 모바일에서만 해당 소개 문단 숨김 */
  .pain-text-mobile-hide { display: none; }

  /* why-grid 모바일 — 번호와 제목을 한 줄로 배치 */
  .why-card {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    column-gap: 12px;
  }
  .why-num {
    margin-bottom: 0;
  }
  .why-title {
    margin-bottom: 0;
  }
  .why-desc {
    flex-basis: 100%;
    margin-top: 12px;
  }
  /* growth·breathing 전용 — symptoms-image-badge 텍스트 축소 (spine 제외) */
  .symptoms-badge-compact {
    font-size: 11px;
  }
  .symptoms-badge-compact strong {
    font-size: 18px;
  }

  /* 모바일 히어로 영상 전환 */
  .hero-video-pc { display: none; }
  .hero-video-mobile { display: block; }
  /* health 모바일 영상 — 기본 커버 공식은 유지한 채 확대만 추가해 여백 제거 */
  .hero-health .hero-video-wrap iframe {
    transform: translate(-50%, -50%) scale(1.4);
  }

  /* philo-card 모바일 축소 — PC 대비 카드 크기·텍스트 사이즈를 줄여 화면에 맞춤 */
  .philo-card {
    padding: 22px 20px;
    gap: 16px;
  }
  .philo-num {
    font-size: 26px;
  }
  .philo-card-title {
    font-size: 16px;
    margin-bottom: 6px;
  }
  .philo-card-desc {
    font-size: 13.5px;
    line-height: 1.7;
  }


  /* ── disease-grid 1열 전환 ── */
  .disease-grid {
    grid-template-columns: 1fr;
  }
  .disease-item {
    border-right: none !important;
    border-bottom: 1px solid rgba(139,111,71,0.25) !important;
    padding: 28px 20px;
  }
  .disease-item:last-child {
    border-bottom: none !important;
  }
}

@media (max-width: 900px) {
  .equipment-section {
    padding: 80px 24px;
  }
  .equipment-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .equip-img-wrap {
    aspect-ratio: 16 / 9;
  }
  .equip-num-bg {
    font-size: 52px;
  }
}

@media (max-width: 1200px) {
  .profile-section, .philosophy-section { grid-template-columns: 1fr; }

  /* 태블릿·모바일 프로필 섹션 스타일: 배경 박스 추가 */
  .profile-section {
    padding: 48px 24px;
    background: var(--cream);
  }

  /* alt-layout 배경 이미지 제거 (about.html) */
  .profile-section.alt-layout {
    background: var(--cream);
    grid-template-columns: 1fr;
  }

  /* 빈 사진 영역 숨김 */
  .profile-images {
    display: none;
  }

  .profile-info {
    padding: 32px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(44,36,24,0.08);
    opacity: 1 !important;
    transform: none !important;
    align-items: center;
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
  }

  .profile-logo-area {
    justify-content: center;
  }

  .career-list {
    align-items: center;
  }

  .career-list li {
    justify-content: center;
  }

  .profile-sign {
    width: 120px;
    margin-right: 0;
    margin-top: 24px;
  }

  .philosophy-section { padding: 48px 24px; }

  .why-section { padding: 64px 24px; }

  .why-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}
