/* Mobile Optimization Styles */

/* Touch Targets - Ensure minimum 44x44px */
@media (max-width: 1024px) {
    button:not(.no-touch-target),
    a.button,
    input[type="submit"],
    input[type="button"],
    .btn,
    .mobile-button {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem 1rem;
    }

    /* Links should have adequate touch target (but not all links) */
    nav a,
    .mobile-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        padding: 0.5rem 0.75rem;
    }

    /* Adequate spacing between touch targets */
    button + button,
    a + a,
    button + a,
    a + button {
        margin-left: 0.5rem;
    }

    /* Form inputs larger on mobile */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="search"],
    input[type="tel"],
    textarea,
    select,
    .mobile-input {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem 1rem;
    }

    /* Form labels and spacing */
    label {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    /* Better spacing for form groups */
    .form-group,
    form > div {
        margin-bottom: 1rem;
    }
}

/* Mobile-specific font optimizations */
@media (max-width: 768px) {
    body {
        font-size: 16px; /* Base font size for readability */
        line-height: 1.6; /* Adequate line spacing */
    }

    h1 {
        font-size: 1.75rem;
        line-height: 1.3;
    }

    h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    h3 {
        font-size: 1.25rem;
        line-height: 1.4;
    }

    p {
        line-height: 1.6;
        margin-bottom: 1rem;
    }

    /* Better spacing for mobile cards */
    .card,
    .bg-white.rounded-lg,
    .bg-white.rounded-xl {
        padding: 1rem;
        margin-bottom: 1rem;
    }
}

/* Prevent layout shift with images */
img {
    max-width: 100%;
    height: auto;
}

/* Lazy loading placeholder */
img[loading="lazy"] {
    background-color: #f3f4f6;
    min-height: 200px;
}

/* Optimize grid layouts for mobile */
@media (max-width: 640px) {
    .grid {
        gap: 1rem;
    }

    /* Single column on very small screens */
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4,
    .grid-cols-5 {
        grid-template-columns: 1fr;
    }
}

/* Better form layout on mobile */
@media (max-width: 768px) {
    form {
        width: 100%;
    }

    /* Stack form inputs vertically on mobile */
    .flex.items-center.space-x-3 {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .flex.items-center.space-x-3 > * {
        width: 100%;
    }

    /* Full width buttons on mobile */
    button[type="submit"],
    input[type="submit"] {
        width: 100%;
    }
}

/* Optimize navigation for mobile */
@media (max-width: 1024px) {
    nav a {
        padding: 0.75rem 1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Compact Latest Boats Section */
#latest-boats .bg-white.rounded-lg {
    max-height: 56px;
    overflow: hidden;
}

#latest-boats .bg-white.rounded-lg > div {
    max-height: 56px;
    overflow: hidden;
}

/* Force description to single line and hide newlines */
#latest-boats p.text-gray-500,
#latest-boats p.text-xs.text-gray-500 {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-height: 1em !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}

/* Ensure flex container doesn't expand */
#latest-boats .flex.items-center,
#latest-boats .flex.items-start {
    max-height: 56px;
    align-items: flex-start !important;
}

/* Remove any extra spacing */
#latest-boats .flex-1.min-w-0 {
    max-height: 56px;
    overflow: hidden;
}


