//! Card component for displaying content in a structured way
//!
//! Follows L-COMPONENT-PROPS and L-COMPONENT-REUSE patterns.
//! Provides a reusable container for displaying information.

/// Generate card HTML
///
/// Creates a card with title, optional subtitle, and content.
/// Used for displaying project information, metrics, and other structured data.
pub fn card_html(title: &str, subtitle: Option<&str>, content: &str) -> String {
    format!(
        r#"<div class="bg-white rounded-lg shadow-md p-6">
            <div class="mb-4">
                <h3 class="text-lg font-semibold text-gray-900">{}</h3>
                {}
            </div>
            <div class="text-gray-700">
                {}
            </div>
        </div>"#,
        title,
        subtitle
            .map(|s| format!(r#"<p class="text-sm text-gray-600">{}</p>"#, s))
            .unwrap_or_default(),
        content
    )
}
