/* 
 * Card Styles - Fix for Homepage Grid Layout
 * Separated to ensure loading priority and avoid syntax errors in main stylesheet
 */

/* Grid Layout */
.sites-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
    gap: 20px !important;
}

/* Site Card Style */
.site-card {
    background: #fff !important;
    border-radius: 12px !important;
    padding: 20px !important;
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    transition: all 0.3s ease !important;
    border: 1px solid #f6f7f9 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02) !important;
    height: auto !important;
    min-height: 80px !important;
    text-decoration: none !important;
    margin-bottom: 0 !important;
}

/* Hover Effect */
.site-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
    border-color: transparent !important;
    z-index: 10;
}

/* Icon Style - Optimized to 32px */
.site-icon {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
    background: #f0f0f0 !important;
    margin: 0 !important;
    display: block !important;
    /* Ensure alt text is visible if image breaks */
    color: #fff !important;
    text-align: center !important;
    line-height: 32px !important;
    font-size: 14px !important;
    font-weight: bold !important;
    position: relative !important;
}

/* Fallback for broken images - Show First Letter */
.site-icon:before {
    content: attr(alt);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: -1;
    /* Behind image if it loads */
}

/* If image fails to load */
.site-icon[src=""],
.site-icon:not([src]) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* Info Container */
.site-info {
    flex: 1 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}

/* Title Style */
.site-title {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #1f2937 !important;
    margin-bottom: 4px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.4 !important;
}

/* Description Style */
.site-desc {
    font-size: 12px !important;
    color: #6b7280 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    opacity: 1 !important;
    line-height: 1.4 !important;
    display: block !important;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .sites-grid {
        grid-template-columns: 1fr !important;
    }

    .site-card {
        padding: 15px !important;
        min-height: 70px !important;
    }

    .site-icon {
        width: 28px !important;
        height: 28px !important;
        line-height: 28px !important;
        font-size: 12px !important;
    }

    .site-title {
        font-size: 14px !important;
    }

    .site-desc {
        font-size: 11px !important;
    }
}