/* Custom styles for news portal */

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

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Prose styles for article content */
.prose {
    color: #374151;
    line-height: 1.75;
}

.prose h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #111827;
}

.prose h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #111827;
}

.prose p {
    margin-bottom: 1rem;
}

.prose ul,
.prose ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose a {
    color: #2563eb;
    text-decoration: underline;
}

.prose a:hover {
    color: #1e40af;
}

.prose img {
    margin: 1.5rem 0;
    border-radius: 0.5rem;
    width: 100%;
    height: auto;
}

.prose blockquote {
    margin: 1rem 0;
    padding-left: 1rem;
    border-left: 4px solid #d1d5db;
    font-style: italic;
    color: #6b7280;
}

.prose code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.prose pre {
    background-color: #f3f4f6;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.prose pre code {
    background-color: transparent;
    padding: 0;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

/* Focus styles */
*:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Mobile menu animations */
[data-mobile-menu] {
    transition: all 0.3s ease-in-out;
}

[data-mobile-menu].hidden {
    display: none !important;
}

/* Mobile menu button - ensure it's clickable */
[data-mobile-menu-button] {
    position: relative;
    z-index: 100;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure header doesn't block menu button */
header {
    position: relative;
    z-index: 50;
}

/* Mobile menu should be below header but above content */
[data-mobile-menu] {
    position: relative;
    z-index: 49;
}

/* Mobile menu button icon transition */
#menu-icon,
#close-icon {
    transition: opacity 0.2s ease-in-out;
    pointer-events: none;
}

/* Smooth transitions for mobile menu items */
[data-mobile-menu] a {
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    -webkit-tap-highlight-color: rgba(59, 130, 246, 0.1);
}

/* Ensure search form doesn't overlap menu button on very small screens */
@media (max-width: 640px) {
    header form[action*="search"] {
        max-width: calc(100% - 120px);
        min-width: 0;
    }
    
    [data-mobile-menu-button] {
        flex-shrink: 0;
    }
}

