/* ===================================
   Responsive CSS
   반응형 디자인
=================================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    :root {
        --spacing-3xl: 80px;
        --spacing-2xl: 56px;
    }

    h1 {
        font-size: 3rem;
    }

    h2 {
        font-size: 2.5rem;
    }

    .hero {
        min-height: 90vh;
    }

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

/* Mobile Large (577px - 768px) */
@media (max-width: 768px) {
    :root {
        --spacing-3xl: 64px;
        --spacing-2xl: 48px;
        --spacing-xl: 40px;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    section {
        padding: var(--spacing-2xl) 0;
    }

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

    /* Hero */
    .hero {
        min-height: 100vh;
        padding-top: 60px;
    }

    .hero-content {
        grid-template-columns: 1fr;
        padding: 0 var(--spacing-md);
        margin-top: -130px;
        /* Pull text up drastically */
    }

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

    .hero-subtitle {
        font-size: 1.1rem;
    }

    /* Show scroll indicator on mobile hero */
    .scroll-indicator {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        position: absolute !important;
        bottom: 15% !important;
        /* Adaptive positioning */
        left: 50% !important;
        transform: translateX(-50%) !important;
        z-index: 10000 !important;
        opacity: 1 !important;
    }

    /* Hide scroll indicator when menu is open to prevent overlap */
    body.menu-open .scroll-indicator {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }

    .hero-stats {
        margin-top: var(--spacing-lg);
    }

    .hero-form {
        padding: var(--spacing-lg);
    }

    /* About */
    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    /* Practice Areas */
    .practice-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    /* Lawyers */
    .lawyers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }

    /* Success Cases */
    .cases-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    /* Contact */
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }

    .map-container {
        height: 300px;
    }
}

/* Mobile (up to 576px) */
@media (max-width: 576px) {
    :root {
        --spacing-3xl: 48px;
        --spacing-2xl: 40px;
        --spacing-xl: 32px;
        --spacing-lg: 24px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.25rem;
    }

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

    section {
        padding: var(--spacing-xl) 0;
    }

    /* Typography */
    .section-description {
        font-size: 1rem;
    }

    /* Hero */
    .hero {
        padding-top: 80px;
    }

    .hero-title {
        font-size: 2rem;
        margin-bottom: var(--spacing-md);
    }

    .hero-subtitle {
        font-size: 1.125rem;
        margin-bottom: var(--spacing-lg);
    }

    .hero-stats {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        margin-top: var(--spacing-lg);
    }

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

    .hero-form {
        padding: var(--spacing-md);
    }

    .form-header h3 {
        font-size: 1.25rem;
    }

    .form-phone {
        font-size: 1rem;
        padding: var(--spacing-sm) var(--spacing-md);
    }

    /* Buttons */
    .btn {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: 0.95rem;
    }

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

    /* Navbar */
    .navbar-container {
        padding: var(--spacing-sm) var(--spacing-md);
    }

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

    .navbar-menu {
        width: 100%;
        right: -100%;
    }

    .navbar-menu.active {
        display: flex;
    }

    /* 모바일에서 전화번호 버튼 숨김 */
    .navbar-phone-btn {
        display: none;
    }

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

    .navbar-menu {
        width: 100%;
        right: -100%;
    }

    .navbar-menu.active {
        display: flex;
    }

    /* 모바일에서 전화번호 버튼 숨김 */
    .navbar-phone-btn {
        display: none;
    }

    /* About */
    .about-card {
        padding: var(--spacing-lg);
    }

    .card-icon svg {
        width: 40px;
        height: 40px;
    }

    /* Practice Areas */
    .practice-card {
        padding: var(--spacing-lg);
    }

    .practice-icon {
        font-size: 2.5rem;
    }

    /* Lawyers */
    .lawyers-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .lawyer-info {
        padding: var(--spacing-md);
    }

    /* Case Cards */
    .case-card {
        padding: var(--spacing-lg);
    }

    .case-card h3 {
        font-size: 1.25rem;
    }

    /* Contact */
    .info-card {
        padding: var(--spacing-lg);
    }

    .info-icon {
        width: 56px;
        height: 56px;
    }

    .info-icon svg {
        width: 28px;
        height: 28px;
    }

    .contact-form-wrapper {
        padding: 0;
    }

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

    /* Footer - Smart Grid for Compact Mobile Layout */
    .footer {
        padding: 40px 0 25px;
    }

    .footer-container {
        padding: 0 20px;
    }

    .footer-top {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        /* 2 columns for links */
        gap: 25px 10px;
        /* Row gap 20px, Col gap 10px */
        padding-bottom: 25px;
        margin-bottom: 25px;
        text-align: center;
        /* Default left alignment for links */
    }

    .footer-col {
        text-align: center;
        width: 100%;
        padding: 0;
    }

    /* 1. Brand Section: Full Width at Top */
    .footer-col.brand-col {
        grid-column: 1 / -1;
        margin-bottom: 15px;
    }

    /* 2 & 3. Link Sections: Side-by-Side (Default behavior in 2-col grid) */
    /* No special rule needed, they will flow into row 2 */

    /* 4. Contact Section: Full Width at Bottom */
    .footer-col.contact-col {
        grid-column: 1 / -1;
        margin-top: 15px;
        padding-top: 20px;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }

    .footer-logo-text {
        font-size: 1.4rem;
        margin-bottom: 10px;
        text-align: center;
    }

    .footer-desc {
        font-size: 0.85rem;
        line-height: 1.5;
        margin-bottom: 15px;
        text-align: center;
    }

    .footer-col h4 {
        font-size: 0.95rem;
        margin-bottom: 12px;
        font-weight: 700;
        /* Remove blue underline on mobile for cleaner grid */
        border-bottom: none;
        padding-bottom: 0;
    }

    .footer-col h4::after {
        display: none;
    }

    .footer-links-list {
        align-items: center;
        /* Left align links */
        width: 100%;
    }

    .footer-links-list a {
        font-size: 0.85rem;
        padding: 4px 0;
        color: #aaa;
    }

    .footer-social {
        justify-content: center;
        gap: 12px;
        margin-top: 0;
    }

    /* Footer Bottom - Centered & Wrapper */
    .footer-bottom {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding-top: 20px;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        align-items: center;
        /* Ensure absolute centering */
    }

    .legal-links {
        display: flex;
        flex-wrap: wrap;
        /* Allow wrapping to 2 lines */
        justify-content: center;
        /* Center the wrapped items */
        gap: 10px 20px;
        /* Vertical gap 10px, Horizontal gap 20px */
        width: 100%;
        margin-bottom: 5px;
    }

    .legal-links a {
        font-size: 0.85rem;
        color: #ddd;
        white-space: nowrap;
        /* Keep individual link text together */
    }

    .copyright {
        font-size: 0.75rem;
        color: #888;
        margin-bottom: 5px;
    }

    .biz-info {
        display: flex;
        flex-direction: column;
        /* Stack vertically for clear reading */
        gap: 6px;
        font-size: 0.75rem;
        color: #666;
        align-items: center;
        /* Center align items */
        text-align: center;
        /* Center text */
        width: 100%;
    }

    .biz-info span {
        display: block;
        margin-right: 0;
        /* Remove right margins in vertical mode */
    }

    .biz-info span::after {
        display: none;
        /* Remove separators if any */
    }

    .scroll-to-top {
        width: 45px;
        height: 45px;
        bottom: var(--spacing-md);
        right: var(--spacing-md);
    }

    .scroll-indicator {
        display: none;
    }
}

/* Very Small Mobile (up to 375px) */
@media (max-width: 375px) {
    :root {
        font-size: 14px;
    }

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

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

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

/* Landscape Orientation */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--spacing-3xl) 0;
    }

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

    .scroll-indicator {
        display: none;
    }
}

/* Print Styles */
@media print {

    .navbar,
    .scroll-to-top,
    .scroll-progress,
    .hero-form {
        display: none !important;
    }

    section {
        page-break-inside: avoid;
    }

    .hero {
        min-height: auto;
        padding: var(--spacing-lg) 0;
    }

    /* Show scroll indicator on mobile hero */
    .scroll-indicator {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        position: absolute !important;
        /* Anchor to hero section */
        bottom: 100px !important;
        /* Safe distance from bottom */
        left: 50% !important;
        transform: translateX(-50%) !important;
        z-index: 9999 !important;
        /* Max visibility */
    }
}

/* Accessibility - 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;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .hero-overlay {
        background: rgba(0, 0, 0, 0.9);
    }

    .practice-card {
        border: 2px solid var(--accent-gold);
    }

    .btn-primary {
        border: 2px solid var(--white);
    }
}