/**
 * responsive.css - 반응형 스타일
 * 청주집수리 교육 (행집사)
 * Mobile-first 반응형 디자인
 */

/* ========================================
   1. 태블릿 가로 & 소형 데스크탑 (1024px 이하)
   ======================================== */
@media screen and (max-width: 1024px) {
    :root {
        --header-height: 64px;
    }

    .container {
        padding: 0 var(--space-md);
    }

    /* 네비게이션 */
    .main-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    /* 푸터 그리드 */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }

    .footer-links {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-brand {
        max-width: 100%;
    }

    /* 그리드 조정 */
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 섹션 패딩 */
    .section {
        padding: var(--space-3xl) 0;
    }

    /* 슬라이더 */
    .slider-slide img {
        height: 450px;
    }

    .slider-content h2 {
        font-size: var(--font-size-3xl);
    }

    .slider-nav {
        width: 44px;
        height: 44px;
    }
}

/* ========================================
   2. 태블릿 세로 (768px 이하)
   ======================================== */
@media screen and (max-width: 768px) {
    :root {
        --header-height: 60px;
        --space-3xl: 48px;
        --space-4xl: 64px;
    }

    /* 타이포그래피 조정 */
    .section-title {
        font-size: var(--font-size-3xl);
    }

    .section-desc {
        font-size: var(--font-size-base);
    }

    /* 히어로 섹션 */
    .hero-section {
        min-height: auto;
        padding: var(--space-3xl) 0;
    }

    .hero-title {
        font-size: var(--font-size-3xl);
    }

    .hero-subtitle {
        font-size: var(--font-size-base);
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .hero-cta .btn {
        width: 100%;
        max-width: 300px;
    }

    /* 그리드 조정 */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

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

    /* 카드 */
    .card {
        padding: var(--space-lg);
    }

    .price-card {
        padding: var(--space-xl);
    }

    /* 푸터 */
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-lg);
    }

    .footer-bottom-inner {
        flex-direction: column;
        text-align: center;
    }

    .footer-legal {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* 슬라이더 */
    .slider-slide img {
        height: 350px;
    }

    .slider-content {
        padding: var(--space-lg);
    }

    .slider-content h2 {
        font-size: var(--font-size-2xl);
    }

    .slider-content p {
        font-size: var(--font-size-base);
    }

    .slider-nav {
        width: 40px;
        height: 40px;
    }

    .slider-prev {
        left: var(--space-sm);
    }

    .slider-next {
        right: var(--space-sm);
    }

    /* 플로팅 버튼 */
    .floating-buttons {
        bottom: var(--space-lg);
        right: var(--space-lg);
    }

    .floating-btn {
        width: 50px;
        height: 50px;
    }

    /* 폼 */
    .form-group {
        margin-bottom: var(--space-md);
    }

    /* 페이지 헤더 */
    .page-header {
        padding: var(--space-2xl) 0;
    }

    .page-header-title {
        font-size: var(--font-size-3xl);
    }

    /* 팀 섹션 */
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* FAQ */
    .faq-item {
        padding: var(--space-md);
    }

    /* 리뷰 카드 */
    .review-card {
        padding: var(--space-lg);
    }

    /* 블로그 그리드 */
    .blog-grid {
        grid-template-columns: 1fr;
    }

    /* 연락처 */
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .contact-info {
        order: -1;
    }

    /* 가격표 */
    .pricing-grid {
        grid-template-columns: 1fr;
    }

    /* 서비스 카드 */
    .service-cards {
        grid-template-columns: 1fr;
    }

    /* 통계 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   3. 모바일 (480px 이하)
   ======================================== */
@media screen and (max-width: 480px) {
    :root {
        --header-height: 56px;
        --space-xl: 24px;
        --space-2xl: 32px;
        --space-3xl: 40px;
        --space-4xl: 48px;
        --font-size-6xl: 40px;
        --font-size-5xl: 36px;
        --font-size-4xl: 28px;
        --font-size-3xl: 24px;
        --font-size-2xl: 20px;
    }

    .container {
        padding: 0 var(--space-md);
    }

    /* 로고 */
    .logo-text {
        font-size: var(--font-size-lg);
    }

    .logo-img {
        height: 32px;
    }

    /* 히어로 */
    .hero-section {
        padding: var(--space-2xl) 0;
    }

    .hero-badge {
        padding: var(--space-xs) var(--space-md);
        font-size: var(--font-size-xs);
    }

    .hero-title {
        font-size: var(--font-size-2xl);
    }

    .hero-subtitle {
        font-size: var(--font-size-sm);
    }

    /* 버튼 */
    .btn {
        padding: var(--space-sm) var(--space-lg);
        font-size: var(--font-size-sm);
    }

    .btn-lg {
        padding: var(--space-md) var(--space-xl);
        font-size: var(--font-size-base);
    }

    /* 섹션 */
    .section {
        padding: var(--space-2xl) 0;
    }

    .section-header {
        margin-bottom: var(--space-xl);
    }

    .section-badge {
        font-size: var(--font-size-xs);
        padding: var(--space-xs) var(--space-sm);
    }

    .section-title {
        font-size: var(--font-size-2xl);
    }

    .section-desc {
        font-size: var(--font-size-sm);
    }

    /* 카드 */
    .card {
        padding: var(--space-md);
        border-radius: var(--radius-lg);
    }

    .card-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
        margin-bottom: var(--space-md);
    }

    .card-title {
        font-size: var(--font-size-lg);
    }

    .card-desc {
        font-size: var(--font-size-xs);
    }

    /* 가격 카드 */
    .price-card {
        padding: var(--space-lg);
    }

    .price-value {
        font-size: var(--font-size-3xl);
    }

    .price-features li {
        font-size: var(--font-size-xs);
    }

    /* 슬라이더 */
    .slider-slide img {
        height: 280px;
    }

    .slider-content h2 {
        font-size: var(--font-size-xl);
    }

    .slider-content p {
        font-size: var(--font-size-sm);
        margin-bottom: var(--space-md);
    }

    .slider-nav {
        width: 36px;
        height: 36px;
    }

    .slider-pagination {
        bottom: var(--space-md);
    }

    .slider-dot {
        width: 8px;
        height: 8px;
    }

    /* 푸터 */
    .footer-main {
        padding: var(--space-2xl) 0;
    }

    .footer-logo img {
        height: 32px;
    }

    .footer-logo span {
        font-size: var(--font-size-lg);
    }

    .footer-slogan {
        font-size: var(--font-size-xs);
    }

    .footer-links {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .footer-link-group h4 {
        font-size: var(--font-size-sm);
    }

    .footer-link-group a {
        font-size: var(--font-size-xs);
    }

    .footer-bottom {
        padding: var(--space-md) 0;
    }

    .footer-company-info p {
        font-size: 10px;
    }

    .footer-legal {
        gap: var(--space-sm);
    }

    .footer-legal a {
        font-size: 10px;
    }

    /* 플로팅 버튼 */
    .floating-buttons {
        bottom: var(--space-md);
        right: var(--space-md);
        gap: var(--space-sm);
    }

    .floating-btn {
        width: 44px;
        height: 44px;
    }

    .floating-btn svg {
        width: 20px;
        height: 20px;
    }

    /* 모바일 메뉴 */
    .mobile-menu-inner {
        padding: var(--space-md);
    }

    .mobile-menu-title {
        font-size: var(--font-size-lg);
    }

    .mobile-nav-category {
        font-size: var(--font-size-xs);
    }

    .mobile-nav-sub a,
    .mobile-nav-link {
        font-size: var(--font-size-sm);
        padding: var(--space-xs) var(--space-sm);
    }

    .mobile-nav-cta {
        padding: var(--space-sm) var(--space-md);
        font-size: var(--font-size-sm);
    }

    /* 폼 */
    .form-input,
    .form-textarea,
    .form-select {
        padding: var(--space-sm) var(--space-md);
        font-size: var(--font-size-sm);
    }

    .form-label {
        font-size: var(--font-size-xs);
    }

    /* 팀 그리드 */
    .team-grid {
        grid-template-columns: 1fr;
    }

    /* 통계 */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .stat-item {
        padding: var(--space-md);
    }

    .stat-value {
        font-size: var(--font-size-3xl);
    }

    .stat-label {
        font-size: var(--font-size-xs);
    }

    /* FAQ */
    .faq-question {
        font-size: var(--font-size-sm);
        padding: var(--space-sm);
    }

    .faq-answer {
        font-size: var(--font-size-xs);
        padding: var(--space-sm);
    }

    /* 리뷰 */
    .review-card {
        padding: var(--space-md);
    }

    .review-content {
        font-size: var(--font-size-sm);
    }

    .review-author {
        font-size: var(--font-size-xs);
    }

    /* 블로그 */
    .blog-card-title {
        font-size: var(--font-size-base);
    }

    .blog-card-excerpt {
        font-size: var(--font-size-xs);
    }

    /* 페이지 헤더 */
    .page-header {
        padding: var(--space-xl) 0;
    }

    .page-header-title {
        font-size: var(--font-size-2xl);
    }

    .page-header-desc {
        font-size: var(--font-size-sm);
    }

    /* 브레드크럼 */
    .breadcrumb {
        font-size: var(--font-size-xs);
    }
}

/* ========================================
   4. 초소형 모바일 (360px 이하)
   ======================================== */
@media screen and (max-width: 360px) {
    :root {
        --font-size-4xl: 24px;
        --font-size-3xl: 22px;
        --font-size-2xl: 18px;
    }

    .container {
        padding: 0 var(--space-sm);
    }

    .hero-title {
        font-size: var(--font-size-xl);
    }

    .hero-badge {
        font-size: 10px;
    }

    .btn {
        padding: var(--space-xs) var(--space-md);
        font-size: var(--font-size-xs);
    }

    .card-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .price-value {
        font-size: var(--font-size-2xl);
    }
}

/* ========================================
   5. 가로 모드 (Landscape)
   ======================================== */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: var(--space-xl) 0;
    }

    .hero-title {
        font-size: var(--font-size-2xl);
    }

    .slider-slide img {
        height: 250px;
    }
}

/* ========================================
   6. 고해상도 디스플레이 (Retina)
   ======================================== */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    /* 이미지 선명도 향상 */
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ========================================
   7. 다크/라이트 모드 지원 (선택적)
   ======================================== */
@media (prefers-color-scheme: light) {
    /* 라이트 모드일 때도 우주 테마 유지 */
    /* 필요시 변수 오버라이드 가능 */
}

/* ========================================
   8. 애니메이션 축소 모드
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .loading-overlay {
        display: none;
    }

    .cosmic-background {
        display: none;
    }
}

/* ========================================
   9. 프린트 스타일
   ======================================== */
@media print {
    body {
        background: white;
        color: black;
    }

    .site-header,
    .site-footer,
    .floating-buttons,
    .loading-overlay,
    .cosmic-background,
    .mobile-menu,
    .slider-nav,
    .slider-pagination {
        display: none !important;
    }

    .site-main {
        padding-top: 0;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: var(--font-size-xs);
        color: var(--text-muted);
    }

    .card,
    .btn {
        border: 1px solid #ccc;
        box-shadow: none;
    }
}

/* ========================================
   10. 특정 페이지 반응형
   ======================================== */

/* 홈페이지 - 과정 카드 */
@media screen and (max-width: 900px) {
    .course-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 600px) {
    .course-cards {
        grid-template-columns: 1fr;
    }

    .course-card {
        padding: var(--space-lg);
    }
}

/* 서비스 페이지 - 커리큘럼 */
@media screen and (max-width: 768px) {
    .curriculum-timeline {
        padding-left: var(--space-lg);
    }

    .curriculum-item {
        padding-left: var(--space-xl);
    }
}

/* 포트폴리오 - 갤러리 */
@media screen and (max-width: 600px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

/* 연락처 - 지도 */
@media screen and (max-width: 768px) {
    .map-container {
        height: 300px;
    }
}

@media screen and (max-width: 480px) {
    .map-container {
        height: 250px;
    }
}

/* 블로그 상세 */
@media screen and (max-width: 768px) {
    .blog-detail-content {
        font-size: var(--font-size-base);
    }

    .blog-detail-content h2 {
        font-size: var(--font-size-xl);
    }

    .blog-detail-content h3 {
        font-size: var(--font-size-lg);
    }
}

/* ========================================
   11. 터치 디바이스 최적화
   ======================================== */
@media (hover: none) and (pointer: coarse) {
    /* 호버 효과 대신 탭 효과 */
    .card:hover {
        transform: none;
    }

    .card:active {
        transform: scale(0.98);
    }

    .btn:hover {
        transform: none;
    }

    .btn:active {
        transform: scale(0.95);
    }

    /* 드롭다운 메뉴 터치 지원 */
    .dropdown-menu {
        display: none;
    }

    .has-dropdown.active .dropdown-menu {
        display: block;
        opacity: 1;
        visibility: visible;
    }

    /* 링크 터치 영역 확대 */
    .nav-link,
    .footer-link-group a {
        padding: var(--space-md);
    }

    /* 버튼 최소 크기 */
    .btn,
    .floating-btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ========================================
   12. Safe Area (노치 디스플레이)
   ======================================== */
@supports (padding: max(0px)) {
    .site-header {
        padding-left: max(var(--space-lg), env(safe-area-inset-left));
        padding-right: max(var(--space-lg), env(safe-area-inset-right));
    }

    .site-footer {
        padding-bottom: max(var(--space-lg), env(safe-area-inset-bottom));
    }

    .floating-buttons {
        right: max(var(--space-xl), env(safe-area-inset-right));
        bottom: max(var(--space-xl), env(safe-area-inset-bottom));
    }
}
