/*
 * 인천 집수리 교육 - Responsive Stylesheet
 * Toss-style mobile-first responsive design
 * Location: /assets/css/responsive.css
 */

/* ========================================
   Tablet Styles (max-width: 1024px)
   ======================================== */
@media (max-width: 1024px) {
    :root {
        --space-4xl: 64px;
        --space-3xl: 48px;
    }

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

    /* Header */
    .header-inner {
        padding: 0 var(--space-md);
    }

    .main-nav ul {
        gap: 0;
    }

    .main-nav a {
        padding: var(--space-sm) var(--space-sm);
        font-size: 0.875rem;
    }

    .header-cta {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.8125rem;
    }

    /* Hero */
    .hero-title {
        font-size: clamp(2rem, 5vw, 3rem);
    }

    .hero-description {
        font-size: 1.125rem;
    }

    /* Grids */
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-top {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-2xl);
    }

    .footer-brand {
        grid-column: span 2;
        max-width: none;
    }

    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
    }

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

    .stat-number {
        font-size: 2.5rem;
    }

    /* Blog */
    .blog-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   Mobile Landscape (max-width: 768px)
   ======================================== */
@media (max-width: 768px) {
    :root {
        --space-4xl: 48px;
        --space-3xl: 32px;
        --space-2xl: 24px;
    }

    /* Typography */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .section-title {
        font-size: 1.5rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    /* Header / Navigation */
    .main-nav {
        display: none;
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-card);
        flex-direction: column;
        padding: var(--space-lg);
        z-index: var(--z-modal);
        overflow-y: auto;
    }

    .main-nav.active {
        display: flex;
    }

    .main-nav ul {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .main-nav li {
        width: 100%;
    }

    .main-nav a {
        padding: var(--space-md) var(--space-lg);
        border-radius: var(--radius-md);
        font-size: 1rem;
        justify-content: space-between;
    }

    .nav-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        padding-left: var(--space-lg);
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition-normal);
    }

    .main-nav li.dropdown-open .nav-dropdown {
        max-height: 500px;
    }

    .header-cta {
        display: none;
    }

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

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* Hero */
    .hero-section {
        min-height: auto;
        padding: calc(72px + var(--space-2xl)) 0 var(--space-2xl);
    }

    .hero-content {
        padding: var(--space-2xl) var(--space-md);
    }

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

    .hero-title {
        font-size: clamp(1.75rem, 7vw, 2.5rem);
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    /* Buttons */
    .btn {
        padding: var(--space-md) var(--space-lg);
        font-size: 0.9375rem;
    }

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

    /* Cards */
    .card-content {
        padding: var(--space-lg);
    }

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

    .feature-icon {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }

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

    .pricing-price {
        font-size: 2rem;
    }

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

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

    /* Grids */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer-top {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .footer-brand {
        grid-column: auto;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    .footer-info {
        text-align: center;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }

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

    .stat-number {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.8125rem;
    }

    .stat-divider {
        display: none;
    }

    /* Blog */
    .blog-list {
        grid-template-columns: 1fr;
    }

    /* Page Header */
    .page-header {
        padding: calc(72px + var(--space-2xl)) 0 var(--space-2xl);
    }

    .page-header h1 {
        font-size: 1.75rem;
    }

    .page-header p {
        font-size: 1rem;
    }

    /* FAQ */
    .faq-question {
        padding: var(--space-md) var(--space-lg);
        font-size: 0.9375rem;
    }

    .faq-item.active .faq-answer {
        padding: var(--space-md) var(--space-lg);
    }

    /* Team */
    .team-avatar {
        width: 100px;
        height: 100px;
    }

    /* Contact Form */
    .contact-info {
        padding: var(--space-xl);
    }

    .contact-form-wrapper {
        padding: var(--space-xl);
    }

    /* Map */
    .map-container iframe {
        height: 300px;
    }

    /* Slider */
    .slider-nav {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

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

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

    /* Scroll to Top */
    .scroll-to-top {
        bottom: var(--space-md);
        right: var(--space-md);
        width: 44px;
        height: 44px;
    }

    /* Hero Orbs - Hide on mobile */
    .hero-orb {
        opacity: 0.3;
    }

    .hero-orb-1 {
        width: 300px;
        height: 300px;
    }

    .hero-orb-2 {
        width: 250px;
        height: 250px;
    }

    .hero-orb-3 {
        width: 200px;
        height: 200px;
    }
}

/* ========================================
   Mobile Portrait (max-width: 480px)
   ======================================== */
@media (max-width: 480px) {
    :root {
        --space-4xl: 32px;
        --space-3xl: 24px;
        --space-2xl: 20px;
        --space-xl: 16px;
    }

    html {
        font-size: 15px;
    }

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

    /* Typography */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.375rem; }

    .section-title {
        font-size: 1.375rem;
    }

    /* Header */
    .header-inner {
        height: 64px;
        padding: 0 var(--space-md);
    }

    .logo img {
        height: 32px;
    }

    .logo-text {
        font-size: 1rem;
    }

    .main-nav {
        top: 64px;
    }

    /* Hero */
    .hero-section {
        padding-top: calc(64px + var(--space-xl));
    }

    .hero-title {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    .hero-description {
        font-size: 0.9375rem;
    }

    .hero-badge {
        font-size: 0.6875rem;
    }

    /* Cards */
    .card-title {
        font-size: 1.125rem;
    }

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

    .feature-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .feature-title {
        font-size: 1.125rem;
    }

    .feature-description {
        font-size: 0.875rem;
    }

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

    .pricing-name {
        font-size: 1.125rem;
    }

    .pricing-price {
        font-size: 1.75rem;
    }

    .course-title {
        font-size: 1.125rem;
    }

    .course-price {
        font-size: 1.25rem;
    }

    .testimonial-quote {
        font-size: 1rem;
    }

    .testimonial-avatar {
        width: 48px;
        height: 48px;
    }

    /* Buttons */
    .btn {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.875rem;
    }

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

    /* Stats */
    .stats-grid {
        gap: var(--space-sm);
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    /* Footer */
    .footer-social a {
        width: 36px;
        height: 36px;
    }

    .footer-column h4 {
        font-size: 0.8125rem;
    }

    .footer-links a {
        font-size: 0.875rem;
    }

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

    /* Page Header */
    .page-header h1 {
        font-size: 1.5rem;
    }

    .page-header p {
        font-size: 0.9375rem;
    }

    /* Team */
    .team-avatar {
        width: 80px;
        height: 80px;
    }

    .team-name {
        font-size: 1.125rem;
    }

    /* Contact */
    .contact-info h3 {
        font-size: 1.25rem;
    }

    .contact-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    /* Blog */
    .blog-title {
        font-size: 1rem;
    }

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

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

    /* Scroll to Top */
    .scroll-to-top {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* ========================================
   Landscape Mode Adjustments
   ======================================== */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: var(--space-xl) 0;
    }

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

    .hero-title {
        font-size: 1.5rem;
    }

    .page-header {
        padding: calc(64px + var(--space-lg)) 0 var(--space-lg);
    }
}

/* ========================================
   Large Desktop (min-width: 1400px)
   ======================================== */
@media (min-width: 1400px) {
    .container-wide {
        max-width: 1600px;
    }

    .hero-title {
        font-size: 4.5rem;
    }

    .section-title {
        font-size: 2.5rem;
    }
}

/* ========================================
   High DPI / Retina Displays
   ======================================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Use higher resolution images */
    .logo img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ========================================
   Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .hero-orb {
        animation: none;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ========================================
   Dark Mode Support (Optional)
   ======================================== */
@media (prefers-color-scheme: dark) {
    /* Dark mode can be enabled by adding .dark-mode class to body */
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .site-header,
    .site-footer,
    .scroll-to-top,
    .slider-nav,
    .slider-pagination,
    .hero-background,
    .mobile-menu-toggle {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .container {
        max-width: none;
        padding: 0;
    }

    .card,
    .feature-card,
    .pricing-card,
    .course-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    a {
        color: black;
        text-decoration: underline;
    }

    .btn {
        border: 1px solid black;
        background: white !important;
        color: black !important;
    }
}

/* ========================================
   Safe Area Insets (for notched devices)
   ======================================== */
@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-xl), env(safe-area-inset-bottom));
    }

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

/* ========================================
   Hover State for Touch Devices
   ======================================== */
@media (hover: none) {
    .card:hover,
    .feature-card:hover,
    .pricing-card:hover,
    .course-card:hover,
    .blog-card:hover,
    .team-card:hover,
    .testimonial-card:hover {
        transform: none;
    }

    .btn:hover {
        transform: none;
    }

    .main-nav a:hover {
        background: transparent;
    }
}

/* ========================================
   Focus Visible for Accessibility
   ======================================== */
:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}
