/* Custom styles for Archimodulaire website */

/* ===== START: Force Article Titles Black ===== */

/* For <a> tags that are part of an article card or featured display and contain a title */
/* This targets the link itself to ensure it's not styled blue by default. */
.container .md\:flex a[href*="/article/"],
.container .grid a[href*="/article/"],
.container .space-y-6 a[href*="/article/"] {
    color: black !important;
}

/* For H2/H3 elements that are article titles, especially if they are links or contain links */
.container .md\:flex h2.font-bold,
.container .md\:flex h2.font-bold a,
.container .grid a[href*="/article/"] h3.font-bold,
.container .space-y-6 a[href*="/article/"] h3.font-bold {
    color: black !important;
}

/* Hover states: Ensure titles and their links remain black (or a defined non-blue color) on hover */
.container .md\:flex a[href*="/article/"]:hover,
.container .grid a[href*="/article/"]:hover,
.container .space-y-6 a[href*="/article/"]:hover {
    color: black !important; /* Or a subtle dark gray like #333 */
    /* text-decoration: underline; */ /* Optional: manage underline on hover */
}

.container .md\:flex h2.font-bold a:hover,
.container .grid a[href*="/article/"]:hover h3.font-bold,
.container .space-y-6 a[href*="/article/"]:hover h3.font-bold {
    color: black !important; /* Or a subtle dark gray */
    /* text-decoration: underline; */
}

/* 
The following general fallback has been removed as it was making section titles black.
Specific rules above handle article titles. Section titles are handled by a new rule below.

/* General fallback for any h2/h3 with .font-bold within the main container, just in case */
/* This also covers section titles like "Recent Articles" if they use h2.font-bold */
/* .container h2.font-bold,
.container h3.font-bold {
    color: black !important;
} */
*/

/* ===== END: Force Article Titles Black ===== */

/* ===== START: Style Section Titles on Index Page ===== */
/* Ensures section titles like "MATÉRIAUX UTILISÉS", "Recent Articles" are blue */
.container h2.font-bold.border-b {
    color: #1a56db !important; /* text-blue-700, a common blue for titles */
}
/* ===== END: Style Section Titles on Index Page ===== */

/* Global styles */
body {
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Text truncation for article cards */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2; /* Standard property */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

/* Article content styling */
.prose h2 {
    color: #1a56db;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.prose h3 {
    color: #2563eb;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
}

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

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

.prose img {
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

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

/* Search results dropdown */
#search-results {
    max-height: 300px;
    overflow-y: auto;
}

#search-results a {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}

#search-results a:hover {
    background-color: #f9fafb;
}

/* Language dropdown menu */
#language-menu {
    z-index: 50;
}

/* Source citations styles */
.source-citation {
    padding-left: 1.5rem;
    position: relative;
}

.source-citation::before {
    content: "•";
    position: absolute;
    left: 0.5rem;
    color: #4b5563;
}

/* Article images */
.article-image {
    margin: 2rem 0;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Utility classes */
.prose-content img {
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
    border-radius: 0.5rem;
}

/* Responsive image containers */
.image-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.image-container img {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

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

/* Banner placeholders */
.banner-placeholder {
    background-color: #f3f4f6;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #9ca3af;
    font-weight: 500;
    text-align: center;
    border-radius: 0.5rem;
}

/* Card hover effects */
.article-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Mobile menu animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-menu-open {
    display: block;
    animation: slideDown 0.2s ease-out;
}

/* Mobile menu styles */
#mobile-menu {
    transition: all 0.3s ease-in-out;
    max-height: 0;
    overflow: hidden;
}

#mobile-menu.is-active {
    display: block !important;
    max-height: 500px; /* Adjust based on your menu height */
}

/* Make sure mobile menu is properly hidden on larger screens */
@media (min-width: 768px) {
    #mobile-menu {
        display: none !important;
    }
}

/* Ensure mobile menu button works properly */
#mobile-menu-button {
    cursor: pointer;
}

/* Force footer links to always be gray */
footer a {
    color: #9ca3af !important; /* This is the hex equivalent of text-gray-400 */
}

footer a:hover {
    color: #9ca3af !important;
}

/* Remove outline from buttons in the header */
header button {
    outline: none !important;
    border: none !important;
    box-shadow: none;
}