/* Custom animations and utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* HTMX transitions */
.htmx-swapping {
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.htmx-added {
    opacity: 0;
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Form focus improvements */
input:focus, textarea:focus, select:focus {
    outline: none;
}

/* Ensure images never overflow their containers */
img {
    max-width: 100%;
    height: auto;
}

/* Image hover zoom container */
.img-zoom-container {
    overflow: hidden;
}

.img-zoom-container img {
    transition: transform 0.3s ease;
}

.img-zoom-container:hover img {
    transform: scale(1.05);
}

/* Prevent long words / URLs from breaking layout */
body {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Mobile-friendly tables: ensure overflow-x-auto works smoothly */
.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
}
