/* Recipe Grid */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    align-items: stretch; /* Ensure all cards in a row have the same height */
}

.recipe-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column; /* Allow content to stretch and fill card */
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.recipe-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: var(--transition);
}

.recipe-card:hover .recipe-image {
    transform: scale(1.05);
}

.recipe-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allow content to expand and fill available space */
}

.recipe-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.recipe-card .recipe-description {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    flex-grow: 1; /* Allow description area to expand and push meta/actions to bottom */
    height: 4.5em; /* Fixed height for exactly 3 lines (1.5 line-height × 3 lines) */
    overflow: hidden; /* Hide any overflow text */
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limit to 3 lines */
    line-clamp: 3; /* Standard property for compatibility */
    -webkit-box-orient: vertical;
}

.recipe-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.recipe-time, .recipe-difficulty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-light);
    text-align: center;
}

.recipe-time i, .recipe-difficulty i {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.time-value {
    font-size: 0.85rem;
    color: var(--text-dark);
    font-weight: 500;
    line-height: 1.2;
}

.time-label {
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recipe-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Responsive Design */
@media (max-width: 768px) {     
    
    .recipe-grid {
        grid-template-columns: 1fr;
    }
    
    .recipe-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {    
    
    .recipe-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}