/*===============================================
  MOBILE RESPONSIVE IMPROVEMENTS
===============================================*/

/* Mobile menu toggle hidden by default */
.mobile-menu-toggle {
    display: none;
}

@media (max-width: 992px) {
    .hero-grid {
        gap: 40px;
    }

    .hero-left h1 {
        font-size: 46px;
    }

    nav ul,
    .nav-links {
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .container {
        width: 92%;
    }

    .article-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Force homepage projects into a clean single-column stack on phones */
    .projects-grid {
        grid-template-columns: 1fr !important;
        gap: 18px;
        margin-top: 30px;
    }

    .project-card {
        height: auto;
    }

    .project-card img {
        height: 190px;
        object-fit: cover;
    }

    .project-content {
        padding: 22px;
    }

    .project-content h3 {
        min-height: 0;
        font-size: 22px;
        line-height: 1.25;
        word-break: break-word;
    }

    .project-content p {
        font-size: 15px;
        line-height: 1.7;
    }

    .project-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .article-card {
        padding: 22px;
    }

    header .container {
        position: relative;
        height: auto;
        padding: 14px 0;
        flex-wrap: wrap;
    }

    .logo img {
        height: 78px;
    }

    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        gap: 4px;
        background: transparent;
        border: 0;
        padding: 10px;
        min-width: 44px;
        min-height: 44px;
        cursor: pointer;
        margin-left: auto;
    }

    .mobile-menu-toggle span {
        width: 24px;
        height: 2px;
        background: var(--dark);
        border-radius: 2px;
        transition: 0.3s ease;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    nav {
        width: 100%;
        order: 3;
        display: none;
    }

    nav.mobile-open {
        display: block;
    }

    nav ul,
    .nav-links {
        display: none;
        flex-direction: column;
        gap: 10px;
        padding-top: 12px;
        width: 100%;
    }

    nav.mobile-open ul,
    .nav-links.mobile-open {
        display: flex;
    }

    nav ul li a,
    .nav-links li a {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 10px 0;
        font-size: 16px;
        font-weight: 600;
    }

    /* Improve tap target size for content and footer links on phones */
    main li > a,
    main li strong > a,
    .knowledge-card a,
    .article-card a,
    .footer-legal a,
    footer a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }

    .hero {
        padding: 60px 0 45px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .hero-left h1 {
        font-size: 2.1rem;
        line-height: 1.2;
    }

    .hero-tag {
        font-size: 15px;
        padding: 10px 16px;
    }

    .hero-left p {
        font-size: 15px;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .hero-buttons a,
    .btn-primary,
    .btn-secondary {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .contact-form-card .form-step-actions,
    .contact-form-card .form-step-actions-split {
        flex-direction: column;
        align-items: stretch;
    }

    .contact-form-card .form-step-actions .btn-primary,
    .contact-form-card .form-step-actions .btn-secondary,
    .contact-form-card .form-step-actions-split .btn-primary,
    .contact-form-card .form-step-actions-split .btn-secondary {
        width: 100%;
    }

    .form-steps {
        gap: 8px;
    }

    .form-step-dot {
        font-size: 12px;
        padding: 6px 10px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .stat-card h2 {
        font-size: 28px;
    }

    .section-title h2 {
        font-size: 1.7rem;
    }

    .section-title p {
        font-size: 15px;
    }
}

/* Extra small screen adjustments */
@media (max-width: 480px) {
    .logo img {
        height: 66px;
    }

    .hero-left h1 {
        font-size: 1.8rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .section-title h2 {
        font-size: 1.45rem;
    }

    .hero-buttons a {
        font-size: 15px;
        padding: 12px 16px;
    }
}
